Fortran wrappers finished
This commit was SVN r1465.
Этот коммит содержится в:
родитель
6a8704b229
Коммит
5adbc0f4dc
@ -48,5 +48,5 @@ OMPI_GENERATE_F77_BINDINGS (MPI_FINALIZED,
|
||||
|
||||
void mpi_finalized_f(MPI_Fint *flag, MPI_Fint *ierr)
|
||||
{
|
||||
|
||||
*ierr = MPI_Finalized(flag);
|
||||
}
|
||||
|
@ -48,5 +48,5 @@ OMPI_GENERATE_F77_BINDINGS (MPI_GET_VERSION,
|
||||
|
||||
void mpi_get_version_f(MPI_Fint *version, MPI_Fint *subversion, MPI_Fint *ierr)
|
||||
{
|
||||
|
||||
*ierr = MPI_Get_version(version, subversion);
|
||||
}
|
||||
|
@ -48,5 +48,5 @@ OMPI_GENERATE_F77_BINDINGS (MPI_INITIALIZED,
|
||||
|
||||
void mpi_initialized_f(MPI_Fint *flag, MPI_Fint *ierr)
|
||||
{
|
||||
|
||||
*ierr = MPI_Initialized(flag);
|
||||
}
|
||||
|
@ -48,5 +48,9 @@ OMPI_GENERATE_F77_BINDINGS (MPI_REQUEST_FREE,
|
||||
|
||||
void mpi_request_free_f(MPI_Fint *request, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Request c_req = MPI_Request_f2c( *request );
|
||||
|
||||
*ierr = MPI_Request_free( &c_req );
|
||||
|
||||
*request = MPI_Request_f2c( &c_req );
|
||||
}
|
||||
|
@ -48,5 +48,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_REQUEST_GET_STATUS,
|
||||
|
||||
void mpi_request_get_status_f(MPI_Fint *request, MPI_Fint *flag, MPI_Fint *status, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Status c_status;
|
||||
MPI_Request c_req = MPI_Request_f2c( *request );
|
||||
|
||||
*ierr = MPI_Request_get_status( c_req, flag, &c_status );
|
||||
|
||||
MPI_Status_c2f( &c_status, status );
|
||||
}
|
||||
|
@ -48,5 +48,15 @@ OMPI_GENERATE_F77_BINDINGS (MPI_STATUS_SET_ELEMENTS,
|
||||
|
||||
void mpi_status_set_elements_f(MPI_Fint *status, MPI_Fint *datatype, MPI_Fint *count, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type;
|
||||
MPI_Status c_status;
|
||||
|
||||
MPI_Status_f2c( status, &c_status );
|
||||
|
||||
*ierr = MPI_Status_set_elements(&c_status, &c_type, *count);
|
||||
|
||||
/* If datatype is really being set, then that needs to be converted.... */
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
MPI_Status_c2f(&c_status, status);
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "mpi.h"
|
||||
#include "mpi/f77/bindings.h"
|
||||
#include "attribute/attribute.h"
|
||||
|
||||
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER
|
||||
#pragma weak PMPI_TYPE_CREATE_KEYVAL = mpi_type_create_keyval_f
|
||||
@ -46,7 +47,34 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_CREATE_KEYVAL,
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Type_create_keyval_f";
|
||||
|
||||
void mpi_type_create_keyval_f(MPI_Fint *type_copy_attr_fn, MPI_Fint *type_delete_attr_fn, MPI_Fint *type_keyval, char *extra_state, MPI_Fint *ierr)
|
||||
{
|
||||
int ret;
|
||||
ompi_attribute_fn_ptr_union_t copy_fn;
|
||||
ompi_attribute_fn_ptr_union_t del_fn;
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == type_copy_attr_fn) ||
|
||||
(NULL == type_delete_attr_fn) ||
|
||||
(NULL == type_keyval) ) {
|
||||
*ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD,
|
||||
MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
copy_fn.attr_F_copy_fn = (MPI_F_copy_function *)type_copy_attr_fn;
|
||||
del_fn.attr_F_delete_fn = (MPI_F_delete_function *)type_delete_attr_fn;
|
||||
|
||||
ret = ompi_attr_create_keyval(TYPE_ATTR, copy_fn, del_fn,
|
||||
type_keyval, extra_state, OMPI_KEYVAL_F77);
|
||||
|
||||
if (ret != OMPI_SUCCESS) {
|
||||
*ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
|
||||
FUNC_NAME);
|
||||
} else {
|
||||
*ierr = MPI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -48,5 +48,12 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_DELETE_ATTR,
|
||||
|
||||
void mpi_type_delete_attr_f(MPI_Fint *type, MPI_Fint *type_keyval, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c(*type);
|
||||
|
||||
*ierr = MPI_Type_delete_attr( c_type, *type_keyval );
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*type = MPI_Type_c2f( c_type );
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_GET_ATTR,
|
||||
|
||||
void mpi_type_get_attr_f(MPI_Fint *type, MPI_Fint *type_keyval, char *attribute_val, MPI_Fint *flag, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c( *type );
|
||||
|
||||
*ierr = MPI_Type_get_attr( c_type, *type_keyval, attribute_val, flag );
|
||||
}
|
||||
|
@ -48,5 +48,11 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_SET_ATTR,
|
||||
|
||||
void mpi_type_set_attr_f(MPI_Fint *type, MPI_Fint *type_keyval, char *attr_val, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Datatype c_type = MPI_Type_f2c( *type );
|
||||
|
||||
*ierr = MPI_Type_set_attr( c_type, *type_keyval, attr_val );
|
||||
|
||||
if (*ierr == MPI_SUCCESS)
|
||||
*type = MPI_Type_c2f( c_type );
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "mpi.h"
|
||||
#include "mpi/f77/bindings.h"
|
||||
#include "attribute/attribute.h"
|
||||
|
||||
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER
|
||||
#pragma weak PMPI_WIN_CREATE_KEYVAL = mpi_win_create_keyval_f
|
||||
@ -46,7 +47,33 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_CREATE_KEYVAL,
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Win_create_keyval";
|
||||
|
||||
void mpi_win_create_keyval_f(MPI_Fint *win_copy_attr_fn, MPI_Fint *win_delete_attr_fn, MPI_Fint *win_keyval, char *extra_state, MPI_Fint *ierr)
|
||||
{
|
||||
int ret;
|
||||
ompi_attribute_fn_ptr_union_t copy_fn;
|
||||
ompi_attribute_fn_ptr_union_t del_fn;
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == win_copy_attr_fn) ||
|
||||
(NULL == win_delete_attr_fn) ||
|
||||
(NULL == win_keyval) ) {
|
||||
*ierr = OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD,
|
||||
MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
copy_fn.attr_F_copy_fn = (MPI_F_copy_function *)win_copy_attr_fn;
|
||||
del_fn.attr_F_delete_fn = (MPI_F_delete_function *)win_delete_attr_fn;
|
||||
|
||||
ret = ompi_attr_create_keyval(WIN_ATTR, copy_fn, del_fn,
|
||||
win_keyval, extra_state, OMPI_KEYVAL_F77);
|
||||
|
||||
if (ret != OMPI_SUCCESS) {
|
||||
OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
} else {
|
||||
*ierr = MPI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_GET_ATTR,
|
||||
|
||||
void mpi_win_get_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, char *attribute_val, MPI_Fint *flag, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Win c_win = MPI_Win_f2c( *win );
|
||||
|
||||
*ierr = MPI_Win_get_attr( c_win, *win_keyval, attribute_val, flag );
|
||||
}
|
||||
|
@ -48,5 +48,7 @@ OMPI_GENERATE_F77_BINDINGS (MPI_WIN_SET_ATTR,
|
||||
|
||||
void mpi_win_set_attr_f(MPI_Fint *win, MPI_Fint *win_keyval, char *attribute_val, MPI_Fint *ierr)
|
||||
{
|
||||
MPI_Win c_win = MPI_Win_f2c( *win );
|
||||
|
||||
*ierr = MPI_Win_set_attr( c_win, *win_keyval, attribute_val );
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user