Hi,
Anyone is using MPI_INFO_SET and MPI_COMM_SPAWN in fortran?
I try to pass a string variable infostr from C to a f90 function, which calls
MPI_INFO_SET and MPI_COMM_SPAWN. "infostr" is generated at run time in a C
code for mapping the spawned processes to different total number of
processors. It failed.
In the f90 code:
...
CHARACTER, DIMENSION(strlen), INTENT(IN) :: infostr
...
!1)debug:
write(*,*) MYID, ": infostr=", infostr, "?"
call MPI_INFO_CREATE(spawninfo, ierr)
!2) call MPI_INFO_SET(spawninfo, 'file', 'node-L3-p1-m0.appschema',ierr)
!3) call MPI_INFO_SET(spawninfo, 'file', localstr, ierr)
!4):
call MPI_INFO_SET(spawninfo, 'file', infostr, ierr)
call MPI_COMM_SPAWN("worker", MPI_ARGV_NULL, NWORKER, spawninfo, ...)
I can see "infostr" has been passed correctly at 1). Then, I tried 4), it
failed with "MPI_Comm_spawn: invalid argument: couldn't find application
schema". However, when I used a constant string like in 2), it worked.
But, this way doesn't map one process on each node. All minimasters'
workers will crowd to a same set of nodes. Then, I tried 3), allocate a
character array at local to hold infostr. Still failed. This looks like a
problem of f90 MPI interface of LAM.
I checked the source under share/mpi/f77 and found the real c implementation
is in infoset_f.c:
mpi_info_set_(i, k, v, ierr, nk, nv)
But, when I add nk and nv:
call MPI_INFO_SET(spawninfo, 'file', infostr, ierr, 4, infostrlen)
It failed with segmentation errors.
Any suggestions would be appreciated!
Jian
|