From 41d3688430a29509a546a2f9039869e1ef752b02 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Thu, 1 Mar 2018 10:38:20 +0000 Subject: [PATCH] More adjustments to MPI print messages. --- gprMax/gprMax.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gprMax/gprMax.py b/gprMax/gprMax.py index 12265832..8566d303 100644 --- a/gprMax/gprMax.py +++ b/gprMax/gprMax.py @@ -384,7 +384,7 @@ def run_mpi_sim(args, inputfile, usernamespace, optparams=None): size = comm.Get_size() # total number of processes rank = comm.Get_rank() # rank of this process tsimstart = perf_counter() - print('MPI master ({}, rank {}) on {} using {} workers\n'.format(comm, rank, hostname, numworkers)) + print('MPI master ({}, rank {}) on {} using {} workers\n'.format(comm.name, rank, hostname, numworkers)) # Assemble a sys.argv replacement to pass to spawned worker # N.B This is required as sys.argv not available when gprMax is called via api() @@ -421,6 +421,7 @@ def run_mpi_sim(args, inputfile, usernamespace, optparams=None): # Spawn workers newcomm = comm.Spawn(sys.executable, args=['-m', 'gprMax'] + myargv + [workerflag], maxprocs=numworkers) + newcomm.Set_name(comm.name) # Reply to whoever asks until done for work in worklist: @@ -470,7 +471,7 @@ def run_mpi_sim(args, inputfile, usernamespace, optparams=None): modelusernamespace = usernamespace # Run the model - print('MPI worker ({}, rank {}) starting model {}/{}{} on {}\n'.format(comm, rank, currentmodelrun, numbermodelruns, gpuinfo, hostname)) + print('MPI worker ({}, rank {}) starting model {}/{}{} on {}\n'.format(comm.name, rank, currentmodelrun, numbermodelruns, gpuinfo, hostname)) run_model(args, currentmodelrun, modelend - 1, numbermodelruns, inputfile, modelusernamespace) # Shutdown