Remove hardcoded cpus_per_task=128 in landice mesh_gen cases#957
Remove hardcoded cpus_per_task=128 in landice mesh_gen cases#957
cpus_per_task=128 in landice mesh_gen cases#957Conversation
Override constrain_resources in all 7 landice mesh step classes to set cpus_per_task to all available cores rather than hardcoding 128. This allows region mask creation and culling operations to use all allocated processors, which is especially beneficial for large meshes (Antarctica, Greenland) that require many nodes.
cpus_per_task=128 in landice mesh_gen cases
trhille
left a comment
There was a problem hiding this comment.
This produces a lot of repeated code. Let's move constrain_resources() to compass/landice/mesh.py and import it for use in each mesh_gen case.
Also, we might still need to set min_cpus_per_task=1 (or possibly the min of 128 and available_resources['cores']?)
Consolidate the repeated constrain_resources logic into a shared module-level function in compass/landice/mesh.py that calls Step.constrain_resources then sets cpus_per_task to all available cores. All 7 mesh_gen step files now import and delegate to this shared function instead of duplicating the logic.
Done. The |
…nstrain_resources
Agent-Logs-Url: https://github.com/MPAS-Dev/compass/sessions/244d2d93-5b38-497f-b70a-e7813f2214b8 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com>
from compass.landice.mesh import (...)patterns in landice mesh step filespre-commit,compassCLI); environment missing required tools/dependenciesLandiceMeshStepand mesh utility function calls) to use the module alias