Rate This Document
Findability
Accuracy
Completeness
Readability

File Operations

Function Syntax

  • Create a file in collective mode.

    int ncmpi_create(MPI_Comm comm, const char* name, int mode, MPI_Info info, int* idPoint);

  • Read a file.

    int ncmpi_open(MPI_Comm comm, const char* name, int mode, MPI_Info info, int* idPoint);

  • Close a file.

    int ncmpi_close(int fileId);

  • End the define mode.

    int ncmpi_enddef(int fileId);

  • Enter the independent data mode.

    int ncmpi_begin_indep_data(int fileId);

  • End the independent data mode.

    int ncmpi_end_indep_data(int fileId);

  • Print an error message corresponding to an error code.

    const char* ncmpi_strerror(int err);

Parameters

Parameter

Description

Value Range

Input/Output

fileId

File ID

Non-negative integer

Input

*name

Path name

Non-empty string of less than 256 bytes

Input

mode

Access mode

Non-empty

Input

info

MPI information

Non-empty

Input

*idPoint

Pointer to the file ID

Non-empty

Output

err

Error code

Integer

Input

Return Value

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

Error Code

Error Code

Description

NC_EBADID

Invalid fileId

NC_EBAD_FILE

Invalid file name

NC_ENOMEM

Null pointer or invalid memory