Fix root node resolution in slurm environment

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: chaton <thomas@grid.ai>
This commit is contained in:
Tobias Maier 2021-01-19 13:58:32 +01:00 committed by Jirka Borovec
parent fd6b3ec349
commit 1d99530c66
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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"