1
1

MCA/FS: check communicator validity in query functions

It is needed because the fs components might be queried due to a MPI_File_delete call.
And in this case, we don't have a communicator value.

Signed-off-by: Gaëtan Bossu <gbossu@ddn.com>
Этот коммит содержится в:
Gaëtan Bossu 2018-07-04 18:27:08 +02:00
родитель 9a8797a6be
Коммит ac6f75e3d1
2 изменённых файлов: 23 добавлений и 15 удалений

Просмотреть файл

@ -12,6 +12,7 @@
* Copyright (c) 2008-2018 University of Houston. All rights reserved. * Copyright (c) 2008-2018 University of Houston. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 DataDirect Networks. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -89,15 +90,18 @@ mca_fs_lustre_component_file_query (ompio_file_t *fh, int *priority)
tmp = strchr (fh->f_filename, ':'); tmp = strchr (fh->f_filename, ':');
if (!tmp) { if (!tmp) {
if (OMPIO_ROOT == fh->f_rank) { /* The communicator might be NULL if we only want to delete the file */
if (OMPIO_ROOT == fh->f_rank || MPI_COMM_NULL == fh->f_comm) {
fh->f_fstype = mca_fs_base_get_fstype ( fh->f_filename ); fh->f_fstype = mca_fs_base_get_fstype ( fh->f_filename );
} }
fh->f_comm->c_coll->coll_bcast (&(fh->f_fstype), if (fh->f_comm != MPI_COMM_NULL) {
1, fh->f_comm->c_coll->coll_bcast (&(fh->f_fstype),
MPI_INT, 1,
OMPIO_ROOT, MPI_INT,
fh->f_comm, OMPIO_ROOT,
fh->f_comm->c_coll->coll_bcast_module); fh->f_comm,
fh->f_comm->c_coll->coll_bcast_module);
}
} }
else { else {
if (!strncmp(fh->f_filename, "lustre:", 7) || if (!strncmp(fh->f_filename, "lustre:", 7) ||

Просмотреть файл

@ -12,6 +12,7 @@
* Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2008-2016 University of Houston. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science * Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved. * and Technology (RIST). All rights reserved.
* Copyright (c) 2018 DataDirect Networks. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
@ -94,15 +95,18 @@ mca_fs_pvfs2_component_file_query (ompio_file_t *fh, int *priority)
tmp = strchr (fh->f_filename, ':'); tmp = strchr (fh->f_filename, ':');
if (!tmp) { if (!tmp) {
if (OMPIO_ROOT == fh->f_rank) { /* The communicator might be NULL if we only want to delete the file */
if (OMPIO_ROOT == fh->f_rank || MPI_COMM_NULL == fh->f_comm) {
fh->f_fstype = mca_fs_base_get_fstype ( fh->f_filename ); fh->f_fstype = mca_fs_base_get_fstype ( fh->f_filename );
} }
fh->f_comm->c_coll->coll_bcast (&(fh->f_fstype), if (fh->f_comm != MPI_COMM_NULL) {
1, fh->f_comm->c_coll->coll_bcast (&(fh->f_fstype),
MPI_INT, 1,
OMPIO_ROOT, MPI_INT,
fh->f_comm, OMPIO_ROOT,
fh->f_comm->c_coll->coll_bcast_module); fh->f_comm,
fh->f_comm->c_coll->coll_bcast_module);
}
} }
else { else {
if (!strncmp(fh->f_filename, "pvfs2:", 6) || if (!strncmp(fh->f_filename, "pvfs2:", 6) ||