---
title: stride模式数据写入
description: "- 任意类型集合通信写入函数，stride模式。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0074.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0074.html
indexId: 81b60cf538c2bd580b3a6bfe75126b7e65775fecbd68827b0690dfa313f841f258
---
# stride模式数据写入

#### 函数定义

- 任意类型集合通信写入函数，stride模式。
  int ncmpi_put_vars_all(int fileId, int variableId, const MPI_Offset* start, const MPI_Offset* count, const MPI_Offset* stride, const void *data, MPI_Offset bufCount, MPI_Datatype bufType)

- double类型集合通信写入函数，stride模式。
  int ncmpi_put_vars_double_all(int fileId, int variableId, const MPI_Offset* start, const MPI_Offset* count, const MPI_Offset* stride, const double *data)


#### 参数

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


#### 返回值

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


#### 错误码

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