avatar
s*l
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?
avatar
r*y
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?

avatar
p*o
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?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。