Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
25 changes: 17 additions & 8 deletions tools/Python/mcgui/mcgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ def run(self, fixed_params, params, inspect=None):
[<par_name>, <value>] pairs
'''
mcrunparms = ' '

feedback = '' # String included in message on succesful launch

# mpi-related
clustering = fixed_params[4]
mpicount = fixed_params[5]
Expand Down Expand Up @@ -360,14 +361,16 @@ def run(self, fixed_params, params, inspect=None):
output_dir = "%s_%s" % \
(os.path.splitext(self.__instrFile)[0],
datetime.strftime(datetime.now(), DATE_FORMAT_PATH))
feedback = 'Sim mode: '
runstr = mccode_config.configuration["MCRUN"] + mcrunparms + os.path.basename(self.__instrFile) + ' -d ' + output_dir
if simtrace == 2:
runstr = runstr + ' --optimize '
if inspect:
runstr = runstr + ' --optimize-monitor=' + inspect
feedback = 'Optim mode: '
self.__dataDir = output_dir
elif simtrace == 1: # trace (mcdisplay)
feedback = 'Trace mode: '
if inspect:
runstr = mccode_config.configuration["MCDISPLAY"] + ' ' + os.path.basename(self.__instrFile) + ' --inspect=' + inspect
else:
Expand All @@ -382,10 +385,18 @@ def run(self, fixed_params, params, inspect=None):

# steps count
nsteps = fixed_params[2]
# Check for list mode / scan steps
if nsteps != '':
if int(nsteps) > 1:
print('Nsteps is ' + nsteps)
runstr = runstr + ' -N ' + str(nsteps)
try:
if int(nsteps) > 1: # Numeric, this is scan step mode
feedback = 'Scan mode: N=' + str(nsteps) + ' steps. '
runstr = runstr + ' -N ' + str(nsteps)
except: # Check for list mode
if nsteps == '-L' or nsteps == 'list':
runstr = runstr + ' -L '
feedback = 'Scanning, -L list mode. '
else:
feedback = 'Ignored scan input (' + str(nsteps) +') '

# gravity
if fixed_params[3]:
Expand All @@ -406,7 +417,6 @@ def run(self, fixed_params, params, inspect=None):
# format
Format = fixed_params[9]
if Format and simtrace == 0:
print("REDEFINING FORMAT: " + mccode_config.configuration["FORMAT"])
runstr = runstr + ' --format=' + mccode_config.configuration["FORMAT"]

# Monitor_nD buffersize
Expand All @@ -416,7 +426,6 @@ def run(self, fixed_params, params, inspect=None):

# parse instrument params
runstr += ' ' + lexer.join('%s=%s'%(p[0],p[1]) for p in params)
print('Running: ' + runstr)

# Add & for backgrounding on Unix systems
if simtrace == 1 and not os.name == 'nt':
Expand All @@ -440,7 +449,7 @@ def run(self, fixed_params, params, inspect=None):
self.__runthread.message.connect(lambda msg: self.__emitter.message(msg))
self.__runthread.start()
self.__emitter.message(runstr, gui=True)
self.__emitter.status('Running simulation ...')
self.__emitter.status(feedback + 'Running simulation ...')
self.__fireSimStateUpdate()
else:
self.__emitter.message(runstr, gui=True)
Expand Down
4 changes: 2 additions & 2 deletions tools/Python/mcgui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ def retranslateUi(self, dlgStartSim):
self.edtNodes.setText(_translate( "dlgStartSim", "auto"))
self.lblSimTrace.setText(_translate( "dlgStartSim", "Simulation/Trace/Optimize: "))
self.lblSimTrace.setToolTip(_translate( "dlgStartSim", "<html><body><b>Simulate</b>: Run calcultion <br><b>Trace</b>: View the model geometry <br><b>Optimize</b>: Determine parameters given as MIN,MAX or MIN,START,MAX to maximize all or a given monitor (Inspect)</body></html>"))
self.lblSweepSteps.setText(_translate( "dlgStartSim", "Scan steps (optional):"))
self.lblSweepSteps.setToolTip(_translate("dlgStartSim", "<html><body>Give the number N of scan steps. Some parameters above should be given as MIN,MAX and will vary in N steps</body></html>"))
self.lblSweepSteps.setText(_translate( "dlgStartSim", "List mode/scan steps (optional):"))
self.lblSweepSteps.setToolTip(_translate("dlgStartSim", "<html><body>Either:<ul><li>Give -L or 'list' for list mode. One or more parms above should be given as A,B,...,K<br></li><li>Indicate the number of scan steps 'N'. One or more parms above should be given as MIN,MAX for scan over N steps</li></ul></body></html>"))
self.lblNeutronCount.setToolTip(_translate("dlgStartSim", "<html><body>The Ray count specifies the statistical granularity of your simulation and is NOT equal to the number of particles simulated. For a thorough explanation, see the chapter 'Monte Carlo Techniques and simulation strategy' in the user manual.</body></html>"))
self.lblNeutronCount.setText(_translate("dlgStartSim", "Ray count:"))
self.lblMpi.setText(_translate( "dlgStartSim", "Parallelisation:"))
Expand Down
Loading