MengeCrowdSim / Menge

The source code for the Menge crowd simulation framework
Apache License 2.0
138 stars 64 forks source link

Need command-line argument to control maximum threads #153

Open curds01 opened 3 years ago

curds01 commented 3 years ago

Related to #152. This issue tracks the need to add a command-line argument to control maximum number of threads.

Design

The new command line parameter takes a non-negative integer. It is the maximum allowed number of threads. The executable will compare that number with the maximum possible number of threads reported by OpenMP and set the maximum allowed number of threads to the smaller of the two values.

OpenMP guide to using omp_set_num_threads

Note

While waiting for this issue, this can be indirectly controlled by configuring environment variables in the context in which Menge runs. See: https://software.intel.com/content/www/us/en/develop/documentation/mkl-windows-developer-guide/top/managing-performance-and-memory/improving-performance-with-threading/setting-the-number-of-threads-using-an-openmp-environment-variable.html