attribute related MPI c functions
This commit was SVN r1172.
Этот коммит содержится в:
родитель
de297e5b1a
Коммит
9d03ed0589
@ -111,7 +111,7 @@ libmpi_c_mpi_la_SOURCES = \
|
||||
comm_rank.c \
|
||||
comm_remote_group.c \
|
||||
comm_remote_size.c \
|
||||
comm_set_attribute.c \
|
||||
comm_set_attr.c \
|
||||
comm_set_errhandler.c \
|
||||
comm_set_name.c \
|
||||
comm_size.c \
|
||||
|
@ -17,17 +17,21 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Attr_delete";
|
||||
|
||||
int MPI_Attr_delete(MPI_Comm comm, int keyval)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (MPI_COMM_NULL == comm)
|
||||
return MPI_ERR_COMM;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (MPI_COMM_NULL == comm) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_delete(COMM_ATTR, comm, keyval, 0);
|
||||
ret = lam_attr_delete(COMM_ATTR, comm, comm->c_keyhash, keyval, 0);
|
||||
|
||||
/* Error hanndling code here */
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, comm, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
||||
|
@ -17,14 +17,20 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Attr_get";
|
||||
|
||||
int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
|
||||
{
|
||||
int ret;
|
||||
if ((NULL == attribute_val) || (NULL == flag))
|
||||
return MPI_ERR_ARG;
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == attribute_val) || (NULL == flag)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_get(comm->c_keyhash, keyval, attribute_val, flag);
|
||||
|
||||
ret = lam_attr_get(COMM_ATTR, comm, keyval, attribute_val, flag);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -17,16 +17,22 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Attr_put";
|
||||
|
||||
int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
|
||||
{
|
||||
int ret;
|
||||
if (MPI_COMM_NULL == comm)
|
||||
return MPI_ERR_COMM;
|
||||
|
||||
ret = lam_attr_set(COMM_ATTR, comm, keyval, attribute_val, 0);
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (MPI_COMM_NULL == comm) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
/* Error handling code here */
|
||||
ret = lam_attr_set(COMM_ATTR, comm, comm->c_keyhash,
|
||||
keyval, attribute_val, 0);
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, comm, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
||||
|
@ -16,21 +16,29 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Comm_create_keyval";
|
||||
|
||||
int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn,
|
||||
MPI_Comm_delete_attr_function *comm_delete_attr_fn,
|
||||
int *comm_keyval, void *extra_state)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((NULL == comm_copy_attr_fn) || (NULL == comm_delete_attr_fn) ||
|
||||
(NULL == comm_keyval))
|
||||
return MPI_ERR_ARG;
|
||||
lam_attribute_fn_ptr_union_t copy_fn;
|
||||
lam_attribute_fn_ptr_union_t del_fn;
|
||||
|
||||
ret = lam_attr_create_keyval(COMM_ATTR, (void *)comm_copy_attr_fn,
|
||||
(void *)comm_delete_attr_fn,
|
||||
comm_keyval, extra_state, 0);
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == comm_copy_attr_fn) || (NULL == comm_delete_attr_fn) ||
|
||||
(NULL == comm_keyval)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
copy_fn.attr_communicator_copy_fn = comm_copy_attr_fn;
|
||||
del_fn.attr_communicator_delete_fn = comm_delete_attr_fn;
|
||||
|
||||
/* Error handling code here */
|
||||
ret = lam_attr_create_keyval(COMM_ATTR, copy_fn,
|
||||
del_fn, comm_keyval, extra_state, 0);
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,16 +16,20 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Comm_delete_attr";
|
||||
|
||||
int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (MPI_COMM_NULL == comm)
|
||||
return MPI_ERR_COMM;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (MPI_COMM_NULL == comm) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_delete(COMM_ATTR, comm, comm_keyval, 0);
|
||||
ret = lam_attr_delete(COMM_ATTR, comm, comm->c_keyhash, comm_keyval, 0);
|
||||
|
||||
/* Error hanndling code here */
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, comm, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,16 +16,22 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Comm_free_keyval";
|
||||
|
||||
int MPI_Comm_free_keyval(int *comm_keyval)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Check for valid key pointer */
|
||||
|
||||
if (NULL == comm_keyval)
|
||||
return MPI_ERR_ARG;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == comm_keyval) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_free_keyval(COMM_ATTR, comm_keyval, 0);
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,15 +16,22 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Comm_get_attr";
|
||||
|
||||
int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval,
|
||||
void *attribute_val, int *flag)
|
||||
{
|
||||
int ret;
|
||||
if ((NULL == attribute_val) || (NULL == flag))
|
||||
return MPI_ERR_ARG;
|
||||
|
||||
ret = lam_attr_get(COMM_ATTR, comm, comm_keyval,
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == attribute_val) || (NULL == flag)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_get(comm->c_keyhash, comm_keyval,
|
||||
attribute_val, flag);
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, comm, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,22 +16,28 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Keyval_create";
|
||||
|
||||
int MPI_Keyval_create(MPI_Copy_function *copy_attr_fn,
|
||||
MPI_Delete_function *delete_attr_fn,
|
||||
int *keyval, void *extra_state)
|
||||
{
|
||||
int ret;
|
||||
|
||||
lam_attribute_fn_ptr_union_t copy_fn;
|
||||
lam_attribute_fn_ptr_union_t del_fn;
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == copy_attr_fn) || (NULL == delete_attr_fn) ||
|
||||
(NULL == keyval))
|
||||
return MPI_ERR_ARG;
|
||||
(NULL == keyval)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
copy_fn.attr_communicator_copy_fn = copy_attr_fn;
|
||||
del_fn.attr_communicator_delete_fn = delete_attr_fn;
|
||||
|
||||
ret = lam_attr_create_keyval(COMM_ATTR, (void *)copy_attr_fn,
|
||||
(void *)delete_attr_fn,
|
||||
keyval, extra_state, 0);
|
||||
|
||||
/* Error handling code here */
|
||||
|
||||
return ret;
|
||||
ret = lam_attr_create_keyval(COMM_ATTR, copy_fn,
|
||||
del_fn, keyval, extra_state, 0);
|
||||
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,17 +16,21 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Keyval_free";
|
||||
|
||||
int MPI_Keyval_free(int *keyval)
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Check for valid key pointer */
|
||||
|
||||
if (NULL == keyval)
|
||||
return MPI_ERR_ARG;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == keyval) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_free_keyval(COMM_ATTR, keyval, 0);
|
||||
|
||||
return ret;
|
||||
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
|
||||
pcomm_rank.c \
|
||||
pcomm_remote_group.c \
|
||||
pcomm_remote_size.c \
|
||||
pcomm_set_attribute.c \
|
||||
pcomm_set_attr.c \
|
||||
pcomm_set_errhandler.c \
|
||||
pcomm_set_name.c \
|
||||
pcomm_size.c \
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Type_create_keyval";
|
||||
|
||||
int
|
||||
MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
|
||||
MPI_Type_delete_attr_function *type_delete_attr_fn,
|
||||
@ -23,18 +25,24 @@ MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn,
|
||||
void *extra_state)
|
||||
{
|
||||
int ret;
|
||||
lam_attribute_fn_ptr_union_t copy_fn;
|
||||
lam_attribute_fn_ptr_union_t del_fn;
|
||||
|
||||
if ((NULL == type_copy_attr_fn) || (NULL == type_delete_attr_fn) ||
|
||||
(NULL == type_keyval))
|
||||
return MPI_ERR_ARG;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == type_copy_attr_fn) || (NULL == type_delete_attr_fn) ||
|
||||
(NULL == type_keyval)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
copy_fn.attr_datatype_copy_fn = type_copy_attr_fn;
|
||||
del_fn.attr_datatype_delete_fn = type_delete_attr_fn;
|
||||
|
||||
ret = lam_attr_create_keyval(TYPE_ATTR, (void *)type_copy_attr_fn,
|
||||
(void *)type_delete_attr_fn,
|
||||
ret = lam_attr_create_keyval(TYPE_ATTR, copy_fn, del_fn,
|
||||
type_keyval, extra_state, 0);
|
||||
|
||||
/* Error handling code here */
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,17 +16,21 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Type_delete_attr";
|
||||
|
||||
int
|
||||
MPI_Type_delete_attr (MPI_Datatype type, int type_keyval)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (MPI_DATATYPE_NULL == type)
|
||||
return MPI_ERR_TYPE;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (MPI_DATATYPE_NULL == type) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_delete(TYPE_ATTR, type, type_keyval, 0);
|
||||
ret = lam_attr_delete(TYPE_ATTR, type, type->d_keyhash, type_keyval, 0);
|
||||
|
||||
/* Error handling code here */
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, type, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Type_free_keyval";
|
||||
|
||||
int
|
||||
MPI_Type_free_keyval(int *type_keyval)
|
||||
{
|
||||
@ -23,10 +25,14 @@ MPI_Type_free_keyval(int *type_keyval)
|
||||
|
||||
/* Check for valid key pointer */
|
||||
|
||||
if (NULL == type_keyval)
|
||||
return MPI_ERR_ARG;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == type_keyval) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_free_keyval(TYPE_ATTR, type_keyval, 0);
|
||||
|
||||
return ret;
|
||||
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Type_get_attr";
|
||||
|
||||
int
|
||||
MPI_Type_get_attr (MPI_Datatype type,
|
||||
int type_keyval,
|
||||
@ -24,11 +26,15 @@ MPI_Type_get_attr (MPI_Datatype type,
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((NULL == attribute_val) || (NULL == flag))
|
||||
return MPI_ERR_ARG;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == attribute_val) || (NULL == flag)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_get(TYPE_ATTR, type, type_keyval,
|
||||
ret = lam_attr_get(type->d_keyhash, type_keyval,
|
||||
attribute_val, flag);
|
||||
|
||||
return ret;
|
||||
|
||||
LAM_ERRHANDLER_RETURN(ret, type, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Type_set_attr";
|
||||
|
||||
int
|
||||
MPI_Type_set_attr (MPI_Datatype type,
|
||||
int type_keyval,
|
||||
@ -23,12 +25,16 @@ MPI_Type_set_attr (MPI_Datatype type,
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (MPI_DATATYPE_NULL == type)
|
||||
return MPI_ERR_TYPE;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (MPI_DATATYPE_NULL == type) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_set(TYPE_ATTR, type, type_keyval, attribute_val, 0);
|
||||
ret = lam_attr_set(TYPE_ATTR, type, type->d_keyhash,
|
||||
type_keyval, attribute_val, 0);
|
||||
|
||||
/* Error handling code here */
|
||||
LAM_ERRHANDLER_RETURN(ret, type, MPI_ERR_OTHER, FUNC_NAME);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -16,21 +16,28 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Win_create_keyval";
|
||||
|
||||
int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn,
|
||||
MPI_Win_delete_attr_function *win_delete_attr_fn,
|
||||
int *win_keyval, void *extra_state) {
|
||||
|
||||
int ret;
|
||||
lam_attribute_fn_ptr_union_t copy_fn;
|
||||
lam_attribute_fn_ptr_union_t del_fn;
|
||||
|
||||
if ((NULL == win_copy_attr_fn) || (NULL == win_delete_attr_fn) ||
|
||||
(NULL == win_keyval))
|
||||
return MPI_ERR_ARG;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == win_copy_attr_fn) || (NULL == win_delete_attr_fn) ||
|
||||
(NULL == win_keyval)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
copy_fn.attr_win_copy_fn = win_copy_attr_fn;
|
||||
del_fn.attr_win_delete_fn = win_delete_attr_fn;
|
||||
|
||||
ret = lam_attr_create_keyval(WIN_ATTR, (void *)win_copy_attr_fn,
|
||||
(void *)win_delete_attr_fn,
|
||||
ret = lam_attr_create_keyval(WIN_ATTR, copy_fn, del_fn,
|
||||
win_keyval, extra_state, 0);
|
||||
|
||||
/* Error handling code here */
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,16 +16,20 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Win_delete_attr";
|
||||
|
||||
int MPI_Win_delete_attr(MPI_Win win, int win_keyval)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (MPI_WIN_NULL == win)
|
||||
return MPI_ERR_WIN;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (MPI_WIN_NULL == win) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_delete(WIN_ATTR, win, win_keyval, 0);
|
||||
ret = lam_attr_delete(WIN_ATTR, win, win->w_keyhash, win_keyval, 0);
|
||||
|
||||
/* Error hanndling code here */
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, win, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,16 +16,22 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Win_free_keyval";
|
||||
|
||||
int MPI_Win_free_keyval(int *win_keyval) {
|
||||
|
||||
int ret;
|
||||
|
||||
/* Check for valid key pointer */
|
||||
|
||||
if (NULL == win_keyval)
|
||||
return MPI_ERR_ARG;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == win_keyval) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_free_keyval(WIN_ATTR, win_keyval, 0);
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
@ -16,16 +16,22 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Win_get_attr";
|
||||
|
||||
int MPI_Win_get_attr(MPI_Win win, int win_keyval,
|
||||
void *attribute_val, int *flag) {
|
||||
int ret;
|
||||
|
||||
if ((NULL == attribute_val) || (NULL == flag))
|
||||
|
||||
return MPI_ERR_ARG;
|
||||
|
||||
ret = lam_attr_get(WIN_ATTR, win, win_keyval,
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if ((NULL == attribute_val) || (NULL == flag)) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_get(win->w_keyhash, win_keyval,
|
||||
attribute_val, flag);
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, win, MPI_ERR_OTHER, FUNC_NAME);
|
||||
|
||||
}
|
||||
|
@ -16,16 +16,21 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Win_set_attr";
|
||||
|
||||
int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val) {
|
||||
|
||||
int ret;
|
||||
|
||||
if (MPI_WIN_NULL == win)
|
||||
return MPI_ERR_WIN;
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (MPI_WIN_NULL == win) {
|
||||
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
ret = lam_attr_set(WIN_ATTR, win, win_keyval, attribute_val, 0);
|
||||
ret = lam_attr_set(WIN_ATTR, win, win->w_keyhash,
|
||||
win_keyval, attribute_val, 0);
|
||||
|
||||
/* Error handling here */
|
||||
|
||||
return ret;
|
||||
LAM_ERRHANDLER_RETURN(ret, win, MPI_ERR_OTHER, FUNC_NAME);
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user