Skip to content

Commit c96ea38

Browse files
committed
make the selection logic for the directio component work.
1 parent 88db5e3 commit c96ea38

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

ompi/mca/fbtl/directio/fbtl_directio.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,16 @@ int mca_fbtl_directio_component_init_query(bool enable_progress_threads,
6262

6363
struct mca_fbtl_base_module_1_0_0_t *
6464
mca_fbtl_directio_component_file_query (mca_io_ompio_file_t *fh, int *priority) {
65-
*priority = mca_fbtl_directio_priority;
65+
int fd_direct;
66+
*priority = mca_fbtl_directio_priority;
6667

67-
if ( 0 != fh->f_fs_ptr &&
68-
PVFS2 != fh->f_fstype) {
69-
}
68+
memcpy (&fd_direct, &fh->f_fs_ptr, sizeof(int) );
69+
if ( 0 < fd_direct &&
70+
PVFS2 != fh->f_fstype) {
71+
*priority = 100;
72+
}
7073

71-
return &directio;
74+
return &directio;
7275
}
7376

7477
int mca_fbtl_directio_component_file_unquery (mca_io_ompio_file_t *file) {

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ ompio_io_ompio_file_open (ompi_communicator_t *comm,
169169
opal_output(1, "mca_fs_base_file_select() failed\n");
170170
goto fn_fail;
171171
}
172+
173+
ret = ompio_fh->f_fs->fs_file_open (comm,
174+
filename,
175+
amode,
176+
info,
177+
ompio_fh);
178+
179+
180+
181+
182+
if ( OMPI_SUCCESS != ret ) {
183+
ret = MPI_ERR_FILE;
184+
goto fn_fail;
185+
}
186+
187+
172188
if (OMPI_SUCCESS != (ret = mca_fbtl_base_file_select (ompio_fh,
173189
NULL))) {
174190
opal_output(1, "mca_fbtl_base_file_select() failed\n");
@@ -231,19 +247,6 @@ ompio_io_ompio_file_open (ompi_communicator_t *comm,
231247
}
232248
}
233249

234-
ret = ompio_fh->f_fs->fs_file_open (comm,
235-
filename,
236-
amode,
237-
info,
238-
ompio_fh);
239-
240-
241-
242-
243-
if ( OMPI_SUCCESS != ret ) {
244-
ret = MPI_ERR_FILE;
245-
goto fn_fail;
246-
}
247250

248251

249252
/* If file has been opened in the append mode, move the internal

0 commit comments

Comments
 (0)