Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
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
56 changes: 54 additions & 2 deletions ompi/mca/io/ompio/io_ompio_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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-2016 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
Expand All @@ -29,8 +29,15 @@
#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"

#ifdef HAVE_SYS_STATFS_H
#include <sys/statfs.h> /* or <sys/vfs.h> */
#endif



int mca_io_ompio_cycle_buffer_size = -1;
int mca_io_ompio_bytes_per_agg = OMPIO_PREALLOC_MAX_BUF_SIZE;
int mca_io_ompio_num_aggregators = -1;
Expand Down Expand Up @@ -257,8 +264,53 @@ file_query(struct ompi_file_t *file,
int *priority)
{
mca_io_ompio_data_t *data;
int err;
char *dir;
struct statfs fsbuf;
char *tmp;
int rank;
int is_lustre=0; //false

tmp = strchr (file->f_filename, ':');
rank = ompi_comm_rank ( file->f_comm);
if (!tmp) {
if ( 0 == rank) {
do {
err = statfs (file->f_filename, &fsbuf);
} while (err && (errno == ESTALE));

if (err && (errno == ENOENT)) {
mca_fs_base_get_parent_dir (file->f_filename, &dir);
err = statfs (dir, &fsbuf);
free (dir);
}
#ifndef LL_SUPER_MAGIC
#define LL_SUPER_MAGIC 0x0BD00BD0
#endif
if (fsbuf.f_type == LL_SUPER_MAGIC) {
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 (!strncmp(file->f_filename, "lustre:", 7) ||
!strncmp(file->f_filename, "LUSTRE:", 7)) {
is_lustre = 1;
}
}

*priority = priority_param;
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) */
Expand Down