From 4397259bf19fd6b6890d7bbb45fc6ebccaf8a063 Mon Sep 17 00:00:00 2001 From: Gervasio Perez Date: Thu, 7 Dec 2023 17:20:46 +0000 Subject: [PATCH] Usar Process para correr realization --- mpirunner.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mpirunner.py b/mpirunner.py index 504a772..fed786b 100755 --- a/mpirunner.py +++ b/mpirunner.py @@ -7,6 +7,7 @@ import sys from tools.Prealization import realization from utilities.conditional_decorator import * from memory_profiler import profile +import multiprocessing as mp CONFIG_FILE_PATH = 'config.ini' if 'CONFIG_FILE_PATH' not in os.environ else os.environ['CONFIG_FILE_PATH'] IS_TEST = False if 'TEST' not in os.environ else True @@ -33,7 +34,10 @@ def sequential(): njobs = DotheLoop(-1,parser,iterables) start_job=0 for job in range(start_job,njobs): - realization(job) + p = mp.Process(target=realization, args=(job,)) + p.start() + p.join() + #realization(job) return def manager(): @@ -59,7 +63,10 @@ def worker(): while job!=-1: comm.send(rank,dest=0) job = comm.recv(source=0) - realization(job) + p = mp.Process(target=realization, args=(job,)) + p.start() + p.join() + #realization(job) return