This source file includes following definitions.
- SHMEM_GENERATE_WEAK_BINDINGS
1
2
3
4
5
6
7
8
9
10
11
12 #include "oshmem_config.h"
13 #include "oshmem/shmem/fortran/bindings.h"
14 #include "oshmem/include/shmem.h"
15 #include "oshmem/shmem/shmem_api_logger.h"
16 #include "stdio.h"
17 #include "oshmem/runtime/runtime.h"
18
19 #if OSHMEM_PROFILING
20 #include "oshmem/shmem/fortran/profile/pbindings.h"
21 SHMEM_GENERATE_WEAK_BINDINGS(SHPCLMOVE, shpclmove)
22 #include "oshmem/shmem/fortran/profile/defines.h"
23 #endif
24
25 SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
26 SHPCLMOVE,
27 shpclmove_,
28 shpclmove__,
29 shpclmove_f,
30 (FORTRAN_POINTER_T *addr, MPI_Fint *length, MPI_Fint *status, MPI_Fint *abort),
31 (addr,length,status,abort) )
32
33
34 void shpclmove_f(FORTRAN_POINTER_T *addr, MPI_Fint *length, MPI_Fint *status, MPI_Fint *abort)
35 {
36 FORTRAN_POINTER_T prev_addr = *addr;
37
38 *status = 0;
39 if (*length <= 0)
40 {
41 *status = -1;
42 goto Exit;
43 }
44
45 *addr = (FORTRAN_POINTER_T)shrealloc(FPTR_2_VOID_PTR(*addr), OMPI_FINT_2_INT(*length) * 4);
46
47 if (*addr == 0)
48 {
49 *status = -2;
50 goto Exit;
51 }
52
53 if (prev_addr != *addr)
54 {
55 *status = 1;
56 }
57
58 Exit:
59 if (*status < 0)
60 {
61 if (*abort)
62 {
63 oshmem_shmem_abort(-1);
64 }
65 }
66 }
67