}
int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
- smpi_copy_fn _copy_fn;
- smpi_delete_fn _delete_fn;
+ smpi_copy_fn _copy_fn={};
+ smpi_delete_fn _delete_fn={};
_copy_fn.comm_copy_fn = copy_fn;
_delete_fn.comm_delete_fn = delete_fn;
return Keyval::keyval_create<Comm>(_copy_fn, _delete_fn, keyval, extra_state);
else if (comm==MPI_COMM_NULL)
return MPI_ERR_COMM;
else
- return comm->attr_delete(keyval);
+ return comm->attr_delete<Comm>(keyval);
}
int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
*static_cast<int**>(attr_value) = &one;
return MPI_SUCCESS;
default:
- return comm->attr_get(keyval, attr_value, flag);
+ return comm->attr_get<Comm>(keyval, attr_value, flag);
}
}
else if (comm==MPI_COMM_NULL)
return MPI_ERR_COMM;
else
- return comm->attr_put(keyval, attr_value);
+ return comm->attr_put<Comm>(keyval, attr_value);
}
int PMPI_Comm_get_attr (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag)
if (type==MPI_DATATYPE_NULL)
return MPI_ERR_TYPE;
else
- return type->attr_get(type_keyval, attribute_val, flag);
+ return type->attr_get<Datatype>(type_keyval, attribute_val, flag);
}
int PMPI_Type_set_attr (MPI_Datatype type, int type_keyval, void *attribute_val)
if (type==MPI_DATATYPE_NULL)
return MPI_ERR_TYPE;
else
- return type->attr_put(type_keyval, attribute_val);
+ return type->attr_put<Datatype>(type_keyval, attribute_val);
}
int PMPI_Type_delete_attr (MPI_Datatype type, int type_keyval)
if (type==MPI_DATATYPE_NULL)
return MPI_ERR_TYPE;
else
- return type->attr_delete(type_keyval);
+ return type->attr_delete<Datatype>(type_keyval);
}
int PMPI_Type_create_keyval(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval,
void* extra_state)
{
- smpi_copy_fn _copy_fn;
- smpi_delete_fn _delete_fn;
+ smpi_copy_fn _copy_fn={};
+ smpi_delete_fn _delete_fn={};
_copy_fn.type_copy_fn = copy_fn;
_delete_fn.type_delete_fn = delete_fn;
return Keyval::keyval_create<Datatype>(_copy_fn, _delete_fn, keyval, extra_state);
return Keyval::keyval_free<Datatype>(keyval);
}
+int PMPI_Win_get_attr (MPI_Win win, int keyval, void *attribute_val, int* flag)
+{
+ static MPI_Aint size;
+ static int disp_unit;
+ if (win==MPI_WIN_NULL)
+ return MPI_ERR_TYPE;
+ else{
+ switch (keyval) {
+ case MPI_WIN_BASE :
+ *static_cast<void**>(attribute_val) = win->base();
+ *flag = 1;
+ return MPI_SUCCESS;
+ case MPI_WIN_SIZE :
+ size = win->size();
+ *static_cast<MPI_Aint**>(attribute_val) = &size;
+ *flag = 1;
+ return MPI_SUCCESS;
+ case MPI_WIN_DISP_UNIT :
+ disp_unit=win->disp_unit();
+ *static_cast<int**>(attribute_val) = &disp_unit;
+ *flag = 1;
+ return MPI_SUCCESS;
+ default:
+ return win->attr_get<Win>(keyval, attribute_val, flag);
+ }
+}
+
+}
+
+int PMPI_Win_set_attr (MPI_Win win, int type_keyval, void *attribute_val)
+{
+ if (win==MPI_WIN_NULL)
+ return MPI_ERR_TYPE;
+ else
+ return win->attr_put<Win>(type_keyval, attribute_val);
+}
+
+int PMPI_Win_delete_attr (MPI_Win win, int type_keyval)
+{
+ if (win==MPI_WIN_NULL)
+ return MPI_ERR_TYPE;
+ else
+ return win->attr_delete<Win>(type_keyval);
+}
+
+int PMPI_Win_create_keyval(MPI_Win_copy_attr_function* copy_fn, MPI_Win_delete_attr_function* delete_fn, int* keyval,
+ void* extra_state)
+{
+ smpi_copy_fn _copy_fn={};
+ smpi_delete_fn _delete_fn={};
+ _copy_fn.win_copy_fn = copy_fn;
+ _delete_fn.win_delete_fn = delete_fn;
+ return Keyval::keyval_create<Win>(_copy_fn, _delete_fn, keyval, extra_state);
+}
+
+int PMPI_Win_free_keyval(int* keyval) {
+ return Keyval::keyval_free<Win>(keyval);
+}
+
int PMPI_Info_create( MPI_Info *info){
if (info == nullptr)
return MPI_ERR_ARG;