---
title: array模式数据读取
description: "任意类型array模式数据读取。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0076.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0076.html
indexId: 7933487c1690947ffce9bad25d0c7db36e5eb60fdab74ec03f8c3638deadac0858
---
# array模式数据读取

#### 函数定义

任意类型array模式数据读取。

int ncmpi_get_vara_all(int fileId, int variableId, const MPI_Offset* start, const MPI_Offset* count, void *data, MPI_Offset bufcount, MPI_Datatype bufType)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| fileId | 文件ID | 非负整数 | 输入 |
| variableId | variable ID | 非负整数 | 输入 |
| \*start | 读取起始位置偏移 | 非空 | 输入 |
| \*count | 读取大小 | 非空 | 输入 |
| \*data | 指向读取数据的指针 | 非空 | 输出 |
| bufcount | 指向读取数据大小的指针 | 非负整数 | 输出 |
| bufType | 指向读取数据类型的指针 | 非空 | 输出 |


#### 返回值

- 成功：返回NC_NOERR。
- 失败：返回错误码。


#### 错误码

| 错误码 | 描述 |
| --- | --- |
| NC\_EBADID | 无效ncid |
| NC\_ENOTINDEP | 在集合数据模式下尝试独立I/O操作 |
| NC\_EINVALCOORDS | 指定的索引超出了指定变量的秩的范围 |
| NC\_ENOTVAR | 无效的varid |
