ASFHyP3 / hyp3-gamma

HyP3 plugin for generating SAR products with GAMMA
BSD 3-Clause "New" or "Revised" License
30 stars 7 forks source link

add ++omp-num-threads parameter to main() entrypoint #428

Closed asjohnston-asf closed 1 year ago

asjohnston-asf commented 1 year ago

GAMMA programs use OpenMP for parallel processing. The number of threads used range from 3-12+ from program to program. This can lead to severe CPU contention when running multiple GAMMA jobs on the same machine, drastically increasing the run time of those jobs.

This PR adds a command line parameter to the main() entrypoint to set the OMP_NUM_THREADS environment variable. See https://www.ibm.com/docs/en/zos/2.2.0?topic=suce-environment-variables-openmp

This allows running multiple jobs on the same machine without CPU contention. For example, running two jobs on an 8 core machine would typically result in both jobs trying to use all 8 cores at the same time. Setting ++omp-num-threads=4 for each job would limit the total demand to match the number of available cores and eliminates the performance degradation.