Fix slurm multi-node rank detection

This commit is contained in:
allegroai 2024-07-24 17:44:05 +03:00
parent cd5b4d2186
commit f18c6b809f

View File

@ -2086,7 +2086,7 @@ class Worker(ServiceCommandSection):
if lines and ENV_MULTI_NODE_SINGLE_TASK.get() and ENV_MULTI_NODE_SINGLE_TASK.get() > 0:
# noinspection PyBroadException
try:
rank = int(os.environ.get("RANK") or 0)
rank = int(os.environ.get("RANK", os.environ.get('SLURM_PROCID')) or 0)
except Exception:
rank = 0
if rank: