|
[Sponsors] |
Multiple MPI communicators for python wrapper |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 19, 2021, 10:57 |
Multiple MPI communicators for python wrapper
|
#1 |
New Member
Jane Bae
Join Date: Apr 2021
Posts: 2
Rep Power: 0 |
Hi,
I am trying to run multiple runs of SU2 using the python wrapper. However, whenever I try to pass a pre-set communicator that is not MPI_COMM_WORLD as the communicator, the program seems to hang. Does anyone have an idea why this might be? Here is a simplified version of the code I'm trying to run: Code:
import sys import shutil import pysu2 as pysu2 # imports the SU2 adjoint-wrapped module from mpi4py import MPI def main(comm): # Define the input file names flow_filename = "config.cfg" # Initialize the flow driver of SU2, this includes solver preprocessing FlowDriver = pysu2.CSinglezoneDriver(flow_filename, 1, comm); print("\n------------------------------ Begin Solver -----------------------------\n") sys.stdout.flush() comm.Barrier() Flow_Time = FlowDriver.GetTime_Iter() Flow_nTime = FlowDriver.GetnTimeIter() for i in range(Flow_nTime): # Time iteration preprocessing FlowDriver.Preprocess(Flow_Time+i) FlowDriver.Run() FlowDriver.Postprocess() FlowDriver.Update() FlowDriver.Output(Flow_Time+i) stopCalc = FlowDriver.Monitor(Flow_Time+i) if stopCalc: break # ------------------------------------------------------------------- # Run Main Program # ------------------------------------------------------------------- # this is only accessed if running from command prompt if __name__ == '__main__': world_rank = MPI.COMM_WORLD.Get_rank() world_size = MPI.COMM_WORLD.Get_size() if world_rank < world_size//2: color = 1 else: color = 2 comm = MPI.COMM_WORLD.Split(color,world_rank) print('[Pre Barrier] My Rank is: ' + str(world_rank)) sys.stdout.flush() comm1.Barrier() # Checking the communicator was correctly created print('[Post Barrier] My Rank is: ' + str(world_rank)) sys.stdout.flush() if world_rank < world_size//2: main(comm) |
|
April 19, 2021, 11:38 |
|
#2 |
Senior Member
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13 |
That was added in version 7.1.1
Third feature from the top https://github.com/su2code/SU2/releases/tag/v7.1.1 |
|
April 19, 2021, 13:31 |
|
#3 |
New Member
Jane Bae
Join Date: Apr 2021
Posts: 2
Rep Power: 0 |
Thank you. I was in one of the developer branches. The origin branch seems to work fine.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 06:09 |
Sgimpi | pere | OpenFOAM | 27 | September 24, 2011 07:57 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 12:21 |
Error using LaunderGibsonRSTM on SGI ALTIX 4700 | jaswi | OpenFOAM | 2 | April 29, 2008 10:54 |
Is Testsuite on the way or not | lakeat | OpenFOAM Installation | 6 | April 28, 2008 11:12 |