鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

文件操作

函数定义

  • 以聚合模式创建文件。

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

  • 读取文件。

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

  • 关闭文件。

    int ncmpi_close(int fileId);

  • 结束定义。

    int ncmpi_enddef(int fileId);

  • 进入独立数据模式。

    int ncmpi_begin_indep_data(int fileId);

  • 退出独立数据模式。

    int ncmpi_end_indep_data(int fileId);

  • 依据错误码打印错误信息。

    const char* ncmpi_strerror(int err);

参数

参数名

描述

取值范围

输入/输出

fileId

文件ID

非负整数

输入

*name

路径名称

非空,长度小于256字节

输入

mode

访问模式

非空

输入

info

MPI信息

非空

输入

*idPoint

返回文件ID的指针

非空

输出

err

错误码

整数

输入

返回值

  • 成功:返回NC_NOERR。
  • 失败:返回错误码。

错误码

错误码

描述

NC_EBADID

无效fileId

NC_EBAD_FILE

无效的文件名

NC_ENOMEM

空指针或无效内存