Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ompi/mca/io/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2015 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -153,6 +153,10 @@ typedef int (*mca_io_base_module_file_get_size_fn_t)
(struct ompi_file_t *fh, MPI_Offset *size);
typedef int (*mca_io_base_module_file_get_amode_fn_t)
(struct ompi_file_t *fh, int *amode);
typedef int (*mca_io_base_module_file_set_info_fn_t)
(struct ompi_file_t *fh, struct ompi_info_t *info);
typedef int (*mca_io_base_module_file_get_info_fn_t)
(struct ompi_file_t *fh, struct ompi_info_t **info_used);

typedef int (*mca_io_base_module_file_set_view_fn_t)
(struct ompi_file_t *fh, MPI_Offset disp, struct ompi_datatype_t *etype,
Expand Down Expand Up @@ -307,6 +311,8 @@ struct mca_io_base_module_2_0_0_t {
mca_io_base_module_file_preallocate_fn_t io_module_file_preallocate;
mca_io_base_module_file_get_size_fn_t io_module_file_get_size;
mca_io_base_module_file_get_amode_fn_t io_module_file_get_amode;
mca_io_base_module_file_set_info_fn_t io_module_file_set_info;
mca_io_base_module_file_get_info_fn_t io_module_file_get_info;

mca_io_base_module_file_set_view_fn_t io_module_file_set_view;
mca_io_base_module_file_get_view_fn_t io_module_file_get_view;
Expand Down
4 changes: 3 additions & 1 deletion ompi/mca/io/ompio/io_ompio_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2011 University of Houston. All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -36,6 +36,8 @@ mca_io_base_module_2_0_0_t mca_io_ompio_module = {
mca_io_ompio_file_preallocate,
mca_io_ompio_file_get_size,
mca_io_ompio_file_get_amode,
NULL,
NULL,

mca_io_ompio_file_set_view,
mca_io_ompio_file_get_view,
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/io/romio321/src/io_romio321.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -81,9 +81,9 @@ int mca_io_romio321_file_get_size (struct ompi_file_t *fh,
int mca_io_romio321_file_get_amode (struct ompi_file_t *fh,
int *amode);
int mca_io_romio321_file_set_info (struct ompi_file_t *fh,
struct opal_info_t *info);
struct ompi_info_t *info);
int mca_io_romio321_file_get_info (struct ompi_file_t *fh,
struct opal_info_t ** info_used);
struct ompi_info_t ** info_used);

/* Section 9.3 */
int mca_io_romio321_file_set_view (struct ompi_file_t *fh,
Expand Down
29 changes: 5 additions & 24 deletions ompi/mca/io/romio321/src/io_romio321_file_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -162,51 +162,32 @@ mca_io_romio321_file_get_amode (ompi_file_t *fh,

int
mca_io_romio321_file_set_info (ompi_file_t *fh,
opal_info_t *info)
ompi_info_t *info)
{
int ret;
mca_io_romio321_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_romio321_data_t *) fh->f_io_selected_data;
OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
ret = ROMIO_PREFIX(MPI_File_set_info) (data->romio_fh, ompi_info);
ret = ROMIO_PREFIX(MPI_File_set_info) (data->romio_fh, info);
OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);

ompi_info_free(&ompi_info);
return ret;
}


int
mca_io_romio321_file_get_info (ompi_file_t *fh,
opal_info_t ** info_used)
ompi_info_t ** info_used)
{
int ret;
mca_io_romio321_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_romio321_data_t *) fh->f_io_selected_data;
OPAL_THREAD_LOCK (&mca_io_romio321_mutex);
ret = ROMIO_PREFIX(MPI_File_get_info) (data->romio_fh, &ompi_info);
ret = ROMIO_PREFIX(MPI_File_get_info) (data->romio_fh, info_used);
OPAL_THREAD_UNLOCK (&mca_io_romio321_mutex);

opal_info_dup (&(ompi_info->super), info_used);
ompi_info_free(&ompi_info);
return ret;
}

Expand Down
4 changes: 3 additions & 1 deletion ompi/mca/io/romio321/src/io_romio321_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* All rights reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2017-2019 IBM Corporation. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -50,6 +50,8 @@ mca_io_base_module_2_0_0_t mca_io_romio321_module = {
mca_io_romio321_file_preallocate,
mca_io_romio321_file_get_size,
mca_io_romio321_file_get_amode,
mca_io_romio321_file_set_info,
mca_io_romio321_file_get_info,
mca_io_romio321_file_set_view,
mca_io_romio321_file_get_view,

Expand Down
20 changes: 19 additions & 1 deletion ompi/mpi/c/file_get_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -53,6 +53,24 @@ int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
}
}

// Some components we're still letting handle info internally, eg romio321.
// Components that want to handle it themselves will fill in the get/set
// info function pointers, components that don't will use NULL.
if (fh->f_io_selected_module.v2_0_0.io_module_file_get_info != NULL) {
int rc;
switch (fh->f_io_version) {
case MCA_IO_BASE_V_2_0_0:
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_get_info(fh, info_used);
break;

default:
rc = MPI_ERR_INTERN;
break;
}
OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME);
}

if (NULL == fh->super.s_info) {
/*
* Setup any defaults if MPI_Win_set_info was never called
Expand Down
20 changes: 19 additions & 1 deletion ompi/mpi/c/file_set_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -62,6 +62,24 @@ int MPI_File_set_info(MPI_File fh, MPI_Info info)

OPAL_CR_ENTER_LIBRARY();

// Some components we're still letting handle info internally, eg romio321.
// Components that want to handle it themselves will fill in the get/set
// info function pointers, components that don't will use NULL.
if (fh->f_io_selected_module.v2_0_0.io_module_file_set_info != NULL) {
int rc;
switch (fh->f_io_version) {
case MCA_IO_BASE_V_2_0_0:
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_set_info(fh, info);
break;

default:
rc = MPI_ERR_INTERN;
break;
}
OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME);
}

ret = opal_infosubscribe_change_info(&fh->super, &info->super);

OMPI_ERRHANDLER_RETURN(ret, fh, ret, FUNC_NAME);
Expand Down