Skip to content

Commit ab0555f

Browse files
committed
Allow mcrun / mcdisplay to run / visualize without access to .c/.instr
1 parent 8b7a432 commit ab0555f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tools/Python/mcrun/mccode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ def x_path(file):
138138
else:
139139
self.binpath = './%s.%s' % (self.name, mccode_config.platform['EXESUFFIX'])
140140

141+
# Check if self.path is .exe or .out binary, if so - skip ahead to execution
142+
if options.force_compile or not pathlib.Path(self.path).suffix==mccode_config.platform['EXESUFFIX']:
143+
return
144+
141145
# Check if c-code should be regenerated by comparing to instr timestamp
142146
existingC = findReusableFile(self.path,
143147
[self.cpath, x_path(self.cpath)])

tools/Python/mcrun/mcrun.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,7 @@ def get_parameters(options):
444444

445445

446446
def find_instr_file(instr):
447-
# Remove [-mpi].out to avoid parsing a binary file
448447
instr = clean_quotes(instr)
449-
if instr.endswith("-mpi." + mccode_config.platform['EXESUFFIX']):
450-
instr = instr[:-(5 + len(mccode_config.platform['EXESUFFIX']))]
451-
if instr.endswith("." + mccode_config.platform['EXESUFFIX']):
452-
instr = instr[:-(1 + len(mccode_config.platform['EXESUFFIX']))]
453448

454449
# Append ".instr" if needed
455450
if not isfile(instr) and isfile(instr + ".instr"):

0 commit comments

Comments
 (0)