コード例 #1
0
ファイル: io_romio314_file_open.c プロジェクト: anandhis/ompi
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;
}
コード例 #2
0
ファイル: io_romio314_file_open.c プロジェクト: anandhis/ompi
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;
}
コード例 #3
0
ファイル: io_ompio_file_open.c プロジェクト: brminich/ompi
int mca_io_ompio_file_set_info (ompi_file_t *fh,
				ompi_info_t *info)
{
    int ret = OMPI_SUCCESS;

    if ( MPI_INFO_NULL == fh->f_info ) {
	/* OBJ_RELEASE(MPI_INFO_NULL); */
    }
    else {
	ompi_info_free ( &fh->f_info);
	fh->f_info = OBJ_NEW(ompi_info_t);
	ret = ompi_info_dup (info, &fh->f_info);
    }

    return ret;
}
コード例 #4
0
ファイル: io_romio314_file_open.c プロジェクト: anandhis/ompi
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;
}