---
title: 返回文件中数据类型的范围
description: "MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent)"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0027.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0027.html
indexId: b5d6a5b02dcfe9022dc370099412a45e3c1408245b689f88eda35ffcac12796858
---
# 返回文件中数据类型的范围

#### 函数定义

MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent)

PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| fh | 文件（句柄） | 非空 | 输入 |
| datatype | 数据类型（句柄） | 非空 | 输入 |
| \*extent | 数据类型范围 | 非空 | 输出 |


#### 返回值

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


#### 错误码

| 错误码 | 描述 |
| --- | --- |
| MPI\_ERR\_FILE | 无效文件句柄 |


#### 注意

仅支持基本数据类型与中间件提供接口产生数据类型的计算。
