MolSSI / QCEngine

Quantum chemistry program executor and IO standardizer (QCSchema).
https://molssi.github.io/QCEngine/
BSD 3-Clause "New" or "Revised" License
162 stars 78 forks source link

ncores and jobs_per_node #415

Closed loriab closed 8 months ago

loriab commented 11 months ago

@maxscheurer brought up in #405 that the default jobs_per_node = 2 was a little unexpected in that a single job submitted through qcengine would use half the node's resources (config.py: ncores = task_config.pop("ncores", int(ncores / jobs_per_node))). That's what the code logic says, but it didn't jive with my experience of cmdline qcng, which is that a single job w/o task_config fills the node.

The net effect is that with ncores a factor of 2 too large (40 from cpu_affinity instead of 20 from cpu_count(logical=False)) and the unexpected jobs_per_node=2 default a factor of 2 larger than the expected 1, the expected result happens of qcng filling all (20) physical cores.

So by my current understanding, jobs_per_node should be reset to 1, since filling the node is the most expected default behavior. But this needs to be accompanied by a modification in how ncores is computed, so that if cpu_affinity = cpu_count(logical=True), then probably the affinity hasn't been set and ncores should be cpu_count(logical=False). In this plan, for default settings on Intel processors, the net effect is unchanged, while the two parameters are finally doing as they claim.

This issue doesn't really affect QCFractal usage as it has explicit settings through executors and managers. I only really detected the issue b/c GAMESS gives up when you run too many threads, and 40 (as the change in #405 handed to test_local_options_scratch[gamess-model2-keywords2] is too many :-).

Thoughts? Have I analyzed this right, and is this the right plan? pinging @bennybp , too, in case there are qcf implications I don't see.