# Loop parallelization (1D FDTD) **Loop parallelization** assigns different spatial iterations of a field update to different threads. FDTD OpenMP distributes both the magnetic and electric loops with `omp for`: ```c #pragma omp for schedule(static) for (size_t k = 0; k < width - 1; k++) { Hy[k] = Ch1[k] * Hy[k] + Ch2[k] * (Ez[k + 1] - Ez[k]); } ``` Each magnetic iteration writes only `Hy[k]` and reads electric values that remain unchanged during that phase. Neighboring iterations can read the same electric element without conflicting. The electric loop has the same structure, with distinct electric destinations and shared magnetic reads. The time-step loop is not distributed. Each step depends on the fields produced by the previous one, and the electric phase depends on the current magnetic update. An implicit barrier completes each spatial loop before the next phase starts. This combination exposes parallel work within a phase while retaining the ordering required by [[fdtd-openmp-time-stepping|time stepping]].