LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-04-15 06:22:46


IIRC, the MPI standard says that files created by MPI I/O should only
be read by MPI I/O. I have actually not used ROMIO (the package that
is included in LAM/MPI to effect the MPI-2 I/O functionality), but I'm
pretty sure that it takes advantage of this rule.

Hence, if you want to read the file back out, you should be using an
MPI application to do so.

Keep in mind that the MPI_File_* functions are really for parallel
reading and writing of files. If all you want to do is read and write
some simple text files (in serial), you might be better served with
normal POSIX file writing functions in a single MPI process (e.g.,
open, fopen, write, fwrite, etc.). I.e., it's no uncommon, depending
on your specific application's requirements, to have something like:

        if (i_am_the_master) {
          /* ...receive results from all other processes... */
          fp = fopen("results.dat", "w");
          fwrite(fp, ...);
          fclose(fp);
        }

(sample only; always check your return values, etc.)

On Apr 12, 2005, at 5:09 PM, Guoli Wang wrote:

> Dear all,
>
> I have some troubles on reading output file from MPI running. I use
> following code line to write a string onto output file on eac node:
>
> MPI_File_write(OUT, &result, stringlength, MPI_CHAR, &status);
>
> where result is a string. But when I want read the output, I could not
> find the easy way to convert the output file into ascii file. I tried
> "od -c" but it split all the words into characters, I tried "od -s",
> it only give part of the whole string. Any other way to do that?
>
>
> Thanks,
>
> Guoli
>
> --
> Guoli Wang
> Bioinformatics
> Fox Chase Cancer Center
> 7701 Burlhome Avenue
> Philadelphia, PA 19111
> Phone: (215) 728 5661
> Email: GL_Wang_at_[hidden]
>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/