CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

How to read files in parallel using fortran and mpi

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   November 21, 2010, 11:41
Default How to read files in parallel using fortran and mpi
Senior Member
Join Date: Mar 2009
Posts: 139
Rep Power: 10
quarkz is on a distinguished road

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
IF (irank == myrank) THEN
IF (myrank == 0) THEN
OPEN(10, FILE=’output’)
WRITE(10) (outdata(i), i=ista,iend)

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.

quarkz is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 01: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

All times are GMT -4. The time now is 08:14.