Skip to content

Commit 9600e2b

Browse files
committed
MPI_Win_{attach,detach} : add Fortran bindings
1 parent f45244d commit 9600e2b

File tree

8 files changed

+112
-0
lines changed

8 files changed

+112
-0
lines changed

ompi/mpi/fortran/mpif-h/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,15 @@ libmpi_mpifh_la_SOURCES += \
393393
fetch_and_op_f.c \
394394
win_allocate_f.c \
395395
win_allocate_shared_f.c \
396+
win_attach_f.c \
396397
win_call_errhandler_f.c \
397398
win_complete_f.c \
398399
win_create_dynamic_errhandler_f.c \
399400
win_create_errhandler_f.c \
400401
win_create_f.c \
401402
win_create_keyval_f.c \
402403
win_delete_attr_f.c \
404+
win_detach_f.c \
403405
win_fence_f.c \
404406
win_free_f.c \
405407
win_free_keyval_f.c \

ompi/mpi/fortran/mpif-h/profile/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,15 @@ linked_files = \
318318
pfetch_and_op_f.c \
319319
pwin_allocate_f.c \
320320
pwin_allocate_shared_f.c \
321+
pwin_attach_f.c \
321322
pwin_call_errhandler_f.c \
322323
pwin_complete_f.c \
323324
pwin_create_dynamic_f.c \
324325
pwin_create_errhandler_f.c \
325326
pwin_create_f.c \
326327
pwin_create_keyval_f.c \
327328
pwin_delete_attr_f.c \
329+
pwin_detach_f.c \
328330
pwin_fence_f.c \
329331
pwin_free_f.c \
330332
pwin_free_keyval_f.c \

ompi/mpi/fortran/mpif-h/profile/defines.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,15 @@
348348
#define ompi_win_allocate_cptr_f pompi_win_allocate_cptr_f
349349
#define ompi_win_allocate_shared_f pompi_win_allocate_shared_f
350350
#define ompi_win_allocate_shared_cptr_f pompi_win_allocate_shared_cptr_f
351+
#define ompi_win_attach_f pompi_win_attach_f
351352
#define ompi_win_call_errhandler_f pompi_win_call_errhandler_f
352353
#define ompi_win_complete_f pompi_win_complete_f
353354
#define ompi_win_create_f pompi_win_create_f
354355
#define ompi_win_create_dynamic_f pompi_win_create_dynamic_f
355356
#define ompi_win_create_errhandler_f pompi_win_create_errhandler_f
356357
#define ompi_win_create_keyval_f pompi_win_create_keyval_f
357358
#define ompi_win_delete_attr_f pompi_win_delete_attr_f
359+
#define ompi_win_detach_f pompi_win_detach_f
358360
#define ompi_win_fence_f pompi_win_fence_f
359361
#define ompi_win_flush_f pompi_win_flush_f
360362
#define ompi_win_flush_all_f pompi_win_flush_all_f

