Changeset 962
- Timestamp:
- 06/26/20 17:17:21 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/FramsticksCLI.py
r961 r962 48 48 49 49 50 def __init__(self, framspath, framsexe): 50 def __init__(self, framspath, framsexe, pid=""): 51 self.pid = pid if pid is not None else "" 51 52 self.id = next(FramsticksCLI._next_instance_id) 52 53 self.frams_path = framspath … … 111 112 def __getPrefixedFilename(self, filename: str) -> str: 112 113 # Returns filename with unique instance id appended so there is no clash when many instances of this class use the same Framsticks CLI executable 113 return FramsticksCLI.FILE_PREFIX + s tr(chr(ord('A') + self.id)) + '_' + filename114 return FramsticksCLI.FILE_PREFIX + self.pid + str(chr(ord('A') + self.id)) + '_' + filename 114 115 115 116 … … 243 244 parser.add_argument('-exe', required=False, help='Executable name. If not given, "frams.exe" or "frams.linux" is assumed.') 244 245 parser.add_argument('-genformat', required=False, help='Genetic format for the demo run, for example 4, 9, or S. If not given, f1 is assumed.') 246 parser.add_argument('-pid', required=False, help='Unique ID of this process. Only relevant when you run multiple instances of this class simultaneously but as separate processes, and they use the same Framsticks CLI executable. This value will be appended to the names of created files to avoid conflicts.') 245 247 return parser.parse_args() 246 248 … … 266 268 267 269 parsed_args = parseArguments() 268 framsCLI = FramsticksCLI(parsed_args.path, parsed_args.exe )270 framsCLI = FramsticksCLI(parsed_args.path, parsed_args.exe, parsed_args.pid) 269 271 270 272 simplest = framsCLI.getSimplest('1' if parsed_args.genformat is None else parsed_args.genformat)
Note: See TracChangeset
for help on using the changeset viewer.