Transtyping some Fortran Comm to python result in an OverflowError
For example, when running the provided example with logging enabled (MPI only, rank 1 only):
[PDI][MPI][000001][11:13:28] *** debug: Transtype `mpi_comm_F' to `mpi_comm'
[PDI][MPI][000001][11:13:28] *** debug: Transtyped (F->C) `1140850688' to `0x7fe644000000'
[PDI][MPI][000001][11:13:28] *** debug: `mpi_comm_F' no longer available, reclaim transtyped desc (`mpi_comm')
[PDI][MPI][000001][11:13:28] *** debug: Transtype back `mpi_comm' to `mpi_comm_F'
[PDI][MPI][000001][11:13:28] *** debug: Transtyped (C->F) `0x7fe684000002' to `-2080374782'
Traceback (most recent call last):
File "/builds/pdidev/pdi/example/example.py", line 110, in <module>
main_comm = MPI.Comm.f2py(main_comm_f)
File "mpi4py/MPI/Comm.pyx", line 1147, in mpi4py.MPI.Comm.f2py
OverflowError: value too large to convert to MPI_Fint
Here one can see that :
- 1140850688 == 0x44000000 (F) -> 0x7fe644000000
- 0x7fe684000002 (C) -> 0x84000002 == +2214592514 (
uint32_t
) == -2080374782 (int32_t
)
This all looks pretty nice, except python decides that negative int32_t
are not fair game...