|
[Sponsors] |
How to read files in parallel using fortran and mpi |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 21, 2010, 11:41 |
How to read files in parallel using fortran and mpi
|
#1 |
Senior Member
TWB
Join Date: Mar 2009
Posts: 409
Rep Power: 19 |
Hi,
I am now trying to read a data file which has about 2000x2000 pts. In the past, when file size is smaller, the file was read by 1 processor and then distributed to the rest of the processors. However, now the file size has gotten too big for the current memory. I am able to write to the file in parallel using: ... DO irank = 0, nprocs - 1 CALL MPI_BARRIER(MPI_COMM_WORLD, ierr) IF (irank == myrank) THEN IF (myrank == 0) THEN OPEN(10, FILE=’output’) ELSE OPEN(10, FILE=’output’, POSITION=’APPEND’) ENDIF WRITE(10) (outdata(i), i=ista,iend) CLOSE(10) ENDIF ENDDO ... I tried to do the same for the reading case but it can't work. Is it possible to read in fortran files by skipping e.g. 20000 values? If it's possible, then I should be able to solve my problem. Btw, I am using fortran binary files. Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
is there any parallel code for the famous Lid Driven Cavity flow? | gholamghar | Main CFD Forum | 0 | August 1, 2010 02:55 |
How to partition cartesian grid for MPI in fortran | CF | Main CFD Forum | 3 | January 17, 2008 05:38 |
how to call C++ function from fortran with MPI | kenn | Main CFD Forum | 1 | February 17, 2002 21:39 |