Do user defined datatypes need to be freed in a Fortran code? Or more
specifically, do subarray datatypes need to be freed?
Here is what I have done to create and free a subarray datatype:
call MPI_TYPE_CREATE_SUBARRAY(ndim, memsizes, xsizes,
+ starts, MPI_ORDER_FORTRAN, MPI_REAL, xtype, ierr)
call MPI_TYPE_COMMIT(xtype, ierr)
call MPI_TYPE_FREE(xtype, ierr)
and here is the error that I receive (in both LAM 6.5.6 and 7.0):
MPI_Type_free: invalid datatype argument: Invalid argument (rank 17,
MPI_COMM_WORLD)
Rank (17, MPI_COMM_WORLD): Call stack within LAM:
Rank (17, MPI_COMM_WORLD): - MPI_Type_free()
Rank (17, MPI_COMM_WORLD): - main()
Also, it appears that the subarray datatype is not doing what it is supposed
to be doing when utilized in a Fortran code.
Output from C code:
x = 3
0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00 0.00 11.00 11.00 11.00 0.00 0.00
0.00 13.00 14.00 14.00 14.00 15.00 0.00
0.00 13.00 14.00 14.00 14.00 15.00 0.00
0.00 13.00 14.00 14.00 14.00 15.00 0.00
0.00 0.00 17.00 17.00 17.00 0.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00
and output from Fortran code (before the error messages):
x = 3
0. 0. 0. 0. 0. 0. 0.
0. 0. 11. 0. 0. 0. 0.
0. 13. 14. 14. 14. 15. 0.
0. 13. 14. 14. 14. 15. 0.
0. 0. 14. 14. 14. 0. 0.
0. 0. 17. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0.
It might be important to note that I have defined my Fortran arrays as
mat(0:N-1) rather than mat(1:N).
Thanks
-J
p.s. I can send my code if needbe, it is a "mere" 296 lines. ; )
info:
LAM 6.5.6 and LAM 7.0, GCC/G77 3.2-7, Redhat 8
|