You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realized that sometimes the number of nodes does not match the number of requested nodes. This is due to the function _parse_slurm_node_list failing, if the nodename does not contain any brackets.
def parse_slurm_node_list(s: str) -> List[str]:
nodes = []
p = re.compile(r"([^\[,]+)(?:\[([^\]]+)\])?,?")
for m in p.finditer(s):
prefix = m.group(1)
suffixes = m.group(2)
if suffixes:
for suffix in suffixes.split(","):
span = suffix.split("-")
if len(span) == 1:
nodes.append(prefix + suffix)
else:
width = len(span[0])
start, end = int(span[0]), int(span[1]) + 1
nodes.extend([prefix + f"{i:0{width}}" for i in range(start, end)])
else:
nodes.append(prefix) # If no brackets, add the prefix as is
return nodes
The text was updated successfully, but these errors were encountered:
I realized that sometimes the number of nodes does not match the number of requested nodes. This is due to the function _parse_slurm_node_list failing, if the nodename does not contain any brackets.
Code to reproduce:
Can be fixed by adding:
Fix using regular expressions thanks to @NikolasSchmitz:
The text was updated successfully, but these errors were encountered: