Skip to content

Hanging with mpi4py.future #106

Description

@jychoi-hpc

I am trying to use this scorep python binding with mpi4py.future without success. My code is just hanging without progressing.

Here is my example code (future_hello.py):

from mpi4py import MPI
from mpi4py.futures import MPICommExecutor

def hello(x):
    name = MPI.Get_processor_name()
    me = MPI.COMM_WORLD.Get_rank()
    nproc = MPI.COMM_WORLD.Get_size()
    print (me, nproc, name, 'arg', x)

if __name__ == '__main__':
    nproc = MPI.COMM_WORLD.Get_size()
    with MPICommExecutor(MPI.COMM_WORLD, root=0) as executor:
        if executor is not None:
            for i in range(nproc*2):
                future = executor.submit(hello, i)
            print ("Done.")

I am trying to run as follows:

srun -n 4 python -m scorep --mpp=mpi --thread=pthread future_hello.py 

Without scorep tracing, I expect an output something like:

1 4 nid02401 arg 0
2 4 nid02401 arg 1
3 4 nid02401 arg 2
2 4 nid02401 arg 3
3 4 nid02401 arg 4
1 4 nid02401 arg 5
2 4 nid02401 arg 6
3 4 nid02401 arg 7

I am wondering if this is an expected error or if there is any fix I can try.

I appreciate any advice in advance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions