Skip to content
Snippets Groups Projects
Commit 4e3774ff authored by carlocamilloni's avatar carlocamilloni
Browse files

OpenMP: added api for setting the number of OpenMP threads

update GMX2018.3 accordingly
- including API check
parent 480ee424
No related branches found
No related tags found
No related merge requests found
......@@ -1333,6 +1333,15 @@ int Mdrunner::mdrunner()
fr->cginfo_mb);
}
/* PLUMED */
if(plumedswitch){
/* detect plumed API version */
int pversion=0;
plumed_cmd(plumedmain,"getApiVersion",&pversion);
if(pversion>5) plumed_cmd(plumedmain,"setNumOMPthreads",&hw_opt.nthreads_omp);
}
/* END PLUMED */
/* Now do whatever the user wants us to do (how flexible...) */
my_integrator(inputrec->eI) (fplog, cr, mdlog, nfile, fnm,
oenv,
......
......@@ -383,6 +383,11 @@ void PlumedMain::cmd(const std::string & word,void*val) {
doCheckPoint = false;
if(*static_cast<int*>(val)!=0) doCheckPoint = true;
break;
/* ADDED WITH API==6 */
case cmd_setNumOMPthreads:
CHECK_NOTNULL(val,word);
OpenMP::setNumThreads(*static_cast<unsigned*>(val));
break;
/* STOP API */
case cmd_setMDEngine:
CHECK_NOTINIT(initialized,word);
......
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