Can you retrieve MPI.Comm object from an h5py.File instance?

20 views
Skip to first unread message

Edis Jakupovic

unread,
Aug 10, 2020, 11:27:06 PM8/10/20
to h5py
Hello, 

I have a question about "pulling out" the MPI communicator used to open an h5py file from the instance of the file: 

If I do something like,

f = h5py.File(filename, 'r', driver='mpio', comm=MPI.COMM_WORLD) 

comm =  f.id.get_access_plist().get_fapl_mpio()[0]

f2 = h5py.File(filename, 'r', driver='mpio', comm=comm) 

Will the second file also be opened with MPI.COMM_WORLD? I don't think this works, as MPI.COMM_WORLD is in instance of MPI.Intracomm, but comm is an instance of MPI.Comm.

Is there a way one can get back the communicator that was originally passed when the file was opened?

Thanks for any help,
Edis

Thomas Kluyver

unread,
Aug 13, 2020, 3:58:39 PM8/13/20
to h5...@googlegroups.com
I think what h5py gives back is essentially a copy of the comm (from MPI_Comm_dup) - see the code here:


It's not clear to me if the duplication step is necessary.

Thomas

--
You received this message because you are subscribed to the Google Groups "h5py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h5py+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/h5py/69bffb84-b519-49d5-9fe5-6849febbcbd6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages