Merge pull request #823 from edgargabriel/topic/sharedfp-fview-fix
Topic/sharedfp fview fix
Этот коммит содержится в:
Коммит
b8c6466741
@ -106,7 +106,7 @@ int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (NULL != fh) {
|
if (NULL != fh) {
|
||||||
ompi_datatype_t *types[2], *default_file_view;
|
ompi_datatype_t *types[2];
|
||||||
int blocklen[2] = {1, 1};
|
int blocklen[2] = {1, 1};
|
||||||
OPAL_PTRDIFF_TYPE d[2], base;
|
OPAL_PTRDIFF_TYPE d[2], base;
|
||||||
int i;
|
int i;
|
||||||
@ -132,27 +132,21 @@ int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh)
|
|||||||
fh->f_init_num_aggrs = -1;
|
fh->f_init_num_aggrs = -1;
|
||||||
fh->f_init_aggr_list = NULL;
|
fh->f_init_aggr_list = NULL;
|
||||||
|
|
||||||
ompi_datatype_create_contiguous(MCA_IO_DEFAULT_FILE_VIEW_SIZE,
|
|
||||||
&ompi_mpi_byte.dt,
|
|
||||||
&default_file_view);
|
|
||||||
ompi_datatype_commit (&default_file_view);
|
|
||||||
|
|
||||||
fh->f_etype = &ompi_mpi_byte.dt;
|
|
||||||
fh->f_filetype = default_file_view;
|
|
||||||
ompi_datatype_duplicate ( &ompi_mpi_byte.dt, &fh->f_orig_filetype );
|
|
||||||
|
|
||||||
|
|
||||||
/* Default file View */
|
/* Default file View */
|
||||||
fh->f_iov_type = MPI_DATATYPE_NULL;
|
fh->f_iov_type = MPI_DATATYPE_NULL;
|
||||||
fh->f_stripe_size = mca_io_ompio_bytes_per_agg;
|
fh->f_stripe_size = mca_io_ompio_bytes_per_agg;
|
||||||
/*Decoded iovec of the file-view*/
|
/*Decoded iovec of the file-view*/
|
||||||
fh->f_decoded_iov = NULL;
|
fh->f_decoded_iov = NULL;
|
||||||
|
fh->f_etype = NULL;
|
||||||
|
fh->f_filetype = NULL;
|
||||||
|
fh->f_orig_filetype = NULL;
|
||||||
|
|
||||||
mca_io_ompio_set_view_internal(fh,
|
mca_io_ompio_set_view_internal(fh,
|
||||||
0,
|
0,
|
||||||
&ompi_mpi_byte.dt,
|
&ompi_mpi_byte.dt,
|
||||||
default_file_view,
|
&ompi_mpi_byte.dt,
|
||||||
"native",
|
"native",
|
||||||
fh->f_info);
|
fh->f_info);
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,13 +54,13 @@ mca_io_ompio_file_open (ompi_communicator_t *comm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*save pointer back to the file_t structure */
|
||||||
|
data->ompio_fh.f_fh = fh;
|
||||||
|
|
||||||
ret = ompio_io_ompio_file_open(comm,filename,amode,info,&data->ompio_fh,use_sharedfp);
|
ret = ompio_io_ompio_file_open(comm,filename,amode,info,&data->ompio_fh,use_sharedfp);
|
||||||
|
|
||||||
if ( OMPI_SUCCESS == ret ) {
|
if ( OMPI_SUCCESS == ret ) {
|
||||||
fh->f_flags |= OMPIO_FILE_IS_OPEN;
|
fh->f_flags |= OMPIO_FILE_IS_OPEN;
|
||||||
/*save pointer back to the file_t structure */
|
|
||||||
data->ompio_fh.f_fh = fh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "ompi/mca/fs/base/base.h"
|
#include "ompi/mca/fs/base/base.h"
|
||||||
#include "ompi/mca/fcoll/fcoll.h"
|
#include "ompi/mca/fcoll/fcoll.h"
|
||||||
#include "ompi/mca/fcoll/base/base.h"
|
#include "ompi/mca/fcoll/base/base.h"
|
||||||
|
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||||
#include "ompi/mca/pml/pml.h"
|
#include "ompi/mca/pml/pml.h"
|
||||||
#include "opal/datatype/opal_convertor.h"
|
#include "opal/datatype/opal_convertor.h"
|
||||||
#include "ompi/datatype/ompi_datatype.h"
|
#include "ompi/datatype/ompi_datatype.h"
|
||||||
@ -53,98 +54,19 @@ int mca_io_ompio_set_view_internal(mca_io_ompio_file_t *fh,
|
|||||||
int num_groups = 0;
|
int num_groups = 0;
|
||||||
contg *contg_groups;
|
contg *contg_groups;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MPI_Aint lb,ub;
|
|
||||||
|
|
||||||
fh->f_iov_count = 0;
|
|
||||||
fh->f_disp = disp;
|
|
||||||
fh->f_offset = disp;
|
|
||||||
fh->f_total_bytes = 0;
|
|
||||||
|
|
||||||
ompi_io_ompio_decode_datatype (fh,
|
|
||||||
filetype,
|
|
||||||
1,
|
|
||||||
NULL,
|
|
||||||
&max_data,
|
|
||||||
&fh->f_decoded_iov,
|
|
||||||
&fh->f_iov_count);
|
|
||||||
|
|
||||||
opal_datatype_get_extent(&filetype->super, &lb, &fh->f_view_extent);
|
|
||||||
opal_datatype_type_ub (&filetype->super, &ub);
|
|
||||||
opal_datatype_type_size (&etype->super, &fh->f_etype_size);
|
|
||||||
opal_datatype_type_size (&filetype->super, &fh->f_view_size);
|
|
||||||
ompi_datatype_duplicate (etype, &fh->f_etype);
|
|
||||||
ompi_datatype_duplicate (filetype, &fh->f_filetype);
|
|
||||||
|
|
||||||
fh->f_cc_size = get_contiguous_chunk_size (fh);
|
|
||||||
|
|
||||||
if (opal_datatype_is_contiguous_memory_layout(&etype->super,1)) {
|
|
||||||
if (opal_datatype_is_contiguous_memory_layout(&filetype->super,1) &&
|
|
||||||
fh->f_view_extent == (OPAL_PTRDIFF_TYPE)fh->f_view_size ) {
|
|
||||||
fh->f_flags |= OMPIO_CONTIGUOUS_FVIEW;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
contg_groups = (contg*) calloc ( 1, fh->f_size * sizeof(contg));
|
|
||||||
if (NULL == contg_groups) {
|
|
||||||
opal_output (1, "OUT OF MEMORY\n");
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
for( i = 0; i < fh->f_size; i++){
|
|
||||||
contg_groups[i].procs_in_contg_group = (int*)calloc (1,fh->f_size * sizeof(int));
|
|
||||||
if(NULL == contg_groups[i].procs_in_contg_group){
|
|
||||||
int j;
|
|
||||||
opal_output (1, "OUT OF MEMORY\n");
|
|
||||||
for(j=0; j<i; j++) {
|
|
||||||
free(contg_groups[j].procs_in_contg_group);
|
|
||||||
}
|
|
||||||
free(contg_groups);
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( OMPI_SUCCESS != mca_io_ompio_fview_based_grouping(fh,
|
|
||||||
&num_groups,
|
|
||||||
contg_groups)){
|
|
||||||
opal_output(1, "mca_io_ompio_fview_based_grouping() failed\n");
|
|
||||||
free(contg_groups);
|
|
||||||
return OMPI_ERROR;
|
|
||||||
}
|
|
||||||
if( !( (fh->f_comm->c_flags & OMPI_COMM_CART) &&
|
|
||||||
(num_groups == 1 || num_groups == fh->f_size)) ) {
|
|
||||||
mca_io_ompio_finalize_initial_grouping(fh,
|
|
||||||
num_groups,
|
|
||||||
contg_groups);
|
|
||||||
}
|
|
||||||
for( i = 0; i < fh->f_size; i++){
|
|
||||||
free(contg_groups[i].procs_in_contg_group);
|
|
||||||
}
|
|
||||||
free(contg_groups);
|
|
||||||
|
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mca_io_ompio_file_set_view (ompi_file_t *fp,
|
|
||||||
OMPI_MPI_OFFSET_TYPE disp,
|
|
||||||
ompi_datatype_t *etype,
|
|
||||||
ompi_datatype_t *filetype,
|
|
||||||
char *datarep,
|
|
||||||
ompi_info_t *info)
|
|
||||||
{
|
|
||||||
mca_io_ompio_data_t *data;
|
|
||||||
mca_io_ompio_file_t *fh;
|
|
||||||
size_t ftype_size;
|
size_t ftype_size;
|
||||||
OPAL_PTRDIFF_TYPE ftype_extent, lb;
|
OPAL_PTRDIFF_TYPE ftype_extent, lb, ub;
|
||||||
|
ompi_datatype_t *newfiletype;
|
||||||
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
|
|
||||||
fh = &data->ompio_fh;
|
|
||||||
|
|
||||||
ompi_datatype_destroy (&fh->f_etype);
|
|
||||||
ompi_datatype_destroy (&fh->f_filetype);
|
|
||||||
ompi_datatype_destroy (&fh->f_orig_filetype);
|
|
||||||
|
|
||||||
|
if ( NULL != fh->f_etype ) {
|
||||||
|
ompi_datatype_destroy (&fh->f_etype);
|
||||||
|
}
|
||||||
|
if ( NULL != fh->f_filetype ) {
|
||||||
|
ompi_datatype_destroy (&fh->f_filetype);
|
||||||
|
}
|
||||||
|
if ( NULL != fh->f_orig_filetype ) {
|
||||||
|
ompi_datatype_destroy (&fh->f_orig_filetype);
|
||||||
|
}
|
||||||
if (NULL != fh->f_decoded_iov) {
|
if (NULL != fh->f_decoded_iov) {
|
||||||
free (fh->f_decoded_iov);
|
free (fh->f_decoded_iov);
|
||||||
fh->f_decoded_iov = NULL;
|
fh->f_decoded_iov = NULL;
|
||||||
@ -165,33 +87,93 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
|
|||||||
opal_datatype_get_extent(&filetype->super, &lb, &ftype_extent);
|
opal_datatype_get_extent(&filetype->super, &lb, &ftype_extent);
|
||||||
opal_datatype_type_size (&filetype->super, &ftype_size);
|
opal_datatype_type_size (&filetype->super, &ftype_size);
|
||||||
|
|
||||||
if ( etype == filetype &&
|
if ( etype == filetype &&
|
||||||
ompi_datatype_is_predefined (filetype ) &&
|
ompi_datatype_is_predefined (filetype ) &&
|
||||||
ftype_extent == (OPAL_PTRDIFF_TYPE)ftype_size ){
|
ftype_extent == (OPAL_PTRDIFF_TYPE)ftype_size ){
|
||||||
ompi_datatype_t *newfiletype;
|
|
||||||
ompi_datatype_create_contiguous(MCA_IO_DEFAULT_FILE_VIEW_SIZE,
|
ompi_datatype_create_contiguous(MCA_IO_DEFAULT_FILE_VIEW_SIZE,
|
||||||
&ompi_mpi_byte.dt,
|
&ompi_mpi_byte.dt,
|
||||||
&newfiletype);
|
&newfiletype);
|
||||||
ompi_datatype_commit (&newfiletype);
|
ompi_datatype_commit (&newfiletype);
|
||||||
mca_io_ompio_set_view_internal (fh,
|
|
||||||
disp,
|
|
||||||
etype,
|
|
||||||
newfiletype,
|
|
||||||
datarep,
|
|
||||||
info);
|
|
||||||
ompi_datatype_destroy ( &newfiletype );
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mca_io_ompio_set_view_internal (fh,
|
newfiletype = filetype;
|
||||||
disp,
|
}
|
||||||
etype,
|
|
||||||
filetype,
|
|
||||||
datarep,
|
|
||||||
info);
|
fh->f_iov_count = 0;
|
||||||
|
fh->f_disp = disp;
|
||||||
|
fh->f_offset = disp;
|
||||||
|
fh->f_total_bytes = 0;
|
||||||
|
|
||||||
|
ompi_io_ompio_decode_datatype (fh,
|
||||||
|
newfiletype,
|
||||||
|
1,
|
||||||
|
NULL,
|
||||||
|
&max_data,
|
||||||
|
&fh->f_decoded_iov,
|
||||||
|
&fh->f_iov_count);
|
||||||
|
|
||||||
|
opal_datatype_get_extent(&newfiletype->super, &lb, &fh->f_view_extent);
|
||||||
|
opal_datatype_type_ub (&newfiletype->super, &ub);
|
||||||
|
opal_datatype_type_size (&etype->super, &fh->f_etype_size);
|
||||||
|
opal_datatype_type_size (&newfiletype->super, &fh->f_view_size);
|
||||||
|
ompi_datatype_duplicate (etype, &fh->f_etype);
|
||||||
|
ompi_datatype_duplicate (newfiletype, &fh->f_filetype);
|
||||||
|
|
||||||
|
fh->f_cc_size = get_contiguous_chunk_size (fh);
|
||||||
|
|
||||||
|
if (opal_datatype_is_contiguous_memory_layout(&etype->super,1)) {
|
||||||
|
if (opal_datatype_is_contiguous_memory_layout(&filetype->super,1) &&
|
||||||
|
fh->f_view_extent == (OPAL_PTRDIFF_TYPE)fh->f_view_size ) {
|
||||||
|
fh->f_flags |= OMPIO_CONTIGUOUS_FVIEW;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OMPI_SUCCESS != mca_fcoll_base_file_select (&data->ompio_fh,
|
contg_groups = (contg*) calloc ( 1, fh->f_size * sizeof(contg));
|
||||||
NULL)) {
|
if (NULL == contg_groups) {
|
||||||
|
opal_output (1, "OUT OF MEMORY\n");
|
||||||
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
for( i = 0; i < fh->f_size; i++){
|
||||||
|
contg_groups[i].procs_in_contg_group = (int*)calloc (1,fh->f_size * sizeof(int));
|
||||||
|
if(NULL == contg_groups[i].procs_in_contg_group){
|
||||||
|
int j;
|
||||||
|
opal_output (1, "OUT OF MEMORY\n");
|
||||||
|
for(j=0; j<i; j++) {
|
||||||
|
free(contg_groups[j].procs_in_contg_group);
|
||||||
|
}
|
||||||
|
free(contg_groups);
|
||||||
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( OMPI_SUCCESS != mca_io_ompio_fview_based_grouping(fh,
|
||||||
|
&num_groups,
|
||||||
|
contg_groups)){
|
||||||
|
opal_output(1, "mca_io_ompio_fview_based_grouping() failed\n");
|
||||||
|
free(contg_groups);
|
||||||
|
return OMPI_ERROR;
|
||||||
|
}
|
||||||
|
if( !( (fh->f_comm->c_flags & OMPI_COMM_CART) &&
|
||||||
|
(num_groups == 1 || num_groups == fh->f_size)) ) {
|
||||||
|
mca_io_ompio_finalize_initial_grouping(fh,
|
||||||
|
num_groups,
|
||||||
|
contg_groups);
|
||||||
|
}
|
||||||
|
for( i = 0; i < fh->f_size; i++){
|
||||||
|
free(contg_groups[i].procs_in_contg_group);
|
||||||
|
}
|
||||||
|
free(contg_groups);
|
||||||
|
|
||||||
|
if ( etype == filetype &&
|
||||||
|
ompi_datatype_is_predefined (filetype ) &&
|
||||||
|
ftype_extent == (OPAL_PTRDIFF_TYPE)ftype_size ){
|
||||||
|
ompi_datatype_destroy ( &newfiletype );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (OMPI_SUCCESS != mca_fcoll_base_file_select (fh, NULL)) {
|
||||||
opal_output(1, "mca_fcoll_base_file_select() failed\n");
|
opal_output(1, "mca_fcoll_base_file_select() failed\n");
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
@ -199,6 +181,34 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
|
|||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mca_io_ompio_file_set_view (ompi_file_t *fp,
|
||||||
|
OMPI_MPI_OFFSET_TYPE disp,
|
||||||
|
ompi_datatype_t *etype,
|
||||||
|
ompi_datatype_t *filetype,
|
||||||
|
char *datarep,
|
||||||
|
ompi_info_t *info)
|
||||||
|
{
|
||||||
|
int ret=OMPI_SUCCESS;
|
||||||
|
mca_io_ompio_data_t *data;
|
||||||
|
mca_io_ompio_file_t *fh;
|
||||||
|
mca_io_ompio_file_t *sh;
|
||||||
|
|
||||||
|
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
|
||||||
|
|
||||||
|
/* we need to call the internal file set view twice: once for the individual
|
||||||
|
file pointer, once for the shared file pointer (if it is existent)
|
||||||
|
*/
|
||||||
|
fh = &data->ompio_fh;
|
||||||
|
ret = mca_io_ompio_set_view_internal(fh, disp, etype, filetype, datarep, info);
|
||||||
|
|
||||||
|
if ( NULL != fh->f_sharedfp_data) {
|
||||||
|
sh = ((struct mca_sharedfp_base_data_t *)fh->f_sharedfp_data)->sharedfh;
|
||||||
|
ret = mca_io_ompio_set_view_internal(sh, disp, etype, filetype, datarep, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int mca_io_ompio_file_get_view (struct ompi_file_t *fp,
|
int mca_io_ompio_file_get_view (struct ompi_file_t *fp,
|
||||||
OMPI_MPI_OFFSET_TYPE *disp,
|
OMPI_MPI_OFFSET_TYPE *disp,
|
||||||
struct ompi_datatype_t **etype,
|
struct ompi_datatype_t **etype,
|
||||||
|
@ -40,9 +40,11 @@ int mca_sharedfp_addproc_file_open (struct ompi_communicator_t *comm,
|
|||||||
int ret = OMPI_SUCCESS, err;
|
int ret = OMPI_SUCCESS, err;
|
||||||
int rank;
|
int rank;
|
||||||
struct mca_sharedfp_base_data_t* sh;
|
struct mca_sharedfp_base_data_t* sh;
|
||||||
mca_io_ompio_file_t * shfileHandle;
|
mca_io_ompio_file_t * shfileHandle, *ompio_fh;
|
||||||
MPI_Comm newInterComm;
|
MPI_Comm newInterComm;
|
||||||
struct mca_sharedfp_addproc_data * addproc_data = NULL;
|
struct mca_sharedfp_addproc_data * addproc_data = NULL;
|
||||||
|
mca_io_ompio_data_t *data;
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------*/
|
/*-------------------------------------------------*/
|
||||||
/*Open the same file again without shared file pointer*/
|
/*Open the same file again without shared file pointer*/
|
||||||
@ -53,6 +55,16 @@ int mca_sharedfp_addproc_file_open (struct ompi_communicator_t *comm,
|
|||||||
opal_output(0, "mca_sharedfp_addproc_file_open: Error during file open\n");
|
opal_output(0, "mca_sharedfp_addproc_file_open: Error during file open\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
shfileHandle->f_fh = fh->f_fh;
|
||||||
|
data = (mca_io_ompio_data_t *) fh->f_fh->f_io_selected_data;
|
||||||
|
ompio_fh = &data->ompio_fh;
|
||||||
|
|
||||||
|
err = mca_io_ompio_set_view_internal (shfileHandle,
|
||||||
|
ompio_fh->f_disp,
|
||||||
|
ompio_fh->f_etype,
|
||||||
|
ompio_fh->f_orig_filetype,
|
||||||
|
ompio_fh->f_datarep,
|
||||||
|
MPI_INFO_NULL);
|
||||||
|
|
||||||
/*Memory is allocated here for the sh structure*/
|
/*Memory is allocated here for the sh structure*/
|
||||||
if ( mca_sharedfp_addproc_verbose ) {
|
if ( mca_sharedfp_addproc_verbose ) {
|
||||||
|
@ -58,6 +58,8 @@ int mca_sharedfp_addproc_iread(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request to the additional process for the offset*/
|
/*Request to the additional process for the offset*/
|
||||||
ret = mca_sharedfp_addproc_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_addproc_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if( OMPI_SUCCESS == ret ){
|
if( OMPI_SUCCESS == ret ){
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -170,6 +172,7 @@ int mca_sharedfp_addproc_read_ordered_begin(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -56,6 +56,8 @@ int mca_sharedfp_addproc_iwrite(mca_io_ompio_file_t *fh,
|
|||||||
}
|
}
|
||||||
/* Request the offset to write bytesRequested bytes */
|
/* Request the offset to write bytesRequested bytes */
|
||||||
ret = mca_sharedfp_addproc_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_addproc_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( OMPI_SUCCESS == ret ) {
|
if ( OMPI_SUCCESS == ret ) {
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -166,6 +168,7 @@ int mca_sharedfp_addproc_write_ordered_begin(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -54,6 +54,8 @@ int mca_sharedfp_addproc_read ( mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request to the additional process for the offset*/
|
/*Request to the additional process for the offset*/
|
||||||
ret = mca_sharedfp_addproc_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_addproc_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if( OMPI_SUCCESS == ret ){
|
if( OMPI_SUCCESS == ret ){
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -162,6 +164,7 @@ int mca_sharedfp_addproc_read_ordered (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -58,6 +58,7 @@ int mca_sharedfp_addproc_write (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request the offset to write bytesRequested bytes*/
|
/*Request the offset to write bytesRequested bytes*/
|
||||||
ret = mca_sharedfp_addproc_request_position( sh, bytesRequested, &offset);
|
ret = mca_sharedfp_addproc_request_position( sh, bytesRequested, &offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
if ( OMPI_SUCCESS == ret ) {
|
if ( OMPI_SUCCESS == ret ) {
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -163,6 +164,7 @@ int mca_sharedfp_addproc_write_ordered (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_addproc_verbose ){
|
if ( mca_sharedfp_addproc_verbose ){
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -44,7 +44,8 @@ int mca_sharedfp_lockedfile_file_open (struct ompi_communicator_t *comm,
|
|||||||
int handle, rank;
|
int handle, rank;
|
||||||
struct mca_sharedfp_lockedfile_data * module_data = NULL;
|
struct mca_sharedfp_lockedfile_data * module_data = NULL;
|
||||||
struct mca_sharedfp_base_data_t* sh;
|
struct mca_sharedfp_base_data_t* sh;
|
||||||
mca_io_ompio_file_t * shfileHandle;
|
mca_io_ompio_file_t * shfileHandle, *ompio_fh;
|
||||||
|
mca_io_ompio_data_t *data;
|
||||||
|
|
||||||
/*------------------------------------------------------------*/
|
/*------------------------------------------------------------*/
|
||||||
/*Open the same file again without shared file pointer support*/
|
/*Open the same file again without shared file pointer support*/
|
||||||
@ -56,6 +57,16 @@ int mca_sharedfp_lockedfile_file_open (struct ompi_communicator_t *comm,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
shfileHandle->f_fh = fh->f_fh;
|
shfileHandle->f_fh = fh->f_fh;
|
||||||
|
data = (mca_io_ompio_data_t *) fh->f_fh->f_io_selected_data;
|
||||||
|
ompio_fh = &data->ompio_fh;
|
||||||
|
|
||||||
|
err = mca_io_ompio_set_view_internal (shfileHandle,
|
||||||
|
ompio_fh->f_disp,
|
||||||
|
ompio_fh->f_etype,
|
||||||
|
ompio_fh->f_orig_filetype,
|
||||||
|
ompio_fh->f_datarep,
|
||||||
|
MPI_INFO_NULL);
|
||||||
|
|
||||||
|
|
||||||
/*Memory is allocated here for the sh structure*/
|
/*Memory is allocated here for the sh structure*/
|
||||||
sh = (struct mca_sharedfp_base_data_t*)malloc(sizeof(struct mca_sharedfp_base_data_t));
|
sh = (struct mca_sharedfp_base_data_t*)malloc(sizeof(struct mca_sharedfp_base_data_t));
|
||||||
|
@ -73,6 +73,8 @@ int mca_sharedfp_lockedfile_iread(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request the offset to write bytesRequested bytes*/
|
/*Request the offset to write bytesRequested bytes*/
|
||||||
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( -1 != ret ) {
|
if ( -1 != ret ) {
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -196,6 +198,7 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset*/
|
/*Each process now has its own individual offset*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -71,6 +71,8 @@ int mca_sharedfp_lockedfile_iwrite(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request the offset to write bytesRequested bytes*/
|
/*Request the offset to write bytesRequested bytes*/
|
||||||
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( -1 != ret) {
|
if ( -1 != ret) {
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -193,6 +195,7 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset*/
|
/*Each process now has its own individual offset*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -68,6 +68,8 @@ int mca_sharedfp_lockedfile_read ( mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request the offset to write bytesRequested bytes*/
|
/*Request the offset to write bytesRequested bytes*/
|
||||||
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_lockedfile_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if (-1 != ret ) {
|
if (-1 != ret ) {
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -182,6 +184,7 @@ int mca_sharedfp_lockedfile_read_ordered (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -70,6 +70,8 @@ int mca_sharedfp_lockedfile_write (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/* Request the offset to write bytesRequested bytes */
|
/* Request the offset to write bytesRequested bytes */
|
||||||
ret = mca_sharedfp_lockedfile_request_position ( sh, bytesRequested, &offset);
|
ret = mca_sharedfp_lockedfile_request_position ( sh, bytesRequested, &offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if (-1 != ret ) {
|
if (-1 != ret ) {
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -187,6 +189,7 @@ int mca_sharedfp_lockedfile_write_ordered (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset*/
|
/*Each process now has its own individual offset*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_lockedfile_verbose ) {
|
if ( mca_sharedfp_lockedfile_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
@ -52,11 +52,12 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
|
|||||||
int err = OMPI_SUCCESS;
|
int err = OMPI_SUCCESS;
|
||||||
struct mca_sharedfp_base_data_t* sh;
|
struct mca_sharedfp_base_data_t* sh;
|
||||||
struct mca_sharedfp_sm_data * sm_data = NULL;
|
struct mca_sharedfp_sm_data * sm_data = NULL;
|
||||||
mca_io_ompio_file_t * shfileHandle;
|
mca_io_ompio_file_t * shfileHandle, *ompio_fh;
|
||||||
char * filename_basename;
|
char * filename_basename;
|
||||||
char * sm_filename;
|
char * sm_filename;
|
||||||
struct mca_sharedfp_sm_offset * sm_offset_ptr;
|
struct mca_sharedfp_sm_offset * sm_offset_ptr;
|
||||||
struct mca_sharedfp_sm_offset sm_offset;
|
struct mca_sharedfp_sm_offset sm_offset;
|
||||||
|
mca_io_ompio_data_t *data;
|
||||||
int sm_fd;
|
int sm_fd;
|
||||||
int rank;
|
int rank;
|
||||||
|
|
||||||
@ -75,6 +76,15 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
shfileHandle->f_fh = fh->f_fh;
|
shfileHandle->f_fh = fh->f_fh;
|
||||||
|
data = (mca_io_ompio_data_t *) fh->f_fh->f_io_selected_data;
|
||||||
|
ompio_fh = &data->ompio_fh;
|
||||||
|
|
||||||
|
err = mca_io_ompio_set_view_internal (shfileHandle,
|
||||||
|
ompio_fh->f_disp,
|
||||||
|
ompio_fh->f_etype,
|
||||||
|
ompio_fh->f_orig_filetype,
|
||||||
|
ompio_fh->f_datarep,
|
||||||
|
MPI_INFO_NULL);
|
||||||
|
|
||||||
/*Memory is allocated here for the sh structure*/
|
/*Memory is allocated here for the sh structure*/
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
|
@ -70,6 +70,7 @@ int mca_sharedfp_sm_iread(mca_io_ompio_file_t *fh,
|
|||||||
}
|
}
|
||||||
/*Request the offset to write bytesRequested bytes*/
|
/*Request the offset to write bytesRequested bytes*/
|
||||||
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( -1 != ret ) {
|
if ( -1 != ret ) {
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
@ -193,6 +194,8 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
"mca_sharedfp_sm_read_ordered_begin: Offset returned is %lld\n",offset);
|
"mca_sharedfp_sm_read_ordered_begin: Offset returned is %lld\n",offset);
|
||||||
|
@ -70,8 +70,9 @@ int mca_sharedfp_sm_iwrite(mca_io_ompio_file_t *fh,
|
|||||||
}
|
}
|
||||||
/* Request the offset to write bytesRequested bytes */
|
/* Request the offset to write bytesRequested bytes */
|
||||||
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
if ( -1 != ret ) {
|
|
||||||
|
if ( -1 != ret ) {
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
"sharedfp_sm_iwrite: Offset received is %lld\n",offset);
|
"sharedfp_sm_iwrite: Offset received is %lld\n",offset);
|
||||||
@ -194,6 +195,8 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
"mca_sharedfp_sm_write_ordered_begin: Offset returned is %lld\n",offset);
|
"mca_sharedfp_sm_write_ordered_begin: Offset returned is %lld\n",offset);
|
||||||
|
@ -68,6 +68,7 @@ int mca_sharedfp_sm_read ( mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request the offset to write bytesRequested bytes*/
|
/*Request the offset to write bytesRequested bytes*/
|
||||||
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( -1 != ret ) {
|
if ( -1 != ret ) {
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
@ -186,6 +187,8 @@ int mca_sharedfp_sm_read_ordered (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Each process now has its own individual offset in recvBUFF*/
|
/*Each process now has its own individual offset in recvBUFF*/
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
"mca_sharedfp_sm_read_ordered: Offset returned is %lld\n",offset);
|
"mca_sharedfp_sm_read_ordered: Offset returned is %lld\n",offset);
|
||||||
|
@ -71,6 +71,7 @@ int mca_sharedfp_sm_write (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/*Request the offset to write bytesRequested bytes*/
|
/*Request the offset to write bytesRequested bytes*/
|
||||||
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
ret = mca_sharedfp_sm_request_position(sh,bytesRequested,&offset);
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
if ( -1 != ret ) {
|
if ( -1 != ret ) {
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
@ -192,6 +193,7 @@ int mca_sharedfp_sm_write_ordered (mca_io_ompio_file_t *fh,
|
|||||||
|
|
||||||
/* Each process now has its own individual offset */
|
/* Each process now has its own individual offset */
|
||||||
offset = offsetBuff - sendBuff;
|
offset = offsetBuff - sendBuff;
|
||||||
|
offset /= sh->sharedfh->f_etype_size;
|
||||||
|
|
||||||
if ( mca_sharedfp_sm_verbose ) {
|
if ( mca_sharedfp_sm_verbose ) {
|
||||||
opal_output(ompi_sharedfp_base_framework.framework_output,
|
opal_output(ompi_sharedfp_base_framework.framework_output,
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user