diff --git a/pytorch_lightning/plugins/environments/slurm_environment.py b/pytorch_lightning/plugins/environments/slurm_environment.py index 2d2c59d934..01c76ad053 100644 --- a/pytorch_lightning/plugins/environments/slurm_environment.py +++ b/pytorch_lightning/plugins/environments/slurm_environment.py @@ -28,7 +28,7 @@ class SLURMEnvironment(ClusterEnvironment): # figure out the root node addr slurm_nodelist = os.environ.get("SLURM_NODELIST") if slurm_nodelist: - root_node = slurm_nodelist.split(" ")[0] + root_node = slurm_nodelist.split(" ")[0].split(",")[0] else: root_node = "127.0.0.1" diff --git a/pytorch_lightning/trainer/connectors/slurm_connector.py b/pytorch_lightning/trainer/connectors/slurm_connector.py index d53f4dfed4..5932937f6c 100644 --- a/pytorch_lightning/trainer/connectors/slurm_connector.py +++ b/pytorch_lightning/trainer/connectors/slurm_connector.py @@ -140,7 +140,7 @@ class SLURMConnector: # figure out the root node addr root_node = os.environ.get("SLURM_NODELIST") if root_node: - root_node = root_node.split(" ")[0] + root_node = root_node.split(" ")[0].split(",")[0] else: root_node = "127.0.0.1"