Skip to content

Commit 9e19834

Browse files
committed
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 <[email protected]>
1 parent 802deb6 commit 9e19834

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

ompi/mca/io/ompio/io_ompio_component.c

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
13+
* Copyright (c) 2008-2017 University of Houston. All rights reserved.
1414
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* Copyright (c) 2015 Research Organization for Information Science
@@ -29,6 +29,7 @@
2929
#include "opal/threads/mutex.h"
3030
#include "opal/mca/base/base.h"
3131
#include "ompi/mca/io/io.h"
32+
#include "ompi/mca/fs/base/base.h"
3233
#include "io_ompio.h"
3334

3435
int mca_io_ompio_cycle_buffer_size = OMPIO_DEFAULT_CYCLE_BUF_SIZE;
@@ -257,8 +258,38 @@ file_query(struct ompi_file_t *file,
257258
int *priority)
258259
{
259260
mca_io_ompio_data_t *data;
261+
char *tmp;
262+
int rank;
263+
int is_lustre=0; //false
264+
265+
tmp = strchr (file->f_filename, ':');
266+
rank = ompi_comm_rank ( file->f_comm);
267+
if (!tmp) {
268+
if ( 0 == rank) {
269+
if (LUSTRE == mca_fs_base_get_fstype(file->f_filename)) {
270+
is_lustre = 1; //true
271+
}
272+
}
273+
274+
file->f_comm->c_coll->coll_bcast (&is_lustre,
275+
1,
276+
MPI_INT,
277+
0,
278+
file->f_comm,
279+
file->f_comm->c_coll->coll_bcast_module);
280+
}
281+
else {
282+
if (!strncasecmp(file->f_filename, "lustre:", 7) ) {
283+
is_lustre = 1;
284+
}
285+
}
260286

261-
*priority = priority_param;
287+
if (is_lustre) {
288+
*priority = 1;
289+
}
290+
else {
291+
*priority = priority_param;
292+
}
262293

263294
/* Allocate a space for this module to hang private data (e.g.,
264295
the OMPIO file handle) */

0 commit comments

Comments
 (0)