From 1a19459325bbbfdee1b0e4a4f65558f91bf77811 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Tue, 25 Oct 2022 14:27:07 +0100 Subject: [PATCH] Corrected work dict for MPI tasks. --- gprMax/contexts.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gprMax/contexts.py b/gprMax/contexts.py index 34474aa9..545d4471 100644 --- a/gprMax/contexts.py +++ b/gprMax/contexts.py @@ -109,11 +109,17 @@ class MPIContext(Context): self.rank = self.comm.rank self.MPIExecutor = MPIExecutor - def _run_model(self, i): - """Process for running a single model.""" + def _run_model(self, **work): + """Process for running a single model. + + Args: + work (dict): contains any additional information that is passed to + MPI workers. By default only model number (i) is + used. + """ # Create configuration for model - config.model_num = i + config.model_num = work['i'] model_config = config.ModelConfig() # Set GPU deviceID according to worker rank if config.sim_config.general['cuda']: