From 9e19834327017d72ec20bc8a5f0d3d11374a7aa8 Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Thu, 2 Mar 2017 10:30:11 -0600 Subject: [PATCH] io/ompio: adjust the priority of the OMPIO component on lustre this commit brings over the behavior from the 2.x series to master, mostly with the fork for the 3.x series in mind. Also, use strncasecmp instead of two strncmps Signed-off-by: Edgar Gabriel --- ompi/mca/io/ompio/io_ompio_component.c | 35 ++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/ompi/mca/io/ompio/io_ompio_component.c b/ompi/mca/io/ompio/io_ompio_component.c index bf89140cc0..6a63bce058 100644 --- a/ompi/mca/io/ompio/io_ompio_component.c +++ b/ompi/mca/io/ompio/io_ompio_component.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2008-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2017 University of Houston. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -29,6 +29,7 @@ #include "opal/threads/mutex.h" #include "opal/mca/base/base.h" #include "ompi/mca/io/io.h" +#include "ompi/mca/fs/base/base.h" #include "io_ompio.h" int mca_io_ompio_cycle_buffer_size = OMPIO_DEFAULT_CYCLE_BUF_SIZE; @@ -257,8 +258,38 @@ file_query(struct ompi_file_t *file, int *priority) { mca_io_ompio_data_t *data; + char *tmp; + int rank; + int is_lustre=0; //false - *priority = priority_param; + tmp = strchr (file->f_filename, ':'); + rank = ompi_comm_rank ( file->f_comm); + if (!tmp) { + if ( 0 == rank) { + if (LUSTRE == mca_fs_base_get_fstype(file->f_filename)) { + is_lustre = 1; //true + } + } + + file->f_comm->c_coll->coll_bcast (&is_lustre, + 1, + MPI_INT, + 0, + file->f_comm, + file->f_comm->c_coll->coll_bcast_module); + } + else { + if (!strncasecmp(file->f_filename, "lustre:", 7) ) { + is_lustre = 1; + } + } + + if (is_lustre) { + *priority = 1; + } + else { + *priority = priority_param; + } /* Allocate a space for this module to hang private data (e.g., the OMPIO file handle) */