s*****l 发帖数: 167 | 1 I have a simple MPI-Fortran 90 program and I want each individual
to write data to a different file: so I am expecting:
processor 1 to pos001.dat
processor 2 to pos002.dat
... ...
So I convert the rank to a string by subroutine 'num2str' then
put it in the filename. But strangely I always have some files missing.
I might have all the file pos001.dat to pos020.dat except pos003.dat
Can anyone tell me what is wrong. Is there a better way to deal with
situation?
| r*y 发帖数: 706 | 2 I just begin to learn some MPI. First, I feel that MPI is not the best for what you want to do. I used a codine system , which might be closer to what you want. 2ndly, you have to post yr function, so others can comment on it.
踨ay
【在 s*****l 的大作中提到】 : I have a simple MPI-Fortran 90 program and I want each individual : to write data to a different file: so I am expecting: : processor 1 to pos001.dat : processor 2 to pos002.dat : ... ... : So I convert the rank to a string by subroutine 'num2str' then : put it in the filename. But strangely I always have some files missing. : I might have all the file pos001.dat to pos020.dat except pos003.dat : Can anyone tell me what is wrong. Is there a better way to deal with : situation?
| p******o 发帖数: 216 | 3 I just do like this:
call mpi_comm_rank(..., proc_id, ...)
filename = "data"//achar(proc_id + 48)
open(..., file = filename, ...)
...
it works for me. don't know if there's other better way. :)
【在 s*****l 的大作中提到】 : I have a simple MPI-Fortran 90 program and I want each individual : to write data to a different file: so I am expecting: : processor 1 to pos001.dat : processor 2 to pos002.dat : ... ... : So I convert the rank to a string by subroutine 'num2str' then : put it in the filename. But strangely I always have some files missing. : I might have all the file pos001.dat to pos020.dat except pos003.dat : Can anyone tell me what is wrong. Is there a better way to deal with : situation?
|
|