File Operations
Function Syntax
- Create a file.
NC_create(const char *name, int mode, size_t initialsz, int basepe,
size_t *chunksizehintp, int useparallel, void *parameters, int *ncidp)
- Create a file for parallel I/O.
nc_create_par(const char *name, int mode, MPI_Comm comm, MPI_Info info, int* ncidp)
- Open an existing file.
NC_open(const char *name, int mode, int basepe, size_t *chunksizehintp,
int useparallel, void *parameters, int *ncidp)
- Open an existing file for parallel I/O.
nc_open_par(const char *name, int mode, MPI_Comm comm, MPI_Info info, int* ncidp)
- Close an opened file.
- Enter the define mode.
- End the define mode.
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
ncid |
File ID |
Non-negative integer |
Input |
*ncidp |
Pointer to the file ID |
Non-empty |
Output |
*name |
File name |
Non-empty string of less than 256 bytes |
Input |
comm |
MPI communicator handle |
Non-empty |
Input |
info |
MPI info object handle |
Non-empty |
Input |
*chunksizehintp |
Pointer to the chunk size |
Non-empty |
Input |
useparallel |
Whether to enable parallel I/O |
Integer |
Input |
*parameters |
Pointer to the MPI information structure |
Non-empty |
Input |
mode |
Create or open mode |
Integer |
Input |
initialsz |
Initial size |
Non-negative integer |
Input |
basepe |
Base processing element |
Integer |
Input |
Return Value
- Success: NC_NOERR
- Failure: An error code is returned.
Error Code
Error Code |
Description |
|---|---|
NC_EBADID |
Invalid ncid |
NC_EINVAL |
Invalid argument |
NC_ENOMEM |
Insufficient memory |