Skip to content

Commit

Permalink
Adding options to reduce prints (#146)
Browse files Browse the repository at this point in the history
* Adding option to skip noteEnd

* Adding option to skip logStart

* Moving print to a return to allow noteEnd to be called always

* Adding print end msg for fluxx
  • Loading branch information
MishaZakharchanka authored Aug 11, 2023
1 parent 28832df commit b08612b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ats/atsMachines/fluxScheduled.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions ats/atsMachines/lsf_asq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion ats/atsMachines/slurmProcessorScheduled.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions ats/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.''')
Expand Down
6 changes: 5 additions & 1 deletion ats/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
3 changes: 2 additions & 1 deletion ats/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b08612b

Please sign in to comment.