X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fmdlib%2Fvsite.cpp;h=c3f9edb3b27d65b522f598d0cfdac1f8fa4de1f7;hb=8073360f849809b7ce4fa5b5f14ae16209ca087f;hp=d030f9d4aba335b2e3f1b592663e9d27e320473e;hpb=a20b5229871421b24c2a604bdd2603843f8b734f;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/mdlib/vsite.cpp b/src/gromacs/mdlib/vsite.cpp index d030f9d4ab..c3f9edb3b2 100644 --- a/src/gromacs/mdlib/vsite.cpp +++ b/src/gromacs/mdlib/vsite.cpp @@ -2760,7 +2760,16 @@ static void assignVsitesToThread(VsiteThread* tData, "a constructing atom that does not belong to our task, such " "vsites should be assigned to the single 'master' task"); - task = nthread + thread; + if (tData->useInterdependentTask) + { + // Assign to the interdependent task + task = nthread + thread; + } + else + { + // Assign to the separate, non-parallel task + task = 2 * nthread; + } } } } @@ -3000,12 +3009,13 @@ void ThreadingInfo::setVirtualSites(ArrayRef ilists, } /* To avoid large f_buf allocations of #threads*vsite_atom_range - * we don't use task2 with more than 200000 atoms. This doesn't - * affect performance, since with such a large range relatively few - * vsites will end up in the separate task. - * Note that useTask2 should be the same for all threads. + * we don't use the interdependent tasks with more than 200000 atoms. + * This doesn't affect performance, since with such a large range + * relatively few vsites will end up in the separate task. + * Note that useInterdependentTask should be the same for all threads. */ - tData.useInterdependentTask = (vsite_atom_range <= 200000); + const int c_maxNumLocalAtomsForInterdependentTask = 200000; + tData.useInterdependentTask = (vsite_atom_range <= c_maxNumLocalAtomsForInterdependentTask); if (tData.useInterdependentTask) { size_t natoms_use_in_vsites = vsite_atom_range;