Hi,<div><br></div><div>In order to be nice and not have mdrun override externally set CPU affinities I want to check whether the affinity is default or it has been changed (by taskset, OpenMP library, etc.). Initially I want to implement this for GNU platforms with sched.h. </div>
<div><br></div><div>While I initially though if no affinity is set the cpu set should be empty, in fact it in this case CPU_ISSET will give the same result as if all CPUs were in the set -- which actually makes sense. However, this left me quite clueless about how to distinguish between the case when all CPUs are present in the cpu set and when e.g. all CPU are set by taskset, e.g. </div>
<div>$ taskset 0xF mdrun # quite useless on a quad-core machine</div><div><br></div><div>Does anybody have an idea how to distinguish these two cases. It would be possible, because e.g. hwloc-ps can do it (but they do it based on their own mask-representation which makes is a bit hard to figure out what I need from their code).</div>
<div><br></div><div>Thanks,</div><div>--<br>Szilárd<br>
<br>
</div>