Rate This Document
Findability
Accuracy
Completeness
Readability

Opening a File in Collective Mode

Function Syntax

MPI_File_open(MPI_Comm comm, const char* filename, int amode, MPI_Info info, MPI_File *fh)

PMPI_File_open(MPI_Comm comm, const char* filename, int amode, MPI_Info info, MPI_File *fh)

Parameters

Parameter

Description

Value Range

Input/Output

comm

Communicator (handle)

Non-empty

Input

*filename

Name of the file to be opened

Non-empty string of less than 256 bytes

Input

amode

File access mode

Integer

Input

info

info object (handle)

Non-empty

Input

*fh

Destination address for storing the new file (handle)

Non-empty

Output

Return Value

  • Success: MPI_SUCCESS
  • Failure: An error code is returned.

Error Code

Error Code

Description

MPI_ERR_BAD_FILE

Invalid file name

MPI_ERR_AMODE

Unsupported access mode

MPI_ERR_ARG

Other invalid arguments

MPI_ERR_ACCESS

Access denied

MPI_ERR_IO

Other I/O errors

MPI_ERR_OTHER

Other errors

Notes

Hyper IO supports the following amode values for opening files:

  • MPI_MODE_CREATE
  • MPI_MODE_DELETE_ON_CLOSE
  • MPI_MODE_RDONLY
  • MPI_MODE_WRONLY
  • MPI_MODE_RDWR (Write-only mode. Attempting to read files opened in this mode triggers an error.)