Thank you @urbanjost ! Uhm I think I made only rank 0 do the reading, as below shows,
The
if (myrank==0) then
guarantee the rank 0 is the only process doing the reading.
Interestingly, the same xxx.exe file, if I execute mpiexec -n 6 xxx.exe < input.dat it just hangs. But if I just do xxx.exe < input.dat it works no problem.
However if the input.dat is concise as shown at the 1st thread and also as below, then mpiexec -n 6 xxx.exe < input.dat works.
9002785287 # * irn.
12 # imode.
1000 # * itermax.
.true. # * stop_criterion_on.
30 # * LL_n.
0.0 # * crit_1.
1 # * kmix.
.true. # read Yji or generate Yji.
1000 # * mgauss_all.
5000000 # * m_all.
30 # * i_init.
simdata.csv # data.csv name
simpar.csv # parcsvname