This is just a post to document something Pat emailed to me
1. You call a parallel function and get back a double called FinalVal e.g.
>>> FinalVal = McTermIncrAccCall(dictInputs)
2. FinalVal is a local variable on each CPU. You can view them all with:
>>> mpi.synchronizedWrite( mpi.rank, FinalVal, "\n" )
2. What you really want to do is concatenate them into a list on the root
processor. To do this you use;
>>> allValues = mpi.gather([FinalVal])
allValues is now a list containing all the local values of FinalVal.
"allvalues" only exists on the machine who's mpi.rank == 0.
Don't ask me why you need to address FinalVal as [FinalVal], possibly a one
element list?, but it definitely works.
"this is equivalent to mpi.gather([finalVal],0) and there is an allgather
Get latest updates about Open Source Projects, Conferences and News.