ompi/mpi/fortran/mpif-h/prototypes_mpi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,15 @@ PN2(void, MPI_Win_allocate, mpi_win_allocate, MPI_WIN_ALLOCATE, (MPI_Aint *size,
405405
PN2(void, MPI_Win_allocate_cptr, mpi_win_allocate_cptr, MPI_WIN_ALLOCATE_CPTR, (MPI_Aint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, char *baseptr, MPI_Fint *win, MPI_Fint *ierr));
406406
PN2(void, MPI_Win_allocate_shared, mpi_win_allocate_shared, MPI_WIN_ALLOCATE_SHARED, (MPI_Aint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, char *baseptr, MPI_Fint *win, MPI_Fint *ierr));
407407
PN2(void, MPI_Win_allocate_shared_cptr, mpi_win_allocate_shared_cptr, MPI_WIN_ALLOCATE_SHARED_CPTR, (MPI_Aint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, char *baseptr, MPI_Fint *win, MPI_Fint *ierr));
408+
PN2(void, MPI_Win_attach, mpi_win_attach, MPI_WIN_ATTACH, (MPI_Fint *win, char *base, MPI_Aint *size, MPI_Fint *ierr));
408409
PN2(void, MPI_Win_call_errhandler, mpi_win_call_errhandler, MPI_WIN_CALL_ERRHANDLER, (MPI_Fint *win, MPI_Fint *errorcode, MPI_Fint *ierr));
409410
PN2(void, MPI_Win_complete, mpi_win_complete, MPI_WIN_COMPLETE, (MPI_Fint *win, MPI_Fint *ierr));
410411
PN2(void, MPI_Win_create, mpi_win_create, MPI_WIN_CREATE, (char *base, MPI_Aint *size, MPI_Fint *disp_unit, MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr));
411412
PN2(void, MPI_Win_create_dynamic, mpi_win_create_dynamic, MPI_WIN_CREATE_DYNAMIC, (MPI_Fint *info, MPI_Fint *comm, MPI_Fint *win, MPI_Fint *ierr));
412413
PN2(void, MPI_Win_create_errhandler, mpi_win_create_errhandler, MPI_WIN_CREATE_ERRHANDLER, (ompi_errhandler_fortran_handler_fn_t* function, MPI_Fint *errhandler, MPI_Fint *ierr));
413414
PN2(void, MPI_Win_create_keyval, mpi_win_create_keyval, MPI_WIN_CREATE_KEYVAL, (ompi_mpi2_fortran_copy_attr_function* win_copy_attr_fn, ompi_mpi2_fortran_delete_attr_function* win_delete_attr_fn, MPI_Fint *win_keyval, MPI_Aint *extra_state, MPI_Fint *ierr));
414415
PN2(void, MPI_Win_delete_attr, mpi_win_delete_attr, MPI_WIN_DELETE_ATTR, (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Fint *ierr));
416+
PN2(void, MPI_Win_detach, mpi_win_detach, MPI_WIN_DETACH, (MPI_Fint *win, char *base, MPI_Fint *ierr));
415417
PN2(void, MPI_Win_fence, mpi_win_fence, MPI_WIN_FENCE, (MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr));
416418
PN2(void, MPI_Win_flush, mpi_win_flush, MPI_WIN_FLUSH, (MPI_Fint *rank, MPI_Fint *win, MPI_Fint *ierr));
417419
PN2(void, MPI_Win_flush_all, mpi_win_flush_all, MPI_WIN_FLUSH_ALL, (MPI_Fint *win, MPI_Fint *ierr));

ompi/mpi/fortran/use-mpi-f08/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,15 @@ mpi_api_files = \
337337
waitsome_f08.F90 \
338338
win_allocate_f08.F90 \
339339
win_allocate_shared_f08.F90 \
340+
win_attach_f08.F90 \
340341
win_call_errhandler_f08.F90 \
341342
win_complete_f08.F90 \
342343
win_create_dynamic_f08.F90 \
343344
win_create_errhandler_f08.F90 \
344345
win_create_f08.F90 \
345346
win_create_keyval_f08.F90 \
346347
win_delete_attr_f08.F90 \
348+
win_detach_f08.F90 \
347349
win_fence_f08.F90 \
348350
win_flush_f08.F90 \
349351
win_flush_all_f08.F90 \

ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,6 +2380,25 @@ subroutine ompi_win_create_dynamic_f(info,comm,win,ierror) &
23802380
INTEGER, INTENT(OUT) :: ierror
23812381
end subroutine ompi_win_create_dynamic_f
23822382

2383+
subroutine ompi_win_attach_f(win,base,size,ierror) &
2384+
BIND(C, name="ompi_win_attach_f")
2385+
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
2386+
implicit none
2387+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: base
2388+
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size
2389+
INTEGER, INTENT(OUT) :: win
2390+
INTEGER, INTENT(OUT) :: ierror
2391+
end subroutine ompi_win_attach_f
2392+
2393+
subroutine ompi_win_detach_f(win,base,ierror) &
2394+
BIND(C, name="ompi_win_detach_f")
2395+
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
2396+
implicit none
2397+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: base
2398+
INTEGER, INTENT(OUT) :: win
2399+
INTEGER, INTENT(OUT) :: ierror
2400+
end subroutine ompi_win_detach_f
2401+
23832402
subroutine ompi_win_flush_f(rank,win,ierror) &
23842403
BIND(C, name="ompi_win_flush_f")
23852404
implicit none

ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,6 +3216,37 @@ subroutine MPI_Win_create_dynamic_f08(info,comm,win,ierror)
32163216
end subroutine MPI_Win_create_dynamic_f08
32173217
end interface MPI_Win_create_dynamic
32183218

3219+
interface MPI_Win_attach
3220+
subroutine MPI_Win_attach_f08(win,base,size,ierror)
3221+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
3222+
implicit none
3223+
!DEC$ ATTRIBUTES NO_ARG_CHECK :: base
3224+
!GCC$ ATTRIBUTES NO_ARG_CHECK :: base
3225+
!$PRAGMA IGNORE_TKR base
3226+
!DIR$ IGNORE_TKR base
3227+
!IBM* IGNORE_TKR base
3228+
OMPI_FORTRAN_IGNORE_TKR_TYPE :: base
3229+
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size
3230+
TYPE(MPI_Win), INTENT(OUT) :: win
3231+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3232+
end subroutine MPI_Win_attach_f08
3233+
end interface MPI_Win_attach
3234+
3235+
interface MPI_Win_detach
3236+
subroutine MPI_Win_detach_f08(win,base,ierror)
3237+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
3238+
implicit none
3239+
!DEC$ ATTRIBUTES NO_ARG_CHECK :: base
3240+
!GCC$ ATTRIBUTES NO_ARG_CHECK :: base
3241+
!$PRAGMA IGNORE_TKR base
3242+
!DIR$ IGNORE_TKR base
3243+
!IBM* IGNORE_TKR base
3244+
OMPI_FORTRAN_IGNORE_TKR_TYPE :: base
3245+
TYPE(MPI_Win), INTENT(OUT) :: win
3246+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3247+
end subroutine MPI_Win_detach_f08
3248+
end interface MPI_Win_detach
3249+
32193250
interface MPI_Win_fence
32203251
subroutine MPI_Win_fence_f08(assert,win,ierror)
32213252
use :: mpi_f08_types, only : MPI_Win

ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7418,6 +7418,58 @@ end subroutine PMPI_Win_create_dynamic
74187418
end interface
74197419

74207420

7421+
interface MPI_Win_attach
7422+
7423+
subroutine MPI_Win_attach(win, base, size, ierror)
7424+
include 'mpif-config.h'
7425+
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base
7426+
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, intent(in) :: base
7427+
integer(kind=MPI_ADDRESS_KIND), intent(in) :: size
7428+
integer, intent(out) :: win
7429+
integer, intent(out) :: ierror
7430+
end subroutine MPI_Win_attach
7431+
7432+
end interface
7433+
7434+
interface PMPI_Win_attach
7435+
7436+
subroutine PMPI_Win_attach(win, base, size, ierror)
7437+
include 'mpif-config.h'
7438+
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base
7439+
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, intent(in) :: base
7440+
integer(kind=MPI_ADDRESS_KIND), intent(in) :: size
7441+
integer, intent(out) :: win
7442+
integer, intent(out) :: ierror
7443+
end subroutine PMPI_Win_attach
7444+
7445+
end interface
7446+
7447+
7448+
interface MPI_Win_detach
7449+
7450+
subroutine MPI_Win_detach(win, base, ierror)
7451+
include 'mpif-config.h'
7452+
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base
7453+
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, intent(in) :: base
7454+
integer, intent(out) :: win
7455+
integer, intent(out) :: ierror
7456+
end subroutine MPI_Win_detach
7457+
7458+
end interface
7459+
7460+
interface PMPI_Win_detach
7461+
7462+
subroutine PMPI_Win_detach(win, base, ierror)
7463+
include 'mpif-config.h'
7464+
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ base
7465+
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, intent(in) :: base
7466+
integer, intent(out) :: win
7467+
integer, intent(out) :: ierror
7468+
end subroutine PMPI_Win_detach
7469+
7470+
end interface
7471+
7472+
74217473
interface MPI_Win_create_errhandler
74227474

74237475
subroutine MPI_Win_create_errhandler(function, errhandler, ierror)

0 commit comments

Comments
 (0)