Loading tests/test_machine.py +3 −3 Original line number Diff line number Diff line Loading @@ -6,16 +6,16 @@ class TestMachine(unittest.TestCase): M = machine(1000.0) start = str(M.N) print( "%d nodes (%d CPUs, %d GPUs) on %s" % (len(M.N), len(M.N)*M.CpN, len(M.N)*M.GpN, M.launcher) ) len(M.N)*M.CpN, len(M.N)*M.GpN, M.batch) ) Rs = [ ResourceSet(1, 1, 1, 0) # 1 CPU job , ResourceSet(1, 1, 6, 6) # 6 GPU job , ResourceSet(1, 15, 1, 0) # 16 CPU job ] for R in Rs: # allocate resources and show run-commands cmd = M.alloc(R) if M.launcher == "jsrun": # which jobs should run? if M.batch == "jsrun": # which jobs should run? self.assertNotEqual(cmd, None) elif M.launcher == "local": elif M.batch == "local": if R.nrs < 4 and R.cpu == 1 and R.gpu == 0: self.assertNotEqual(cmd, None) else: Loading tests/test_manager.py +6 −4 Original line number Diff line number Diff line import unittest from subprocess import Popen from machine import * from manager import * class Task: def __init__(self, cmd, R, start, fin): self.cmd = cmd self.rs = R self.start = start self.fin = fin self.rs = R def prepare(self, testonly=False): def run(self, testonly=False): print("Running %s on %s"%(self.cmd, self.rs)) self.start.inc() return ("%s bash show.sh"%self.cmd).split() cmd = ("%s bash show.sh"%self.cmd).split() return Popen(cmd) def finish(self, ret): print("Finished %s on %s (returned %d)"%(self.cmd, self.rs, ret)) Loading @@ -33,7 +35,7 @@ class TestManager(unittest.TestCase): njobs = len(Rs) M = machine(2.0) # You have 2 minutes! R = Manager(M, verb=True) R = Manager(M) start = Counter() skip = Counter() finish = Counter() Loading Loading
tests/test_machine.py +3 −3 Original line number Diff line number Diff line Loading @@ -6,16 +6,16 @@ class TestMachine(unittest.TestCase): M = machine(1000.0) start = str(M.N) print( "%d nodes (%d CPUs, %d GPUs) on %s" % (len(M.N), len(M.N)*M.CpN, len(M.N)*M.GpN, M.launcher) ) len(M.N)*M.CpN, len(M.N)*M.GpN, M.batch) ) Rs = [ ResourceSet(1, 1, 1, 0) # 1 CPU job , ResourceSet(1, 1, 6, 6) # 6 GPU job , ResourceSet(1, 15, 1, 0) # 16 CPU job ] for R in Rs: # allocate resources and show run-commands cmd = M.alloc(R) if M.launcher == "jsrun": # which jobs should run? if M.batch == "jsrun": # which jobs should run? self.assertNotEqual(cmd, None) elif M.launcher == "local": elif M.batch == "local": if R.nrs < 4 and R.cpu == 1 and R.gpu == 0: self.assertNotEqual(cmd, None) else: Loading
tests/test_manager.py +6 −4 Original line number Diff line number Diff line import unittest from subprocess import Popen from machine import * from manager import * class Task: def __init__(self, cmd, R, start, fin): self.cmd = cmd self.rs = R self.start = start self.fin = fin self.rs = R def prepare(self, testonly=False): def run(self, testonly=False): print("Running %s on %s"%(self.cmd, self.rs)) self.start.inc() return ("%s bash show.sh"%self.cmd).split() cmd = ("%s bash show.sh"%self.cmd).split() return Popen(cmd) def finish(self, ret): print("Finished %s on %s (returned %d)"%(self.cmd, self.rs, ret)) Loading @@ -33,7 +35,7 @@ class TestManager(unittest.TestCase): njobs = len(Rs) M = machine(2.0) # You have 2 minutes! R = Manager(M, verb=True) R = Manager(M) start = Counter() skip = Counter() finish = Counter() Loading