Skip to content
Snippets Groups Projects
Commit 6021abae authored by Kurt A. O'Hearn's avatar Kurt A. O'Hearn
Browse files

sPuReMD: correctly set the number of OpenMP threads.

parent 0d1076f1
No related branches found
No related tags found
No related merge requests found
...@@ -1290,12 +1290,7 @@ void Initialize( reax_system *system, control_params *control, ...@@ -1290,12 +1290,7 @@ void Initialize( reax_system *system, control_params *control,
{ {
#pragma omp single #pragma omp single
{ {
if ( control->num_threads_set == TRUE ) if ( control->num_threads_set == FALSE )
{
/* set using control file num_threads keyword */
omp_set_num_threads( control->num_threads );
}
else
{ {
/* set using OMP_NUM_THREADS environment variable */ /* set using OMP_NUM_THREADS environment variable */
control->num_threads = omp_get_num_threads( ); control->num_threads = omp_get_num_threads( );
...@@ -1303,6 +1298,8 @@ void Initialize( reax_system *system, control_params *control, ...@@ -1303,6 +1298,8 @@ void Initialize( reax_system *system, control_params *control,
} }
} }
} }
omp_set_num_threads( control->num_threads );
#else #else
control->num_threads = 1; control->num_threads = 1;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment