Files
FESADev/phases/linear-static-3d-euler-beam/step17.md
T

3.2 KiB

Step 17: oneTBB ParallelFor Adapter

과거 개발 계획이다. 아래 작업·상태·예시는 현재 실행 지시가 아니다. 현재 구현과 검증 한계는 기능 요약을 따른다.

읽어야 할 파일

  • /AGENTS.md
  • ../../docs/solver-core/README.md
  • ../../docs/solver-core/README.md
  • ../../docs/linear-static-3d-euler-beam/README.md
  • /include/fesa/core/status.hpp
  • /include/fesa/elements/euler_beam_3d.hpp
  • /src/fesa/elements/euler_beam_3d.cpp
  • /tests/unit/elements/euler_beam_3d_test.cpp
  • /cmake/FesaDependencies.cmake
  • /src/fesa/CMakeLists.txt
  • /tests/CMakeLists.txt

소유 파일

  • Create: /include/fesa/assembly/parallel_for.hpp
  • Create: /src/fesa/assembly/parallel_for.cpp
  • Create: /tests/unit/assembly/parallel_for_test.cpp
  • Modify: /src/fesa/CMakeLists.txt
  • Modify: /tests/CMakeLists.txt

작업

solver core에서 oneTBB header/type을 숨기는 element-local loop adapter를 구현하라.

class ParallelFor {
public:
    virtual ~ParallelFor() = default;
    virtual void execute(std::size_t count,
                         const std::function<void(std::size_t)>& body) const = 0;
};
class SerialParallelFor final : public ParallelFor { /* same contract */ };
class TbbParallelFor final : public ParallelFor { /* oneTBB implementation in .cpp */ };

각 index는 정확히 한 번 처리하고 count==0은 no-op이다. Element-local 결과는 호출자가 index-addressed storage에 기록해 scheduling과 무관한 ordering을 갖게 한다. Adapter는 전역 sparse matrix write나 reduction을 수행하지 않는다. Oversubscription 정책은 implementation comment와 test/implementation report에 남기고, 이 step에서 임의 global thread setting을 바꾸지 않는다.

Tests는 zero/one/many counts, exact-once, serial/TBB semantic equivalence, stable index-addressed output, exception propagation policy를 검증하고 ParallelFor regex로 등록한다.

Acceptance Criteria

과거 도구 실행·출력 지시는 정리했으며, 현재 검증 방법은 기능 요약을 따른다.

RED 후 GREEN/VERIFY:

과거 도구 실행·출력 지시는 정리했으며, 현재 검증 방법은 기능 요약을 따른다.

마지막 scan은 public header에서 no-match여야 한다.

검증 절차

  1. adapter conformance tests를 먼저 작성하고 RED를 확인한다.
  2. Serial과 oneTBB 최소 구현으로 GREEN을 만든다.
  3. public boundary scan과 전체 VERIFY를 실행한다.
  4. ../../docs/linear-static-3d-euler-beam/README.md의 Step 17 section에 실제 RED/GREEN/VERIFY command, exit code, 핵심 output과 변경 파일을 기록한다.
  5. Step 17을 completed로 갱신하고 deterministic-use contract를 summary에 기록한다.

금지사항

  • 전역 sparse storage에 병렬 write하지 마라. 이유: ordering/race는 Step 18이 통제한다.
  • TBB type/header를 public API에 노출하지 마라. 이유: adapter boundary 계약이다.
  • process-wide thread count를 임의 변경하지 마라. 이유: MKL/TBB policy가 불명확해진다.
  • 직접 commit하지 마라. 이유: Harness executor가 담당한다.