Workload Distribution
- Load imbalance is the condition when some processors do more work then others. Load imbalance will lead to bad scalability.
- Load imbalance can be diagnosed by profiling the programs and comparing the execution times for code in different threads
- In OpenMP, compiler accepts directives for work distribution:
- C$OMP DO SCHEDULE(type[,chunk]) where type is
- STATIC iterations are divided into pieces at compile time (default)
-
-
- DYNAMIC iterations assigned to processors as they finish, dynamically. This requires synchronization after each chunk iterations.
- GUIDED pieces reduce exponentially in size with each dispatched piece
-
-
- RUNTIME schedule determined by an environment variable OMP_SCHEDULE With RUNTIME it is illegal to specify chunk.
- Compiler accepts -mp_schedtype=type switch