int mca_io_romio314_file_open (ompi_communicator_t *comm, const char *filename, int amode, opal_info_t *info, ompi_file_t *fh) { int ret; mca_io_romio314_data_t *data; // An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call // below with an MPI_Info, we need to create an equivalent MPI_Info. This // isn't ideal but it only happens a few places. ompi_info_t *ompi_info; ompi_info = OBJ_NEW(ompi_info_t); if (!ompi_info) { return(MPI_ERR_NO_MEM); } opal_info_t *opal_info = &(ompi_info->super); opal_info_dup (info, &opal_info); data = (mca_io_romio314_data_t *) fh->f_io_selected_data; // OPAL_THREAD_LOCK (&mca_io_romio314_mutex); ret = ROMIO_PREFIX(MPI_File_open)(comm, filename, amode, ompi_info, &data->romio_fh); // OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); ompi_info_free(&ompi_info); return ret; }
int mca_io_romio314_file_set_view (ompi_file_t *fh, MPI_Offset disp, struct ompi_datatype_t *etype, struct ompi_datatype_t *filetype, const char *datarep, opal_info_t *info) { int ret; mca_io_romio314_data_t *data; // An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call // below with an MPI_Info, we need to create an equivalent MPI_Info. This // isn't ideal but it only happens a few places. ompi_info_t *ompi_info; ompi_info = OBJ_NEW(ompi_info_t); if (!ompi_info) { return(MPI_ERR_NO_MEM); } opal_info_t *opal_info = &(ompi_info->super); opal_info_dup (info, &opal_info); data = (mca_io_romio314_data_t *) fh->f_io_selected_data; OPAL_THREAD_LOCK (&mca_io_romio314_mutex); ret = ROMIO_PREFIX(MPI_File_set_view) (data->romio_fh, disp, etype, filetype, datarep, ompi_info); OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); ompi_info_free(&ompi_info); return ret; }
int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) { OPAL_CR_NOOP_PROGRESS(); if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == info_used) { return OMPI_ERRHANDLER_INVOKE(fh, MPI_ERR_INFO, FUNC_NAME); } if (ompi_file_invalid(fh)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); } } if (NULL == fh->super.s_info) { /* * Setup any defaults if MPI_Win_set_info was never called */ opal_infosubscribe_change_info(fh, &MPI_INFO_NULL->super); } (*info_used) = OBJ_NEW(ompi_info_t); if (NULL == (*info_used)) { return OMPI_ERRHANDLER_INVOKE(fh, MPI_ERR_NO_MEM, FUNC_NAME); } opal_info_dup(fh->super.s_info, &(*info_used)->super); return OMPI_SUCCESS; }
int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used) { int ret; OPAL_CR_NOOP_PROGRESS(); if (MPI_PARAM_CHECK) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (ompi_win_invalid(win)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME); } if (NULL == info_used) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME); } } if (NULL == win->super.s_info) { /* * Setup any defaults if MPI_Win_set_info was never called */ opal_infosubscribe_change_info(win, &MPI_INFO_NULL->super); } (*info_used) = OBJ_NEW(ompi_info_t); if (NULL == (*info_used)) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_NO_MEM, FUNC_NAME); } ret = opal_info_dup(&win->super.s_info, &(*info_used)->super); OMPI_ERRHANDLER_RETURN(ret, win, ret, FUNC_NAME); }
static int alloc_window(struct ompi_communicator_t *comm, opal_info_t *info, int flavor, ompi_win_t **win_out) { ompi_win_t *win; ompi_group_t *group; int acc_ops, acc_order, flag, ret; /* create the object */ win = OBJ_NEW(ompi_win_t); if (NULL == win) { return OMPI_ERR_OUT_OF_RESOURCE; } ret = opal_info_get_value_enum (info, "accumulate_ops", &acc_ops, OMPI_WIN_ACCUMULATE_OPS_SAME_OP_NO_OP, ompi_win_accumulate_ops, &flag); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } win->w_acc_ops = (ompi_win_accumulate_ops_t)acc_ops; ret = opal_info_get_value_enum (info, "accumulate_order", &acc_order, OMPI_WIN_ACC_ORDER_RAR | OMPI_WIN_ACC_ORDER_WAR | OMPI_WIN_ACC_ORDER_RAW | OMPI_WIN_ACC_ORDER_WAW, &(ompi_win_accumulate_order->super), &flag); if (OMPI_SUCCESS != ret) { OBJ_RELEASE(win); return ret; } win->w_acc_order = acc_order; win->w_flavor = flavor; /* setup data that is independent of osc component */ group = comm->c_local_group; OBJ_RETAIN(group); win->w_group = group; /* Copy the info for the info layer */ win->super.s_info = OBJ_NEW(opal_info_t); if (info) { opal_info_dup(info, &(win->super.s_info)); } *win_out = win; return OMPI_SUCCESS; }
int mca_io_romio314_file_get_info (ompi_file_t *fh, opal_info_t ** info_used) { int ret; mca_io_romio314_data_t *data; // An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call // below with an MPI_Info, we need to create an equivalent MPI_Info. This // isn't ideal but it only happens a few places. ompi_info_t *ompi_info; ompi_info = OBJ_NEW(ompi_info_t); if (!ompi_info) { return(MPI_ERR_NO_MEM); } data = (mca_io_romio314_data_t *) fh->f_io_selected_data; OPAL_THREAD_LOCK (&mca_io_romio314_mutex); ret = ROMIO_PREFIX(MPI_File_get_info) (data->romio_fh, &ompi_info); OPAL_THREAD_UNLOCK (&mca_io_romio314_mutex); opal_info_dup (&(ompi_info->super), info_used); ompi_info_free(&ompi_info); return ret; }