diff --git a/ats/atsMachines/fluxScheduled.py b/ats/atsMachines/fluxScheduled.py index ff30ebc..2601cb9 100755 --- a/ats/atsMachines/fluxScheduled.py +++ b/ats/atsMachines/fluxScheduled.py @@ -428,6 +428,11 @@ def noteEnd(self, test): test.num_nodes, test.np, test.cpus_per_task, test.gpus_per_task, test.num_nodes)), echo=True) + msg = '%s #%4d %s, nn=%d, np=%d, ngpu=%d %s' % \ + ("Stop ", test.serialNumber, test.name, test.num_nodes, test.np, test.gpus_per_task, time.asctime()) + + return msg + def periodicReport(self): """ Report on current status of tasks and processor availability. diff --git a/ats/atsMachines/lsf_asq.py b/ats/atsMachines/lsf_asq.py index 8a050ea..5fcb3be 100644 --- a/ats/atsMachines/lsf_asq.py +++ b/ats/atsMachines/lsf_asq.py @@ -212,6 +212,8 @@ def examineOptions(self, options): print("%s options.nosrun = %s " % (DEBUG_LSF, options.nosrun)) print("%s options.checkForAtsProc = %s " % (DEBUG_LSF, options.checkForAtsProc)) print("%s options.showGroupStartOnly = %s " % (DEBUG_LSF, options.showGroupStartOnly)) + print("%s options.removeStartNote = %s " % (DEBUG_LSF, options.removeStartNote)) + print("%s options.removeEndNote = %s " % (DEBUG_LSF, options.removeEndNote)) print("%s options.skip = %s " % (DEBUG_LSF, options.skip)) print("%s options.blueos_exclusive = %s " % (DEBUG_LSF, options.blueos_exclusive)) print("%s options.mpibind = %s " % (DEBUG_LSF, options.mpibind)) @@ -847,8 +849,6 @@ def noteEnd(self, test): if my_environment == "INTERACTIVE": os.system("stty sane") # Keep the interactive terminal sane on blueos - print(msg) - if my_environment == "INTERACTIVE": os.system("stty sane") # Keep the interactive terminal sane on blueos @@ -881,6 +881,7 @@ def noteEnd(self, test): print("ATS Error: Can not find file '%s'\n" % test.rs_filename) #print self.nodesInUse + return msg def periodicReport(self): "Report on current status of tasks" diff --git a/ats/atsMachines/slurmProcessorScheduled.py b/ats/atsMachines/slurmProcessorScheduled.py index b9ea520..8d2495a 100644 --- a/ats/atsMachines/slurmProcessorScheduled.py +++ b/ats/atsMachines/slurmProcessorScheduled.py @@ -169,6 +169,8 @@ def examineOptions(self, options): print("%s options.salloc = %s " % (DEBUG_SLURM, options.salloc)) print("%s options.checkForAtsProc = %s " % (DEBUG_SLURM, options.checkForAtsProc)) print("%s options.showGroupStartOnly = %s " % (DEBUG_SLURM, options.showGroupStartOnly)) + print("%s options.removeStartNote = %s " % (DEBUG_SLURM, options.removeStartNote)) + print("%s options.removeEndNote = %s " % (DEBUG_SLURM, options.removeEndNote)) print("%s options.skip = %s " % (DEBUG_SLURM, options.skip)) print("%s options.exclusive = %s " % (DEBUG_SLURM, options.exclusive)) print("%s options.mpibind = %s " % (DEBUG_SLURM, options.mpibind)) @@ -648,7 +650,7 @@ def noteEnd(self, test): msg = '%s #%4d %s, nn=%d, np=%d, nt=%d, ngpu=0 %s' % \ ("Stop ", test.serialNumber, test.name, my_nn, my_np, my_nt, time.asctime()) - print(msg) + return msg def periodicReport(self): "Report on current status of tasks" diff --git a/ats/configuration.py b/ats/configuration.py index 0f47af2..833b38c 100644 --- a/ats/configuration.py +++ b/ats/configuration.py @@ -380,6 +380,12 @@ def add_more_options(parser): parser.add_option('--showGroupStartOnly', action='store_true', help='''Only show start of first test in group, not subsequent steps.''') + parser.add_option('--removeStartNote', action='store_true', + help='''Remove message printed before the test has started + running.''') + parser.add_option('--removeEndNote', action='store_true', + help='''Remove message printed after the test has finished + running.''') parser.add_option('--skip', action='store_true', help='''skip actual execution of the tests, but show filtering results and missing test files.''') diff --git a/ats/machines.py b/ats/machines.py index d479dca..77fd90a 100644 --- a/ats/machines.py +++ b/ats/machines.py @@ -317,7 +317,11 @@ def testEnded(self, test, status): #note test.status is not necessarily status after this! #see test.expectedResult - self.noteEnd(test) #to be defined in children + endNote = self.noteEnd(test) #to be defined in children + + if endNote: # Check that there is something to be printed + if not configuration.options.removeEndNote: # Does the user want it to be printed + print(endNote) # now close the outputs if test.stdOutLocGet() != 'terminal': diff --git a/ats/schedulers.py b/ats/schedulers.py index e8d0e9d..73207e6 100644 --- a/ats/schedulers.py +++ b/ats/schedulers.py @@ -81,7 +81,8 @@ def step(self): self.schedule("Chose #%d to start." % nextTest.serialNumber) self.addBlock(nextTest) result = machine.startRun(nextTest) - self.logStart(nextTest, result) + if not configuration.options.removeStartNote: + self.logStart(nextTest, result) if not result: self.removeBlock(nextTest) break # failure to launch, let it come back if tests left.