In MPICH-1.2.6, romio directory, there is a test program called "fcoll_test.f".
The test program run successfully with gcc compiler.
However, with ifort (8.0/8.1) compiler, the program fails.
After debugging, I find that the function MPI_FILE_OPEN fails (ierr is non-zero).
But change the size of character array from 1024 to 200 can solve the problem.
I have found another people with similar experience as me: (in Chinese)
Here is the full program :
Here is the simplier version of the program.
integer fh, ierr
character*1024 str ! used to store the filename
c character*200 str ! this will work
call MPI_COMM_SIZE(MPI_COMM_WORLD, nprocs, ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, mynod, ierr)
str = 'test'
writebuf(0) = 0
call MPI_FILE_OPEN(MPI_COMM_WORLD, str, &
& MPI_MODE_CREATE+MPI_MODE_RDWR, MPI_INFO_NULL, fh, ierr)