Skip to content

Commit 486f682

Browse files
tobiasmaierBordaSkafteNickitchaton
authored
Fix root node resolution in slurm environment
Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Nicki Skafte <[email protected]> Co-authored-by: chaton <[email protected]>
1 parent 389186c commit 486f682

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pytorch_lightning/cluster_environments/slurm_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self):
2626
def master_address(self):
2727
# figure out the root node addr
2828
try:
29-
root_node = os.environ["SLURM_NODELIST"].split(" ")[0]
29+
root_node = os.environ["SLURM_NODELIST"].split(" ")[0].split(",")[0]
3030
except Exception:
3131
root_node = "127.0.0.1"
3232

pytorch_lightning/trainer/connectors/slurm_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def connect_ddp(self, global_rank: int, world_size: int) -> None:
137137

138138
# figure out the root node addr
139139
try:
140-
root_node = os.environ["SLURM_NODELIST"].split(" ")[0]
140+
root_node = os.environ["SLURM_NODELIST"].split(" ")[0].split(",")[0]
141141
except Exception:
142142
root_node = "127.0.0.1"
143143

0 commit comments

Comments
 (0)