File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -128,16 +128,21 @@ def x_path(file):
128128 ''' Return external path (relative to self.path) for file '''
129129 return '%s/%s' % (dirname (self .path ), basename (file ))
130130
131- # Copy instrument file to cwd if not already there (for compatibility)
132- if not isfile (basename (self .path )):
133- shutil .copy2 (self .path , "." ) # also copies stat information
134-
135131 # Create the path for the binary
136132 if os .name == 'nt' :
137133 self .binpath = '%s.%s' % (self .name , mccode_config .platform ['EXESUFFIX' ])
138134 else :
139135 self .binpath = './%s.%s' % (self .name , mccode_config .platform ['EXESUFFIX' ])
140136
137+ # Check if self.path is .exe or .out binary, if so - skip ahead to execution
138+ if self .path == basename (self .binpath ):
139+ LOG .info ('Called with binary file %s, skipping ahead to execution' , self .binpath )
140+ return
141+
142+ # Copy instrument file to cwd if not already there (for compatibility)
143+ if not isfile (basename (self .path )):
144+ shutil .copy2 (self .path , "." ) # also copies stat information
145+
141146 # Check if c-code should be regenerated by comparing to instr timestamp
142147 existingC = findReusableFile (self .path ,
143148 [self .cpath , x_path (self .cpath )])
Original file line number Diff line number Diff line change @@ -444,12 +444,7 @@ def get_parameters(options):
444444
445445
446446def 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" ):
You can’t perform that action at this time.
0 commit comments