---
title: 返回单个文件指针的当前位置
description: "MPI_File_get_position(MPI_File fh, MPI_Offset *offset)"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0026.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0026.html
indexId: 0fed676867779d1c56bbc19e108da97d31a47997e7ded848d2b5dbf0a926fd6f58
---
# 返回单个文件指针的当前位置

#### 函数定义

MPI_File_get_position(MPI_File fh, MPI_Offset *offset)

PMPI_File_get_position(MPI_File fh, MPI_Offset *offset)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| fh | 文件（句柄） | 非空 | 输入 |
| \*offset | 目标地址，存放偏移量 | 非空 | 输出 |


#### 返回值

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


#### 错误码

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