18.2.88. shmem_int_fetch

shmem_int4_fetch(3), shmem_int8_fetch(3), shmem_int_fetch(3), shmem_long_fetch(3), shmem_longlong_fetch(3) shmem_double_fetch(3) shmem_float_fetch(3) - 原子性地获取远程数据对象的值

18.2.88.1. 概述

C或C++:

#include <mpp/shmem.h>

int shmem_int_fetch(int *target, int pe)

long shmem_long_fetch(long *target, int pe)

long long shmem_longlong_fetch(long long *target, int pe)

double shmem_double_fetch(long long *target, int pe)

float  shmem_float_fetch(float *target, int pe)

Fortran语言:

INCLUDE "mpp/shmem.fh"

INTEGER pe

INTEGER(KIND=4) SHMEM_INT4_FETCH, ires, target
ires = SHMEM_INT4_FETCH(target, pe)

INTEGER(KIND=8) SHMEM_INT8_FETCH, ires, target
ires = SHMEM_INT8_FETCH(target, pe)


REAL(KIND=4) SHMEM_INT4_FETCH, ires, target
ires = SHMEM_REAL4_FETCH(target, pe)

REAL(KIND=8) SHMEM_INT8_FETCH, ires, target
ires = SHMEM_REAL8_FETCH(target, pe)

18.2.88.2. 描述

shmem_fetch函数执行原子获取操作。它们以原子操作的方式返回target的内容。

参数如下:

target

要从远程PE获取的可远程访问数据对象。

pe

一个整数,表示从中获取target的PE编号。如果使用Fortran,它必须是一个默认整数值。

18.2.88.3. 返回值

远程PE上目标地址处的内容。返回值的类型与远程数据对象的类型相同。

另请参阅

intro_shmem(3)