MPI_File_read man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



MPI_File_read(3)					      MPI_File_read(3)

NAME
     MPI_File_read - Uses individual file pointer to read a file

SYNOPSIS
     C:

	  #include "mpi.h"

	  int MPI_File_read(MPI_File fh, void *buf, int count,
	  MPI_Datatype datatype, MPI_Status status)

     Fortran:

	  INCLUDE "mpif.h" (or USE MPI)

	  <type> BUF(*)
	  INTEGER fh, count, datatype, status(MPI_STATUS_SIZE),
	  ierror

	  CALL MPI_FILE_READ(fh, buf, count, datatype,
	  status, ierror)

DESCRIPTION
     MPI_File_read reads a file using the individual file pointer.  This
     routine accepts the following arguments:

     fh	       Specifies the file handle (handle)

     buf       Returns the initial address of the buffer (choice)

     count     Specifies the number of elements in the buffer (nonnegative
	       integer)

     datatype  Specifies the data type of each buffer element (handle)

     status    Returns the status object (status)

     ierror    Specifies the return code value for successful completion,
	       which is in MPI_SUCCESS.	 MPI_SUCCESS is defined in the mpif.h
	       file.

   Notes for Fortran
     All MPI objects (for example, MPI_Datatype, MPI_Comm, MPI_File) are of
     type INTEGER.

EXAMPLES
     The following Fortran code fragment is an example of reading a file until
     the end of file is reached:

     !	 Read a preexisting input file until all data has been read.

									Page 1

MPI_File_read(3)					      MPI_File_read(3)

     !	 Call routine "process_input" if all requested data is read.
     !	 The Fortran 90 "exit" statement exits the loop.

     integer   bufsize, numread, totprocessed, status(MPI_STATUS_SIZE)
	   parameter (bufsize=100)
	   real	     localbuffer(bufsize)

     call MPI_FILE_OPEN( MPI_COMM_WORLD, 'myoldfile', &
			       MPI_MODE_RDONLY, MPI_INFO_NULL, myfh, ierr )
	   call MPI_FILE_SET_VIEW( myfh, 0, MPI_REAL, MPI_REAL, 'native', &
			       MPI_INFO_NULL, ierr )
	   totprocessed = 0
	   do
	      call MPI_FILE_READ( myfh, localbuffer, bufsize, MPI_REAL, &
				  status, ierr )
	      call MPI_GET_COUNT( status, MPI_REAL, numread, ierr )
	      call process_input( localbuffer, numread )
	      totprocessed = totprocessed + numread
	      if ( numread < bufsize ) exit
	   enddo

     write(6,1001) numread, bufsize, totprocessed
     1001  format( "No more data:  read", I3, "and expected", I3, &
		   "Processed total of", I6, "before terminating job." )

     call MPI_FILE_CLOSE( myfh, ierr )

SEE ALSO
     MPI_File_open(3), MPI_IO(3)

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net