Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Parallel I/O Usage
From: Rob Latham (robl_at_[hidden])
Date: 2009-07-08 16:47:44


On Mon, Jul 06, 2009 at 11:39:59AM +0200, Manuel Holtgrewe wrote:
> do I understand the MPI-2 Parallel I/O correctly (C++)?
>
> After opening a file with MPI::File::Open, I can use Read_at on the
> returned file object. I give offsets in bytes and I can perform random
> access reads from any process at any point of the file without
> violating correctness (although the performance might/should/will be
> better using views):
>
> MPI::File f = MPI::File::Open(MPI::COMM_WORLD, filename, MPI::MODE_RDONLY,
> MPI::INFO_NULL);
> // ...
> MPI::Offset pos_in_file = ...;
> // ...
> f.Read_at(pos_in_file, buffer, local_n + 1, MPI::INTEGER);
> // ...
> f.Close();

why the +1 ? what's local_n in the first place?

> I have some problems with the program reading invalid data and want to
> make sure I am actually using parallel I/O the right way.

I think you're OK here. What are you seeing? Is this NFS?

==rob

-- 
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA