Skip to content

Commit

Permalink
Fixed WorkerPool.start to use the .scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Oct 3, 2024
1 parent 37cf124 commit c09ff04
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions openquake/baselib/workerpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,8 @@ def start(self):
self.hostname = socket.gethostname()
if self.job_id:
# save the hostname in calc_XXX/hostcores
calc_dir = os.path.join(
config.directory.custom_tmp, 'calc_%s' % self.job_id)
try:
os.mkdir(calc_dir)
except FileExistsError: # somebody else created it
pass
if parallel.oq_distribute() == 'slurm':
fname = os.path.join(calc_dir, 'hostcores')
fname = os.path.join(self.scratch, 'hostcores')
line = f'{self.hostname} {self.num_workers}'
print(f'Writing {line} on {fname}')
with open(fname, 'a') as f:
Expand Down

0 comments on commit c09ff04

Please sign in to comment.