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
13 changes: 9 additions & 4 deletions tools/Python/mcrun/mccode.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,21 @@ def x_path(file):
''' Return external path (relative to self.path) for file '''
return '%s/%s' % (dirname(self.path), basename(file))

# Copy instrument file to cwd if not already there (for compatibility)
if not isfile(basename(self.path)):
shutil.copy2(self.path, ".") # also copies stat information

# Create the path for the binary
if os.name == 'nt':
self.binpath = '%s.%s' % (self.name, mccode_config.platform['EXESUFFIX'])
else:
self.binpath = './%s.%s' % (self.name, mccode_config.platform['EXESUFFIX'])

# Check if self.path is .exe or .out binary, if so - skip ahead to execution
if self.path==basename(self.binpath):
LOG.info('Called with binary file %s, skipping ahead to execution', self.binpath)
return

# Copy instrument file to cwd if not already there (for compatibility)
if not isfile(basename(self.path)):
shutil.copy2(self.path, ".") # also copies stat information

# Check if c-code should be regenerated by comparing to instr timestamp
existingC = findReusableFile(self.path,
[self.cpath, x_path(self.cpath)])
Expand Down
5 changes: 0 additions & 5 deletions tools/Python/mcrun/mcrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,7 @@ def get_parameters(options):


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

# Append ".instr" if needed
if not isfile(instr) and isfile(instr + ".instr"):
Expand Down