Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding options to reduce prints #146

Merged
merged 4 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 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,7 +849,7 @@ def noteEnd(self, test):
if my_environment == "INTERACTIVE":
os.system("stty sane") # Keep the interactive terminal sane on blueos

print(msg)
# print(msg)

if my_environment == "INTERACTIVE":
os.system("stty sane") # Keep the interactive terminal sane on blueos
Expand Down Expand Up @@ -881,6 +883,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
5 changes: 4 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,8 @@ 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)
# 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
5 changes: 4 additions & 1 deletion ats/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ 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 not configuration.options.removeEndNote:
print(endNote)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you protect this with an

if endNote:

so that if noteEnd does not return a string, nothing is printed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can do that. Was also working on a print for ATS' flux module to be consistent with the other schedulers.


# 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