---
title: 返回与打开的文件关联的访问模式
description: "MPI_File_get_amode(MPI_File fh, int *amode)"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/userg_hyperio_0024.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/userg_hyperio_0024.html
indexId: 61c99d11828a8e5b0f38f389e0681c822f747ba67577695654037865cbcbc45764
---
# 返回与打开的文件关联的访问模式

#### 函数定义

MPI_File_get_amode(MPI_File fh, int *amode)

PMPI_File_get_amode(MPI_File fh, int *amode)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| fh | 文件（句柄） | 非空 | 输入 |
| \*amode | 目标地址，存放访问模式 | 非空 | 输出 |


#### 返回值

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


#### 错误码

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