Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
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
6 changes: 3 additions & 3 deletions ompi/mca/fs/lustre/fs_lustre_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int mca_fs_lustre_priority = 20;
to 64KB. MCA parameter
Can be changed at
runtime also*/
int mca_fs_lustre_stripe_size = 1048576;
int mca_fs_lustre_stripe_size = 0;
int mca_fs_lustre_stripe_width = 0;
/*
* Instantiate the public struct with all of our public information
Expand Down Expand Up @@ -81,15 +81,15 @@ lustre_register(void)
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY, &mca_fs_lustre_priority);
mca_fs_lustre_stripe_size = 1048576;
mca_fs_lustre_stripe_size = 0;
(void) mca_base_component_var_register(&mca_fs_lustre_component.fsm_version,
"stripe_size", "stripe size of a file over lustre",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY, &mca_fs_lustre_stripe_size);
mca_fs_lustre_stripe_width = 0;
(void) mca_base_component_var_register(&mca_fs_lustre_component.fsm_version,
"stripe_width", "stripe width of a file over lustre",
"stripe_width", "stripe count of a file over lustre",
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY, &mca_fs_lustre_stripe_width);
Expand Down
38 changes: 31 additions & 7 deletions ompi/mca/fs/lustre/fs_lustre_file_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* 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) 2008-2015 University of Houston. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -50,6 +50,10 @@ mca_fs_lustre_file_open (struct ompi_communicator_t *comm,
int amode;
int old_mask, perm;
int rc;
int flag;
int fs_lustre_stripe_size = -1;
int fs_lustre_stripe_width = -1;
char char_stripe[MPI_MAX_INFO_KEY];

struct lov_user_md *lump=NULL;

Expand All @@ -74,13 +78,33 @@ mca_fs_lustre_file_open (struct ompi_communicator_t *comm,
if (access_mode & MPI_MODE_EXCL)
amode = amode | O_EXCL;

if ((mca_fs_lustre_stripe_size || mca_fs_lustre_stripe_width) &&

ompi_info_get (info, "stripe_size", MPI_MAX_INFO_VAL, char_stripe, &flag);
if ( flag ) {
sscanf ( char_stripe, "%d", &fs_lustre_stripe_size );
}

ompi_info_get (info, "stripe_width", MPI_MAX_INFO_VAL, char_stripe, &flag);
if ( flag ) {
sscanf ( char_stripe, "%d", &fs_lustre_stripe_width );
}

if (fs_lustre_stripe_size < 0) {
fs_lustre_stripe_size = mca_fs_lustre_stripe_size;
}

if (fs_lustre_stripe_width < 0) {
fs_lustre_stripe_width = mca_fs_lustre_stripe_width;
}


if ( (fs_lustre_stripe_size>0 || fs_lustre_stripe_width>0) &&
(amode&O_CREAT) && (amode&O_RDWR)) {
if (0 == fh->f_rank) {
llapi_file_create(filename,
mca_fs_lustre_stripe_size,
llapi_file_create(filename,
fs_lustre_stripe_size,
-1, /* MSC need to change that */
mca_fs_lustre_stripe_width,
fs_lustre_stripe_width,
0); /* MSC need to change that */

fh->fd = open(filename, O_CREAT | O_RDWR | O_LOV_DELAY_CREATE, perm);
Expand All @@ -106,13 +130,13 @@ mca_fs_lustre_file_open (struct ompi_communicator_t *comm,
else {
lump = (struct lov_user_md *) malloc (sizeof(struct lov_user_md));
if (NULL == lump ){
fprintf(stderr,"Cannot Allocate Lump for extracting stripe size\n");
fprintf(stderr,"Cannot allocate memory for extracting stripe size\n");
return OMPI_ERROR;
}
rc = llapi_file_get_stripe(filename, lump);
if (rc != 0) {
fprintf(stderr, "get_stripe failed: %d (%s)\n",errno, strerror(errno));
return -1;
return OMPI_ERROR;
}
fh->f_stripe_size = lump->lmm_stripe_size;
}
Expand Down