Skip to content
Snippets Groups Projects
Commit 0a82d573 authored by carlocamilloni's avatar carlocamilloni
Browse files

MultiColvar: improve openmp performance

parent d02ae642
No related branches found
No related tags found
No related merge requests found
......@@ -265,7 +265,7 @@ void ActionWithVessel::runAllTasks() {
// Get number of threads for OpenMP
unsigned nt=OpenMP::getNumThreads();
if( nt*stride*10>nactive_tasks || !threadSafe()) nt=1;
if( nt*stride*2>nactive_tasks || !threadSafe()) nt=1;
// Get size for buffer
unsigned bsize=0, bufsize=getSizeOfBuffer( bsize );
......@@ -275,7 +275,7 @@ void ActionWithVessel::runAllTasks() {
if( dertime_can_be_off ) dertime=false;
if(timers) stopwatch.start("2 Loop over tasks");
#pragma omp parallel num_threads(nt)
#pragma omp parallel num_threads(nt) schedule(dynamic)
{
std::vector<double> omp_buffer;
if( nt>1 ) omp_buffer.resize( bufsize, 0.0 );
......
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