it is ok to not have a sharedfp component selected, as long as no
sharedfp functionality is being used. Return an error however if no sharedfp component is selected and the applications calls a file_read/write_shared function. This commit was SVN r32718.
Этот коммит содержится в:
родитель
597177cd8b
Коммит
dc05b709a7
@ -22,6 +22,7 @@
|
||||
#include "ompi/communicator/communicator.h"
|
||||
#include "ompi/info/info.h"
|
||||
#include "ompi/file/file.h"
|
||||
#include "ompi/mca/io/base/base.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/fs/base/base.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
@ -159,8 +160,13 @@ ompio_io_ompio_file_open (ompi_communicator_t *comm,
|
||||
ompio_fh->f_sharedfp_data = NULL; /*data*/
|
||||
|
||||
if (OMPI_SUCCESS != (ret = mca_sharedfp_base_file_select (ompio_fh, NULL))) {
|
||||
opal_output(1, "mca_sharedfp_base_file_select() failed\n");
|
||||
goto fn_fail;
|
||||
opal_output ( ompi_io_base_framework.framework_output,
|
||||
"mca_sharedfp_base_file_select() failed\n");
|
||||
ompio_fh->f_sharedfp = NULL; /*module*/
|
||||
/* Its ok to not have a shared file pointer module as long as the shared file
|
||||
** pointer operations are not used. However, the first call to any file_read/write_shared
|
||||
** function will return an error code.
|
||||
*/
|
||||
}
|
||||
|
||||
/*Determine topology information if set*/
|
||||
@ -195,7 +201,8 @@ ompio_io_ompio_file_open (ompi_communicator_t *comm,
|
||||
** For this, the first operation has to be collective which we can
|
||||
** not guarantuee outside of the MPI_File_open operation.
|
||||
*/
|
||||
if ( true == use_sharedfp &&
|
||||
if ( NULL != ompio_fh->f_sharedfp &&
|
||||
true == use_sharedfp &&
|
||||
(!mca_io_ompio_sharedfp_lazy_open ||
|
||||
!strcmp (ompio_fh->f_sharedfp_component->mca_component_name,
|
||||
"addproc") )) {
|
||||
|
@ -431,6 +431,10 @@ int mca_io_ompio_file_read_shared (ompi_file_t *fp,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = (mca_sharedfp_base_module_t *)(fh->f_sharedfp);
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for the given communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_read(fh,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
@ -452,6 +456,10 @@ int mca_io_ompio_file_iread_shared (ompi_file_t *fh,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = (mca_sharedfp_base_module_t *)(ompio_fh->f_sharedfp);
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for the given communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_iread(ompio_fh,buf,count,datatype,request);
|
||||
|
||||
return ret;
|
||||
@ -473,6 +481,10 @@ int mca_io_ompio_file_read_ordered (ompi_file_t *fh,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = (mca_sharedfp_base_module_t *)(ompio_fh->f_sharedfp);
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for the given communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_read_ordered(ompio_fh,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
@ -493,6 +505,10 @@ int mca_io_ompio_file_read_ordered_begin (ompi_file_t *fh,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = ompio_fh->f_sharedfp;
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for the given communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_read_ordered_begin(ompio_fh,buf,count,datatype);
|
||||
|
||||
return ret;
|
||||
@ -512,6 +528,10 @@ int mca_io_ompio_file_read_ordered_end (ompi_file_t *fh,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = ompio_fh->f_sharedfp;
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for the given communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_read_ordered_end(ompio_fh,buf,status);
|
||||
|
||||
return ret;
|
||||
|
@ -543,6 +543,10 @@ int mca_io_ompio_file_write_shared (ompi_file_t *fp,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = fh->f_sharedfp;
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for this communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_write(fh,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
@ -564,6 +568,10 @@ int mca_io_ompio_file_iwrite_shared (ompi_file_t *fp,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = fh->f_sharedfp;
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for this communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_iwrite(fh,buf,count,datatype,request);
|
||||
|
||||
return ret;
|
||||
@ -585,6 +593,10 @@ int mca_io_ompio_file_write_ordered (ompi_file_t *fp,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = fh->f_sharedfp;
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0,"No shared file pointer component found for this communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_write_ordered(fh,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
@ -605,6 +617,10 @@ int mca_io_ompio_file_write_ordered_begin (ompi_file_t *fp,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = fh->f_sharedfp;
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for this communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_write_ordered_begin(fh,buf,count,datatype);
|
||||
|
||||
return ret;
|
||||
@ -624,6 +640,10 @@ int mca_io_ompio_file_write_ordered_end (ompi_file_t *fp,
|
||||
|
||||
/*get the shared fp module associated with this file*/
|
||||
shared_fp_base_module = fh->f_sharedfp;
|
||||
if ( NULL == shared_fp_base_module ){
|
||||
opal_output(0, "No shared file pointer component found for this communicator. Can not execute\n");
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
ret = shared_fp_base_module->sharedfp_write_ordered_end(fh,buf,status);
|
||||
|
||||
return ret;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user