If task distribution (with slurm for instance) causes both fully
allocated and not-fully allocated nodes to be assigned to the job then
there may be tasks with a all-cores affinity mask and tasks with a
not-all-cores affinity masks.
Fixes #1613
Change-Id: I71c0daa43a5dd42da57bfd09037806ce1d9334b5
cpu_set_t mask_current;
int i, ret, cpu_count, cpu_set;
gmx_bool bAllSet;
+#ifdef GMX_LIB_MPI
+ gmx_bool bAllSet_All;
+#endif
assert(hw_opt);
if (hw_opt->thread_affinity == threadaffOFF)
bAllSet = bAllSet && (CPU_ISSET(i, &mask_current) != 0);
}
+#ifdef GMX_LIB_MPI
+ MPI_Allreduce(&bAllSet, &bAllSet_All, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);
+ bAllSet = bAllSet_All;
+#endif
+
if (!bAllSet)
{
if (hw_opt->thread_affinity == threadaffAUTO)