Loading src/pmake/machine.py +5 −3 Original line number Diff line number Diff line Loading @@ -77,7 +77,10 @@ def parse_scontrol_show_node(s : str) -> Tuple[int, int]: assert m is not None, "CPUTot not found in scontrol show node output" ncpu = int(m[1]) m = re.search(r"Gres=gpu:[a-zA-Z_:]*([0-9]*)", s) assert m is not None, "Gres=gpu not found in scontrol show node output" if m is not None: ngpu = int(m[1]) else: ngpu = 0 ngpu = int(m[1]) return ncpu, ngpu Loading Loading @@ -121,9 +124,8 @@ class Machine: if self.batch == 'srun': nodes = R.min_nodes(self.CpN, self.GpN) assert nodes is not None #srun = "srun --exclusive -N %d --cpu-bind=cores --ntasks %d -c %d -G %d" % ( srun = "srun --exclusive -N %d --ntasks %d -c %d -G %d" % ( nodes, R.nrs*R.tasks, R.nrs*R.cpu//nodes, R.nrs*R.gpu) nodes, R.nrs*R.tasks, R.cpu, R.nrs*R.gpu) if R.srun_attr is not None: srun += " %s" % R.srun_attr return srun Loading Loading
src/pmake/machine.py +5 −3 Original line number Diff line number Diff line Loading @@ -77,7 +77,10 @@ def parse_scontrol_show_node(s : str) -> Tuple[int, int]: assert m is not None, "CPUTot not found in scontrol show node output" ncpu = int(m[1]) m = re.search(r"Gres=gpu:[a-zA-Z_:]*([0-9]*)", s) assert m is not None, "Gres=gpu not found in scontrol show node output" if m is not None: ngpu = int(m[1]) else: ngpu = 0 ngpu = int(m[1]) return ncpu, ngpu Loading Loading @@ -121,9 +124,8 @@ class Machine: if self.batch == 'srun': nodes = R.min_nodes(self.CpN, self.GpN) assert nodes is not None #srun = "srun --exclusive -N %d --cpu-bind=cores --ntasks %d -c %d -G %d" % ( srun = "srun --exclusive -N %d --ntasks %d -c %d -G %d" % ( nodes, R.nrs*R.tasks, R.nrs*R.cpu//nodes, R.nrs*R.gpu) nodes, R.nrs*R.tasks, R.cpu, R.nrs*R.gpu) if R.srun_attr is not None: srun += " %s" % R.srun_attr return srun Loading