Skip to content

Commit 7179d44

Browse files
committed
MPI_Win_{attach,detach}: add missing files
fixes commit 9600e2b
1 parent 1d8ce96 commit 7179d44

File tree

6 files changed

+220
-0
lines changed

6 files changed

+220
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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_DETACH = ompi_win_detach_f
17+
#pragma weak pmpi_win_detach = ompi_win_detach_f
18+
#pragma weak pmpi_win_detach_ = ompi_win_detach_f
19+
#pragma weak pmpi_win_detach__ = ompi_win_detach_f
20+
21+
#pragma weak PMPI_Win_create_f = ompi_win_detach_f
22+
#pragma weak PMPI_Win_create_f08 = ompi_win_detach_f
23+
#elif OMPI_PROFILE_LAYER
24+
OMPI_GENERATE_F77_BINDINGS (PMPI_WIN_DETACH,
25+
pmpi_win_detach,
26+
pmpi_win_detach_,
27+
pmpi_win_detach__,
28+
pompi_win_detach_f,
29+
(MPI_Fint *win, char *base, MPI_Fint *ierr),
30+
(win, base, ierr) )
31+
#endif
32+
33+
#if OPAL_HAVE_WEAK_SYMBOLS
34+
#pragma weak MPI_WIN_DETACH = ompi_win_detach_f
35+
#pragma weak mpi_win_detach = ompi_win_detach_f
36+
#pragma weak mpi_win_detach_ = ompi_win_detach_f
37+
#pragma weak mpi_win_detach__ = ompi_win_detach_f
38+
39+
#pragma weak MPI_Win_create_f = ompi_win_detach_f
40+
#pragma weak MPI_Win_create_f08 = ompi_win_detach_f
41+
#endif
42+
43+
#if ! OPAL_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER
44+
OMPI_GENERATE_F77_BINDINGS (MPI_WIN_DETACH,
45+
mpi_win_detach,
46+
mpi_win_detach_,
47+
mpi_win_detach__,
48+
ompi_win_detach_f,
49+
(MPI_Fint *win, char *base, MPI_Fint *ierr),
50+
(win, base, 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_detach_f(MPI_Fint *win, char *base,
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_detach(c_win, base);
66+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
67+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2015 Research Organization for Information Science
4+
! and Technology (RIST). All rights reserved.
5+
! $COPYRIGHT$
6+
7+
#include "ompi/mpi/fortran/configure-fortran-output.h"
8+
9+
subroutine PMPI_Win_attach_f08(win,base,size,ierror)
10+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
11+
use :: mpi_f08, only : ompi_win_attach_f
12+
implicit none
13+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: base
14+
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size
15+
TYPE(MPI_Win), INTENT(OUT) :: win
16+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
17+
integer :: c_ierror
18+
19+
call ompi_win_attach_f(win%MPI_VAL,base,size,c_ierror)
20+
if (present(ierror)) ierror = c_ierror
21+
22+
end subroutine PMPI_Win_attach_f08
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2015 Research Organization for Information Science
4+
! and Technology (RIST). All rights reserved.
5+
! $COPYRIGHT$
6+
7+
#include "ompi/mpi/fortran/configure-fortran-output.h"
8+
9+
subroutine PMPI_Win_detach_f08(win,base,ierror)
10+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
11+
use :: mpi_f08, only : ompi_win_detach_f
12+
implicit none
13+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: base
14+
TYPE(MPI_Win), INTENT(OUT) :: win
15+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
16+
integer :: c_ierror
17+
18+
call ompi_win_detach_f(win%MPI_VAL,base,c_ierror)
19+
if (present(ierror)) ierror = c_ierror
20+
21+
end subroutine PMPI_Win_detach_f08
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2015 Research Organization for Information Science
4+
! and Technology (RIST). All rights reserved.
5+
! $COPYRIGHT$
6+
7+
#include "ompi/mpi/fortran/configure-fortran-output.h"
8+
9+
subroutine MPI_Win_attach_f08(win,base,size,ierror)
10+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
11+
use :: mpi_f08, only : ompi_win_attach_f
12+
implicit none
13+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: base
14+
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size
15+
TYPE(MPI_Win), INTENT(OUT) :: win
16+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
17+
integer :: c_ierror
18+
19+
call ompi_win_attach_f(win%MPI_VAL,base,size,c_ierror)
20+
if (present(ierror)) ierror = c_ierror
21+
22+
end subroutine MPI_Win_attach_f08
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2015 Research Organization for Information Science
4+
! and Technology (RIST). All rights reserved.
5+
! $COPYRIGHT$
6+
7+
#include "ompi/mpi/fortran/configure-fortran-output.h"
8+
9+
subroutine MPI_Win_detach_f08(win,base,ierror)
10+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
11+
use :: mpi_f08, only : ompi_win_detach_f
12+
implicit none
13+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: base
14+
TYPE(MPI_Win), INTENT(OUT) :: win
15+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
16+
integer :: c_ierror
17+
18+
call ompi_win_detach_f(win%MPI_VAL,base,c_ierror)
19+
if (present(ierror)) ierror = c_ierror
20+
21+
end subroutine MPI_Win_detach_f08

0 commit comments

Comments
 (0)