Skip to content

Commit

Permalink
add node_id to ckpt.sqlite3 filename
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiang87 committed Sep 17, 2018
1 parent 8507c25 commit 4aecf75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/desc/imsim/ImageSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def eimage_file(self, det_name):
return os.path.join(self.outdir, prefix + '_'.join(
(visit, detector.fileName, self.obs_md.bandpass + '.fits')))

def run(self, processes=1, wait_time=None):
def run(self, processes=1, wait_time=None, node_id=0):
"""
Use multiprocessing module to simulate sensors in parallel.
"""
Expand All @@ -219,7 +219,7 @@ def run(self, processes=1, wait_time=None):
if self.file_id is not None and CHECKPOINT_SUMMARY is None:
visit = self.obs_md.OpsimMetaData['obshistID']
CHECKPOINT_SUMMARY \
= CheckpointSummary(db_file='ckpt_{}.sqlite3'.format(visit))
= CheckpointSummary(db_file='ckpt_{}_{}.sqlite3'.format(visit, node_id))

results = []
if processes == 1:
Expand Down Expand Up @@ -365,7 +365,7 @@ def __call__(self, gs_objects):
visit = str(IMAGE_SIMULATOR.obs_md.OpsimMetaData['obshistID'])
name_root = os.path.join(outdir, prefix) + visit
if not IMAGE_SIMULATOR.config['persistence']['eimage_skip']:
outfiles = gs_interpreter.writeImages(nameRoot=nameRoot)
outfiles = gs_interpreter.writeImages(nameRoot=name_root)
if IMAGE_SIMULATOR.config['persistence']['eimage_compress']:
compress_files(outfiles)
else:
Expand Down

0 comments on commit 4aecf75

Please sign in to comment.