---
title: array模式数据读取
description: "任意类型array模式数据读取。"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/userg_hyperio_0076.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/userg_hyperio_0076.html
indexId: fd585794812285b3669e0ca3344feaad859f14ce5711c612f44e31dd3ea0f75f64
---
# 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 |
