{
GMX_LOG(mdlog.info)
.appendTextFormatted("Pinning threads with a%s logical core stride of %d",
- bPickPinStride ? "n auto-selected" : " user-specified", *pin_stride);
+ bPickPinStride ? "n auto-selected" : " user-specified",
+ *pin_stride);
}
*issuedWarning = alreadyWarned;
fprintf(debug,
"On rank %2d, thread %2d, index %2d, core %2d the affinity setting "
"returned %d\n",
- cr->nodeid, gmx_omp_get_thread_num(), index, core, ret ? 1 : 0);
+ cr->nodeid,
+ gmx_omp_get_thread_num(),
+ index,
+ core,
+ ret ? 1 : 0);
}
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR
sprintf(msg,
"Looks like we have set affinity for more threads than "
"we have (%d > %d)!\n",
- nth_affinity_set, nthread_local);
+ nth_affinity_set,
+ nthread_local);
gmx_incons(msg);
}
if (nthread_local > 1)
{
- sprintf(sbuf2, "for %d/%d thread%s ", nthread_local - nth_affinity_set, nthread_local,
+ sprintf(sbuf2,
+ "for %d/%d thread%s ",
+ nthread_local - nth_affinity_set,
+ nthread_local,
nthread_local > 1 ? "s" : "");
}
/* MPI_Scan is inclusive, but here we need exclusive */
*intraNodeThreadOffset -= numThreadsOnThisRank;
/* Get the total number of threads on this physical node */
- MPI_Allreduce(&numThreadsOnThisRank, numThreadsOnThisNode, 1, MPI_INT, MPI_SUM,
- physicalNodeComm.comm_);
+ MPI_Allreduce(
+ &numThreadsOnThisRank, numThreadsOnThisNode, 1, MPI_INT, MPI_SUM, physicalNodeComm.comm_);
}
#else
GMX_UNUSED_VALUE(physicalNodeComm);
bool affinityIsAutoAndNumThreadsIsNotAuto =
(hw_opt->threadAffinity == ThreadAffinity::Auto && !hw_opt->totNumThreadsIsAuto);
- bool issuedWarning;
- bool validLayout = get_thread_affinity_layout(
- mdlog, cr, hwTop, numThreadsOnThisNode, affinityIsAutoAndNumThreadsIsNotAuto, offset,
- &core_pinning_stride, &localityOrder, &issuedWarning);
+ bool issuedWarning;
+ bool validLayout = get_thread_affinity_layout(mdlog,
+ cr,
+ hwTop,
+ numThreadsOnThisNode,
+ affinityIsAutoAndNumThreadsIsNotAuto,
+ offset,
+ &core_pinning_stride,
+ &localityOrder,
+ &issuedWarning);
const gmx::sfree_guard localityOrderGuard(localityOrder);
bool allAffinitiesSet;
if (validLayout)
{
- allAffinitiesSet = set_affinity(cr, numThreadsOnThisRank, intraNodeThreadOffset, offset,
- core_pinning_stride, localityOrder, affinityAccess);
+ allAffinitiesSet = set_affinity(
+ cr, numThreadsOnThisRank, intraNodeThreadOffset, offset, core_pinning_stride, localityOrder, affinityAccess);
}
else
{
{
if (debug)
{
- fprintf(debug, "%d hardware threads detected, but %d was returned by CPU_COUNT",
- nthreads_hw_avail, CPU_COUNT(&mask_current));
+ fprintf(debug,
+ "%d hardware threads detected, but %d was returned by CPU_COUNT",
+ nthreads_hw_avail,
+ CPU_COUNT(&mask_current));
}
detectedDefaultAffinityMask = false;
}