From 55bdaca61002ac41529b5c0a0d5e6a4d689fc5bf Mon Sep 17 00:00:00 2001 From: Vishal Sahay Date: Fri, 17 Sep 2004 06:44:06 +0000 Subject: [PATCH] Win f77 bindings This commit was SVN r2738. --- src/mpi/f77/win_fence_f.c | 4 +++- src/mpi/f77/win_free_f.c | 6 +++++- src/mpi/f77/win_free_keyval_f.c | 6 +++++- src/mpi/f77/win_get_errhandler_f.c | 10 ++++++++-- src/mpi/f77/win_get_group_f.c | 7 ++++++- src/mpi/f77/win_lock_f.c | 10 ++++++++-- src/mpi/f77/win_post_f.c | 10 ++++++++-- src/mpi/f77/win_set_errhandler_f.c | 8 ++++++-- src/mpi/f77/win_start_f.c | 10 ++++++++-- src/mpi/f77/win_test_f.c | 8 +++++++- src/mpi/f77/win_unlock_f.c | 5 ++++- src/mpi/f77/win_wait_f.c | 4 +++- 12 files changed, 71 insertions(+), 17 deletions(-) diff --git a/src/mpi/f77/win_fence_f.c b/src/mpi/f77/win_fence_f.c index ee1b8c6258..dc396fc41a 100644 --- a/src/mpi/f77/win_fence_f.c +++ b/src/mpi/f77/win_fence_f.c @@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_FENCE, void mpi_win_fence_f(MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_fence(OMPI_FINT_2_INT(*assert), c_win)); } diff --git a/src/mpi/f77/win_free_f.c b/src/mpi/f77/win_free_f.c index 4d74cf88e1..002c04be7b 100644 --- a/src/mpi/f77/win_free_f.c +++ b/src/mpi/f77/win_free_f.c @@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_FREE, void mpi_win_free_f(MPI_Fint *win, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_free(&c_win)); + + *win = MPI_Win_c2f(c_win); } diff --git a/src/mpi/f77/win_free_keyval_f.c b/src/mpi/f77/win_free_keyval_f.c index 652c0808d6..c722caa8de 100644 --- a/src/mpi/f77/win_free_keyval_f.c +++ b/src/mpi/f77/win_free_keyval_f.c @@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_FREE_KEYVAL, void mpi_win_free_keyval_f(MPI_Fint *win_keyval, MPI_Fint *ierr) { - /* This function not yet implemented */ + OMPI_SINGLE_NAME_DECL(win_keyval); + + *ierr = OMPI_INT_2_FINT(MPI_Win_free_keyval(OMPI_SINGLE_NAME_CONVERT(win_keyval))); + + OMPI_SINGLE_INT_2_FINT(win_keyval); } diff --git a/src/mpi/f77/win_get_errhandler_f.c b/src/mpi/f77/win_get_errhandler_f.c index 5d3b8e19ed..3e7e31a91a 100644 --- a/src/mpi/f77/win_get_errhandler_f.c +++ b/src/mpi/f77/win_get_errhandler_f.c @@ -46,7 +46,13 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_GET_ERRHANDLER, #include "mpi/f77/profile/defines.h" #endif -void mpi_win_get_errhandler_f(MPI_Fint *win, MPI_Fint *errhandler, MPI_Fint *ierr) +void mpi_win_get_errhandler_f(MPI_Fint *win, MPI_Fint *errhandler, + MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Errhandler c_err; + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_get_errhandler(c_win, &c_err)); + + *errhandler = MPI_Errhandler_c2f(c_err); } diff --git a/src/mpi/f77/win_get_group_f.c b/src/mpi/f77/win_get_group_f.c index 20fc48fa5e..9f46d08084 100644 --- a/src/mpi/f77/win_get_group_f.c +++ b/src/mpi/f77/win_get_group_f.c @@ -48,5 +48,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_GET_GROUP, void mpi_win_get_group_f(MPI_Fint *win, MPI_Fint *group, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Group c_grp; + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_get_group(c_win, &c_grp)); + + *group = MPI_Group_c2f(c_grp); } diff --git a/src/mpi/f77/win_lock_f.c b/src/mpi/f77/win_lock_f.c index 85142bb747..fce052b0fd 100644 --- a/src/mpi/f77/win_lock_f.c +++ b/src/mpi/f77/win_lock_f.c @@ -46,7 +46,13 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_LOCK, #include "mpi/f77/profile/defines.h" #endif -void mpi_win_lock_f(MPI_Fint *lock_type, MPI_Fint *rank, MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr) +void mpi_win_lock_f(MPI_Fint *lock_type, MPI_Fint *rank, + MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_lock(OMPI_FINT_2_INT(*lock_type), + OMPI_FINT_2_INT(*rank), + OMPI_FINT_2_INT(*assert), + c_win)); } diff --git a/src/mpi/f77/win_post_f.c b/src/mpi/f77/win_post_f.c index 5f21d6297e..a1dbdbfa52 100644 --- a/src/mpi/f77/win_post_f.c +++ b/src/mpi/f77/win_post_f.c @@ -46,7 +46,13 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_POST, #include "mpi/f77/profile/defines.h" #endif -void mpi_win_post_f(MPI_Fint *group, MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr) +void mpi_win_post_f(MPI_Fint *group, MPI_Fint *assert, + MPI_Fint *win, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + MPI_Group c_grp = MPI_Group_f2c(*group); + + *ierr = OMPI_INT_2_FINT(MPI_Win_post(c_grp, + OMPI_FINT_2_INT(*assert), + c_win)); } diff --git a/src/mpi/f77/win_set_errhandler_f.c b/src/mpi/f77/win_set_errhandler_f.c index eb7179f2ac..8f47169c82 100644 --- a/src/mpi/f77/win_set_errhandler_f.c +++ b/src/mpi/f77/win_set_errhandler_f.c @@ -46,7 +46,11 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_SET_ERRHANDLER, #include "mpi/f77/profile/defines.h" #endif -void mpi_win_set_errhandler_f(MPI_Fint *win, MPI_Fint *errhandler, MPI_Fint *ierr) +void mpi_win_set_errhandler_f(MPI_Fint *win, MPI_Fint *errhandler, + MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + MPI_Errhandler c_err = MPI_Errhandler_f2c(*errhandler); + + *ierr = OMPI_INT_2_FINT(MPI_Win_set_errhandler(c_win, c_err)); } diff --git a/src/mpi/f77/win_start_f.c b/src/mpi/f77/win_start_f.c index 8d480ef91e..eab336ae46 100644 --- a/src/mpi/f77/win_start_f.c +++ b/src/mpi/f77/win_start_f.c @@ -46,7 +46,13 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_START, #include "mpi/f77/profile/defines.h" #endif -void mpi_win_start_f(MPI_Fint *group, MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr) +void mpi_win_start_f(MPI_Fint *group, MPI_Fint *assert, + MPI_Fint *win, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Group c_grp = MPI_Group_f2c(*group); + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_start(c_grp, + OMPI_FINT_2_INT(*assert), + c_win)); } diff --git a/src/mpi/f77/win_test_f.c b/src/mpi/f77/win_test_f.c index ca6908007f..a8f821bf22 100644 --- a/src/mpi/f77/win_test_f.c +++ b/src/mpi/f77/win_test_f.c @@ -48,5 +48,11 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_TEST, void mpi_win_test_f(MPI_Fint *win, MPI_Fint *flag, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + OMPI_SINGLE_NAME_DECL(flag); + + *ierr = OMPI_INT_2_FINT(MPI_Win_test(c_win, + OMPI_SINGLE_NAME_CONVERT(flag))); + + OMPI_SINGLE_INT_2_FINT(flag); } diff --git a/src/mpi/f77/win_unlock_f.c b/src/mpi/f77/win_unlock_f.c index 38351e358f..251e6467e7 100644 --- a/src/mpi/f77/win_unlock_f.c +++ b/src/mpi/f77/win_unlock_f.c @@ -48,5 +48,8 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_UNLOCK, void mpi_win_unlock_f(MPI_Fint *rank, MPI_Fint *win, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_unlock(OMPI_FINT_2_INT(*rank), + c_win)); } diff --git a/src/mpi/f77/win_wait_f.c b/src/mpi/f77/win_wait_f.c index 7360d37bd3..a8edad904d 100644 --- a/src/mpi/f77/win_wait_f.c +++ b/src/mpi/f77/win_wait_f.c @@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_WAIT, void mpi_win_wait_f(MPI_Fint *win, MPI_Fint *ierr) { - /* This function not yet implemented */ + MPI_Win c_win = MPI_Win_f2c(*win); + + *ierr = OMPI_INT_2_FINT(MPI_Win_wait(c_win)); }