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

#### 函数定义

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 | 无效文件句柄 |
