|
| 1 | +/* |
| 2 | + * Copyright (c) 2015 Research Organization for Information Science |
| 3 | + * and Technology (RIST). All rights reserved. |
| 4 | + * $COPYRIGHT$ |
| 5 | + * |
| 6 | + * Additional copyrights may follow |
| 7 | + * |
| 8 | + * $HEADER$ |
| 9 | + */ |
| 10 | + |
| 11 | +#include "ompi_config.h" |
| 12 | + |
| 13 | +#include "ompi/mpi/fortran/mpif-h/bindings.h" |
| 14 | + |
| 15 | +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER |
| 16 | +#pragma weak PMPI_WIN_ATTACH = ompi_win_attach_f |
| 17 | +#pragma weak pmpi_win_attach = ompi_win_attach_f |
| 18 | +#pragma weak pmpi_win_attach_ = ompi_win_attach_f |
| 19 | +#pragma weak pmpi_win_attach__ = ompi_win_attach_f |
| 20 | + |
| 21 | +#pragma weak PMPI_Win_create_f = ompi_win_attach_f |
| 22 | +#pragma weak PMPI_Win_create_f08 = ompi_win_attach_f |
| 23 | +#elif OMPI_PROFILE_LAYER |
| 24 | +OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_ATTACH, |
| 25 | + pmpi_win_attach, |
| 26 | + pmpi_win_attach_, |
| 27 | + pmpi_win_attach__, |
| 28 | + pompi_win_attach_f, |
| 29 | + (MPI_Fint *win, char *base, MPI_Aint *size, MPI_Fint *ierr), |
| 30 | + (win, base, size, ierr) ) |
| 31 | +#endif |
| 32 | + |
| 33 | +#if OPAL_HAVE_WEAK_SYMBOLS |
| 34 | +#pragma weak MPI_WIN_ATTACH = ompi_win_attach_f |
| 35 | +#pragma weak mpi_win_attach = ompi_win_attach_f |
| 36 | +#pragma weak mpi_win_attach_ = ompi_win_attach_f |
| 37 | +#pragma weak mpi_win_attach__ = ompi_win_attach_f |
| 38 | + |
| 39 | +#pragma weak MPI_Win_create_f = ompi_win_attach_f |
| 40 | +#pragma weak MPI_Win_create_f08 = ompi_win_attach_f |
| 41 | +#endif |
| 42 | + |
| 43 | +#if ! OPAL_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER |
| 44 | +OMPI_GENERATE_F77_BINDINGS (MPI_WIN_ATTACH, |
| 45 | + mpi_win_attach, |
| 46 | + mpi_win_attach_, |
| 47 | + mpi_win_attach__, |
| 48 | + ompi_win_attach_f, |
| 49 | + (MPI_Fint *win, char *base, MPI_Aint *size, MPI_Fint *ierr), |
| 50 | + (win, base, size, ierr) ) |
| 51 | +#endif |
| 52 | + |
| 53 | + |
| 54 | +#if OMPI_PROFILE_LAYER && ! OPAL_HAVE_WEAK_SYMBOLS |
| 55 | +#include "ompi/mpi/fortran/mpif-h/profile/defines.h" |
| 56 | +#endif |
| 57 | + |
| 58 | +void ompi_win_attach_f(MPI_Fint *win, char *base, MPI_Aint *size, |
| 59 | + MPI_Fint *ierr) |
| 60 | +{ |
| 61 | + int c_ierr; |
| 62 | + MPI_Win c_win; |
| 63 | + |
| 64 | + c_win = MPI_Win_f2c(*win); |
| 65 | + c_ierr = MPI_Win_attach(c_win, base, *size); |
| 66 | + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); |
| 67 | +} |
0 commit comments