From c09ff04de551f41895fbae51da04d2d71f662959 Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Thu, 3 Oct 2024 06:44:38 +0200 Subject: [PATCH] Fixed WorkerPool.start to use the .scratch --- openquake/baselib/workerpool.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/openquake/baselib/workerpool.py b/openquake/baselib/workerpool.py index 77c1db0ef5ca..8d8110efad9d 100644 --- a/openquake/baselib/workerpool.py +++ b/openquake/baselib/workerpool.py @@ -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: