Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass parameters from input file to fortran 77 mpirun during run time?
    primarykey
    data
    text
    <p>I am an MPI and Fortran 77 noob. I have a fortran 77 code <code>FKRPRO.f</code> which I wanted to parallelize using OpenMPI. The code requires a lot of parameters which are fed into it during run time from a separate file. Compilation and running is something like this</p> <pre><code>gfortran -o FKRPRO FKRPRO.f ./FKRPRO &lt; Modelfile.txt </code></pre> <p>the equivalent lines in the code (not my code) are</p> <pre><code> PARAMETER(LIN=5) INTEGER ERROR LOGICAL PRNTA PRNTA=.FALSE. READ(LIN,'(L3)') PRNTA READ(LIN,21) M1,M2 21 FORMAT(11I5) </code></pre> <p>and so on. Can someone please explain to me what <code>READ(LIN,'(L3)') PRNTA</code> means. The input in the input file Modelfile.txt is something like this </p> <pre><code>.F. 0 64 and so on.. </code></pre> <p>I put the necessary MPI statements in the code. </p> <pre><code> INCLUDE 'MPIF.H' ... CALL MPI_INIT(ERROR) CALL MPI_COMM_SIZE(MPI_COMM_WORLD,NPROCS,ERROR) CALL MPI_COMM_RANK(MPI_COMM_WORLD,PRANK,ERROR) ... CALL MPI_TYPE_FREE(NEWMATRIX,ERROR) CALL MPI_FINALIZE(ERROR) </code></pre> <p>All processes are not being able to read the input file. I have compiled and run the code like this</p> <pre><code>mpif77 -o bc3 FKRPROG5.f mpirun -np 4 bc3 &lt; Modelfile.txt </code></pre> <p>This is not working. I get the following errors. Only the first process or rank 0 can read the file.</p> <pre><code>At line 50 of file FKRPROG5.f (unit = 5, file = 'stdin') Fortran runtime error: End of file At line 50 of file FKRPROG5.f (unit = 5, file = 'stdin') Fortran runtime error: End of file At line 50 of file FKRPROG5.f (unit = 5, file = 'stdin') Fortran runtime error: End of file mpirun has exited due to process rank 3 with PID 866 on node Avinash-rMBP.local exiting improperly. There are two reasons this could occur: 1. this process did not call "init" before exiting, but others in the job did. This can cause a job to hang indefinitely while it waits for all processes to call "init". By rule, if one process calls "init", then ALL processes must call "init" prior to termination. 2. this process called "init", but exited without calling "finalize". By rule, all processes that call "init" MUST call "finalize" prior to exiting or it will be considered an "abnormal termination" This may have caused other processes in the application to be terminated by signals sent by mpirun (as reported here). </code></pre> <p>50th line is <code>READ(LIN,'(L3)') PRNTA</code>.Someone kindly point out where I am going wrong :( So, how can I make all processes read from this input file &lt; Modelfile.txt ?? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload