Skip to content
Snippets Groups Projects
Commit c7412771 authored by Paul van der Laan's avatar Paul van der Laan
Browse files

Suppress output from EllipSys if debug flag is false

parent c82444f9
No related branches found
No related tags found
1 merge request!6EllipSys1D
Pipeline #
...@@ -178,26 +178,32 @@ class CaseRunner(object): ...@@ -178,26 +178,32 @@ class CaseRunner(object):
exepath = os.path.join(epath, self.flowfield) exepath = os.path.join(epath, self.flowfield)
command = 'mpirun -np %i python %s' % (self.nprocs, exepath) command = 'mpirun -np %i python %s' % (self.nprocs, exepath)
# out = commands.getoutput(command) # out = commands.getoutput(command)
status = subprocess.call(command, shell=True) if self.debug:
if status != 0: status = subprocess.call(command, shell=True)
raise RuntimeError('Case %s failed!' % self.casename) else:
# if self.debug: # Suppress output from EllipSys
# print 'out', out FNULL = open(os.devnull, 'w')
status = subprocess.call(command, shell=True,stdout=FNULL)
self.read_data(self.project, outname) self.read_data(self.project, outname)
self.jobid = None self.jobid = None
print 'test1'
print 'case %s ran in %f seconds' %(self.casename, time.time() - t0) print 'case %s ran in %f seconds' %(self.casename, time.time() - t0)
elif self.exec_mode == 'shell': elif self.exec_mode == 'shell':
t0 = time.time() t0 = time.time()
exepath = os.path.join(epath, self.flowfield) exepath = os.path.join(epath, self.flowfield)
command = 'mpirun -np %i %s' % (self.nprocs, exepath) command = 'mpirun -np %i %s' % (self.nprocs, exepath)
status = subprocess.call(command, shell=True) if self.debug:
status = subprocess.call(command, shell=True)
else:
# Suppress output from EllipSys
FNULL = open(os.devnull, 'w')
status = subprocess.call(command, shell=True,stdout=FNULL)
# status, out = commands.getstatusoutput(command) # status, out = commands.getstatusoutput(command)
if status != 0: if status != 0:
raise RuntimeError('Case %s failed!' % self.casename) raise RuntimeError('Case %s failed!' % self.casename)
# elif self.debug:
# print out
self.read_data(self.project, outname) self.read_data(self.project, outname)
self.jobid = None self.jobid = None
print 'test2'
print 'case %s ran in %f seconds' %(self.casename, time.time() - t0) print 'case %s ran in %f seconds' %(self.casename, time.time() - t0)
elif self.exec_mode == 'dry_run': elif self.exec_mode == 'dry_run':
print 'Running in dry run mode, copying pre-computed data!' print 'Running in dry run mode, copying pre-computed data!'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment