moving the internal read/write functions to common/ompio
and update all fs/fcoll/sharedfp components to use these functions.
Этот коммит содержится в:
родитель
688710d408
Коммит
ccf76b7791
@ -23,7 +23,9 @@ headers = \
|
||||
common_ompio.h
|
||||
|
||||
sources = \
|
||||
common_ompio_print_queue.c
|
||||
common_ompio_print_queue.c \
|
||||
common_ompio_file_read.c \
|
||||
common_ompio_file_write.c
|
||||
|
||||
|
||||
# To simplify components that link to this library, we will *always*
|
||||
|
@ -24,4 +24,55 @@
|
||||
#include "ompi/mca/common/ompio/common_ompio_print_queue.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_write (mca_io_ompio_file_t *fh, const void *buf, int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_write_at (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
|
||||
int count, struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_iwrite (mca_io_ompio_file_t *fh, const void *buf, int count,
|
||||
struct ompi_datatype_t *datatype, ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf, int count, struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_write_at_all (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
|
||||
int count, struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status);
|
||||
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at_all (mca_io_ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
|
||||
int count, struct ompi_datatype_t *datatype, ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles,
|
||||
size_t bytes_per_cycle, int max_data, uint32_t iov_count,
|
||||
struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw );
|
||||
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_read (mca_io_ompio_file_t *fh, void *buf, int count,
|
||||
struct ompi_datatype_t *datatype, ompi_status_public_t *status);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_read_at (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, void *buf,
|
||||
int count, struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_iread (mca_io_ompio_file_t *fh, void *buf, int count,
|
||||
struct ompi_datatype_t *datatype, ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_iread_at (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf, int count, struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_read_at_all (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf, int count, struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_file_iread_at_all (mca_io_ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf, int count, struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
|
||||
|
||||
#endif /* MCA_COMMON_OMPIO_H */
|
||||
|
353
ompi/mca/common/ompio/common_ompio_file_read.c
Обычный файл
353
ompi/mca/common/ompio/common_ompio_file_read.c
Обычный файл
@ -0,0 +1,353 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2016 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "ompi/communicator/communicator.h"
|
||||
#include "ompi/info/info.h"
|
||||
#include "ompi/file/file.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/fs/base/base.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/fbtl/fbtl.h"
|
||||
#include "ompi/mca/fbtl/base/base.h"
|
||||
|
||||
#include "common_ompio.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio_request.h"
|
||||
#include "math.h"
|
||||
#include <unistd.h>
|
||||
|
||||
/* Read and write routines are split into two interfaces.
|
||||
** The
|
||||
** mca_io_ompio_file_read/write[_at]
|
||||
**
|
||||
** routines are the ones registered with the ompio modules.
|
||||
** The
|
||||
**
|
||||
** mca_common_ompio_file_read/write[_at]
|
||||
**
|
||||
** routesin are used e.g. from the shared file pointer modules.
|
||||
** The main difference is, that the first one takes an ompi_file_t
|
||||
** as a file pointer argument, while the second uses the ompio internal
|
||||
** mca_io_ompio_file_t structure.
|
||||
*/
|
||||
|
||||
int mca_common_ompio_file_read (mca_io_ompio_file_t *fh,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
|
||||
size_t total_bytes_read = 0; /* total bytes that have been read*/
|
||||
size_t bytes_per_cycle = 0; /* total read in each cycle by each process*/
|
||||
int index = 0;
|
||||
int cycles = 0;
|
||||
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
|
||||
size_t max_data=0, real_bytes_read=0;
|
||||
ssize_t ret_code=0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file vie iovec */
|
||||
|
||||
if ( 0 == count ) {
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (fh->f_amode & MPI_MODE_WRONLY){
|
||||
printf("Improper use of FILE Mode, Using WRONLY for Read!\n");
|
||||
ret = OMPI_ERROR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
|
||||
if ( -1 == mca_io_ompio_cycle_buffer_size ) {
|
||||
bytes_per_cycle = max_data;
|
||||
}
|
||||
else {
|
||||
bytes_per_cycle = mca_io_ompio_cycle_buffer_size;
|
||||
}
|
||||
cycles = ceil((float)max_data/bytes_per_cycle);
|
||||
|
||||
#if 0
|
||||
printf ("Bytes per Cycle: %d Cycles: %d max_data:%d \n",bytes_per_cycle, cycles, max_data);
|
||||
#endif
|
||||
|
||||
j = fh->f_index_in_file_view;
|
||||
|
||||
for (index = 0; index < cycles; index++) {
|
||||
|
||||
mca_common_ompio_build_io_array ( fh,
|
||||
index,
|
||||
cycles,
|
||||
bytes_per_cycle,
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_read);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
ret_code = fh->f_fbtl->fbtl_preadv (fh);
|
||||
if ( 0<= ret_code ) {
|
||||
real_bytes_read+=(size_t)ret_code;
|
||||
}
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = real_bytes_read;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_common_ompio_file_read_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = mca_common_ompio_file_read (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
|
||||
// An explicit offset file operation is not suppsed to modify
|
||||
// the internal file pointer. So reset the pointer
|
||||
// to the previous value
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int mca_common_ompio_file_iread (mca_io_ompio_file_t *fh,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_ompio_request_t *ompio_req=NULL;
|
||||
|
||||
ompio_req = OBJ_NEW(mca_ompio_request_t);
|
||||
ompio_req->req_type = MCA_OMPIO_REQUEST_READ;
|
||||
ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
|
||||
|
||||
if ( 0 == count ) {
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
|
||||
ompio_req->req_ompi.req_status._ucount = 0;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
if ( NULL != fh->f_fbtl->fbtl_ipreadv ) {
|
||||
// This fbtl has support for non-blocking operations
|
||||
|
||||
size_t total_bytes_read = 0; /* total bytes that have been read*/
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
|
||||
size_t max_data = 0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file vie iovec */
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
|
||||
// Non-blocking operations have to occur in a single cycle
|
||||
j = fh->f_index_in_file_view;
|
||||
|
||||
mca_common_ompio_build_io_array ( fh,
|
||||
0, // index
|
||||
1, // no. of cyces
|
||||
max_data, // setting bytes per cycle to match data
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_read);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
fh->f_fbtl->fbtl_ipreadv (fh, (ompi_request_t *) ompio_req);
|
||||
}
|
||||
|
||||
if ( false == mca_io_ompio_progress_is_registered ) {
|
||||
// Lazy initialization of progress function to minimize impact
|
||||
// on other ompi functionality in case its not used.
|
||||
opal_progress_register (mca_io_ompio_component_progress);
|
||||
mca_io_ompio_progress_is_registered=true;
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// This fbtl does not support non-blocking operations
|
||||
ompi_status_public_t status;
|
||||
ret = mca_common_ompio_file_read (fh, buf, count, datatype, &status);
|
||||
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = ret;
|
||||
ompio_req->req_ompi.req_status._ucount = status._ucount;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
}
|
||||
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int mca_common_ompio_file_iread_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = mca_common_ompio_file_iread (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
|
||||
/* An explicit offset file operation is not suppsed to modify
|
||||
** the internal file pointer. So reset the pointer
|
||||
** to the previous value
|
||||
** It is OK to reset the position already here, althgouth
|
||||
** the operation might still be pending/ongoing, since
|
||||
** the entire array of <offset, length, memaddress> have
|
||||
** already been constructed in the file_iread operation
|
||||
*/
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Infrastructure for collective operations */
|
||||
int mca_common_ompio_file_read_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = fh->f_fcoll->fcoll_file_read_all (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_common_ompio_file_iread_at_all (mca_io_ompio_file_t *fp,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
|
||||
ompio_io_ompio_file_get_position (fp, &prev_offset );
|
||||
ompi_io_ompio_set_explicit_offset (fp, offset);
|
||||
|
||||
if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) {
|
||||
ret = fp->f_fcoll->fcoll_file_iread_all (fp,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
}
|
||||
else {
|
||||
/* this fcoll component does not support non-blocking
|
||||
collective I/O operations. WE fake it with
|
||||
individual non-blocking I/O operations. */
|
||||
ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request );
|
||||
}
|
||||
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fp, prev_offset);
|
||||
return ret;
|
||||
}
|
448
ompi/mca/common/ompio/common_ompio_file_write.c
Обычный файл
448
ompi/mca/common/ompio/common_ompio_file_write.c
Обычный файл
@ -0,0 +1,448 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
||||
* University Research and Technology
|
||||
* Corporation. All rights reserved.
|
||||
* Copyright (c) 2004-2016 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "ompi/communicator/communicator.h"
|
||||
#include "ompi/info/info.h"
|
||||
#include "ompi/file/file.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/fbtl/fbtl.h"
|
||||
#include "ompi/mca/fbtl/base/base.h"
|
||||
|
||||
#include "common_ompio.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio_request.h"
|
||||
#include "math.h"
|
||||
#include <unistd.h>
|
||||
|
||||
int mca_common_ompio_file_write (mca_io_ompio_file_t *fh,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
int index = 0;
|
||||
int cycles = 0;
|
||||
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
size_t bytes_per_cycle=0;
|
||||
size_t total_bytes_written = 0;
|
||||
size_t max_data=0, real_bytes_written=0;
|
||||
ssize_t ret_code=0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file view iovec */
|
||||
|
||||
if ( 0 == count ) {
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
|
||||
if ( -1 == mca_io_ompio_cycle_buffer_size ) {
|
||||
bytes_per_cycle = max_data;
|
||||
}
|
||||
else {
|
||||
bytes_per_cycle = mca_io_ompio_cycle_buffer_size;
|
||||
}
|
||||
cycles = ceil((float)max_data/bytes_per_cycle);
|
||||
|
||||
#if 0
|
||||
printf ("Bytes per Cycle: %d Cycles: %d\n", bytes_per_cycle, cycles);
|
||||
#endif
|
||||
|
||||
j = fh->f_index_in_file_view;
|
||||
for (index = 0; index < cycles; index++) {
|
||||
mca_common_ompio_build_io_array ( fh,
|
||||
index,
|
||||
cycles,
|
||||
bytes_per_cycle,
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_written);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
ret_code =fh->f_fbtl->fbtl_pwritev (fh);
|
||||
if ( 0<= ret_code ) {
|
||||
real_bytes_written+= (size_t)ret_code;
|
||||
}
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = real_bytes_written;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_common_ompio_file_write_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = mca_common_ompio_file_write (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
// An explicit offset file operation is not suppsed to modify
|
||||
// the internal file pointer. So reset the pointer
|
||||
// to the previous value
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset );
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_common_ompio_file_iwrite (mca_io_ompio_file_t *fh,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_ompio_request_t *ompio_req=NULL;
|
||||
|
||||
ompio_req = OBJ_NEW(mca_ompio_request_t);
|
||||
ompio_req->req_type = MCA_OMPIO_REQUEST_WRITE;
|
||||
ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
|
||||
|
||||
if ( 0 == count ) {
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
|
||||
ompio_req->req_ompi.req_status._ucount = 0;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
if ( NULL != fh->f_fbtl->fbtl_ipwritev ) {
|
||||
/* This fbtl has support for non-blocking operations */
|
||||
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
size_t max_data = 0;
|
||||
size_t total_bytes_written =0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file vie iovec */
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
j = fh->f_index_in_file_view;
|
||||
|
||||
/* Non blocking operations have to occur in a single cycle */
|
||||
mca_common_ompio_build_io_array ( fh,
|
||||
0, // index of current cycle iteration
|
||||
1, // number of cycles
|
||||
max_data, // setting bytes_per_cycle to max_data
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_written);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
fh->f_fbtl->fbtl_ipwritev (fh, (ompi_request_t *) ompio_req);
|
||||
}
|
||||
|
||||
if ( false == mca_io_ompio_progress_is_registered ) {
|
||||
// Lazy initialization of progress function to minimize impact
|
||||
// on other ompi functionality in case its not used.
|
||||
opal_progress_register (mca_io_ompio_component_progress);
|
||||
mca_io_ompio_progress_is_registered=true;
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// This fbtl does not support non-blocking write operations
|
||||
ompi_status_public_t status;
|
||||
ret = mca_common_ompio_file_write(fh,buf,count,datatype, &status);
|
||||
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = ret;
|
||||
ompio_req->req_ompi.req_status._ucount = status._ucount;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
}
|
||||
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_common_ompio_file_iwrite_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = mca_common_ompio_file_iwrite (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
|
||||
/* An explicit offset file operation is not suppsed to modify
|
||||
** the internal file pointer. So reset the pointer
|
||||
** to the previous value
|
||||
** It is OK to reset the position already here, althgouth
|
||||
** the operation might still be pending/ongoing, since
|
||||
** the entire array of <offset, length, memaddress> have
|
||||
** already been constructed in the file_iwrite operation
|
||||
*/
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Collective operations */
|
||||
/******************************************************************/
|
||||
|
||||
int mca_common_ompio_file_write_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = fh->f_fcoll->fcoll_file_write_all (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_common_ompio_file_iwrite_at_all (mca_io_ompio_file_t *fp,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
|
||||
ompio_io_ompio_file_get_position (fp, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fp, offset);
|
||||
|
||||
if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) {
|
||||
ret = fp->f_fcoll->fcoll_file_iwrite_all (fp,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
}
|
||||
else {
|
||||
/* this fcoll component does not support non-blocking
|
||||
collective I/O operations. WE fake it with
|
||||
individual non-blocking I/O operations. */
|
||||
ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request );
|
||||
}
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fp, prev_offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Helper function used by both read and write operations */
|
||||
/**************************************************************/
|
||||
|
||||
int mca_common_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles,
|
||||
size_t bytes_per_cycle, int max_data, uint32_t iov_count,
|
||||
struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw )
|
||||
{
|
||||
OPAL_PTRDIFF_TYPE disp;
|
||||
int block = 1;
|
||||
size_t total_bytes_written = *tbw; /* total bytes that have been written*/
|
||||
size_t bytes_to_write_in_cycle = 0; /* left to be written in a cycle*/
|
||||
size_t sum_previous_counts = 0;
|
||||
size_t sum_previous_length = 0;
|
||||
int k = 0; /* index into the io_array */
|
||||
int i = *ii;
|
||||
int j = *jj;
|
||||
|
||||
sum_previous_length = fh->f_position_in_file_view;
|
||||
|
||||
if ((index == cycles-1) && (max_data % bytes_per_cycle)) {
|
||||
bytes_to_write_in_cycle = max_data % bytes_per_cycle;
|
||||
}
|
||||
else {
|
||||
bytes_to_write_in_cycle = bytes_per_cycle;
|
||||
}
|
||||
|
||||
fh->f_io_array = (mca_io_ompio_io_array_t *)malloc
|
||||
(OMPIO_IOVEC_INITIAL_SIZE * sizeof (mca_io_ompio_io_array_t));
|
||||
if (NULL == fh->f_io_array) {
|
||||
opal_output(1, "OUT OF MEMORY\n");
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
while (bytes_to_write_in_cycle) {
|
||||
/* reallocate if needed */
|
||||
if (OMPIO_IOVEC_INITIAL_SIZE*block <= k) {
|
||||
block ++;
|
||||
fh->f_io_array = (mca_io_ompio_io_array_t *)realloc
|
||||
(fh->f_io_array, OMPIO_IOVEC_INITIAL_SIZE *
|
||||
block * sizeof (mca_io_ompio_io_array_t));
|
||||
if (NULL == fh->f_io_array) {
|
||||
opal_output(1, "OUT OF MEMORY\n");
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
}
|
||||
|
||||
if (decoded_iov[i].iov_len -
|
||||
(total_bytes_written - sum_previous_counts) <= 0) {
|
||||
sum_previous_counts += decoded_iov[i].iov_len;
|
||||
i = i + 1;
|
||||
}
|
||||
|
||||
disp = (OPAL_PTRDIFF_TYPE)decoded_iov[i].iov_base +
|
||||
(total_bytes_written - sum_previous_counts);
|
||||
fh->f_io_array[k].memory_address = (IOVBASE_TYPE *)disp;
|
||||
|
||||
if (decoded_iov[i].iov_len -
|
||||
(total_bytes_written - sum_previous_counts) >=
|
||||
bytes_to_write_in_cycle) {
|
||||
fh->f_io_array[k].length = bytes_to_write_in_cycle;
|
||||
}
|
||||
else {
|
||||
fh->f_io_array[k].length = decoded_iov[i].iov_len -
|
||||
(total_bytes_written - sum_previous_counts);
|
||||
}
|
||||
|
||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) {
|
||||
if (fh->f_decoded_iov[j].iov_len -
|
||||
(fh->f_total_bytes - sum_previous_length) <= 0) {
|
||||
sum_previous_length += fh->f_decoded_iov[j].iov_len;
|
||||
j = j + 1;
|
||||
if (j == (int)fh->f_iov_count) {
|
||||
j = 0;
|
||||
sum_previous_length = 0;
|
||||
fh->f_offset += fh->f_view_extent;
|
||||
fh->f_position_in_file_view = sum_previous_length;
|
||||
fh->f_index_in_file_view = j;
|
||||
fh->f_total_bytes = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
disp = (OPAL_PTRDIFF_TYPE)fh->f_decoded_iov[j].iov_base +
|
||||
(fh->f_total_bytes - sum_previous_length);
|
||||
fh->f_io_array[k].offset = (IOVBASE_TYPE *)(intptr_t)(disp + fh->f_offset);
|
||||
|
||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) {
|
||||
if (fh->f_decoded_iov[j].iov_len -
|
||||
(fh->f_total_bytes - sum_previous_length)
|
||||
< fh->f_io_array[k].length) {
|
||||
fh->f_io_array[k].length = fh->f_decoded_iov[j].iov_len -
|
||||
(fh->f_total_bytes - sum_previous_length);
|
||||
}
|
||||
}
|
||||
|
||||
total_bytes_written += fh->f_io_array[k].length;
|
||||
fh->f_total_bytes += fh->f_io_array[k].length;
|
||||
bytes_to_write_in_cycle -= fh->f_io_array[k].length;
|
||||
k = k + 1;
|
||||
}
|
||||
fh->f_position_in_file_view = sum_previous_length;
|
||||
fh->f_index_in_file_view = j;
|
||||
fh->f_num_of_io_entries = k;
|
||||
|
||||
#if 0
|
||||
if (fh->f_rank == 0) {
|
||||
int d;
|
||||
printf("*************************** %d\n", fh->f_num_of_io_entries);
|
||||
|
||||
for (d=0 ; d<fh->f_num_of_io_entries ; d++) {
|
||||
printf(" ADDRESS: %p OFFSET: %p LENGTH: %d\n",
|
||||
fh->f_io_array[d].memory_address,
|
||||
fh->f_io_array[d].offset,
|
||||
fh->f_io_array[d].length);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
*ii = i;
|
||||
*jj = j;
|
||||
*tbw = total_bytes_written;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -25,15 +25,16 @@
|
||||
#include "ompi/datatype/ompi_datatype.h"
|
||||
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
|
||||
|
||||
/* Print queue related function implementations */
|
||||
int mca_common_ompio_initialize_print_queue( mca_common_ompio_print_queue **r){
|
||||
int mca_common_ompio_initialize_print_queue( struct mca_common_ompio_print_queue **r){
|
||||
|
||||
mca_common_ompio_print_queue *q=NULL;
|
||||
struct mca_common_ompio_print_queue *q=NULL;
|
||||
int ret = OMPI_SUCCESS;
|
||||
|
||||
q = (mca_common_ompio_print_queue *) malloc ( sizeof(mca_common_ompio_print_queue));
|
||||
q = (struct mca_common_ompio_print_queue *) malloc ( sizeof(mca_common_ompio_print_queue));
|
||||
if ( NULL == q ) {
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
@ -45,8 +46,8 @@ int mca_common_ompio_initialize_print_queue( mca_common_ompio_print_queue **r){
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_common_ompio_register_print_entry ( mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry x)
|
||||
int mca_common_ompio_register_print_entry ( struct mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry x)
|
||||
{
|
||||
if (q->count >= MCA_COMMON_OMPIO_QUEUESIZE){
|
||||
return OMPI_ERROR;
|
||||
@ -60,7 +61,7 @@ int mca_common_ompio_register_print_entry ( mca_common_ompio_print_queue *q,
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_common_ompio_unregister_print_entry ( mca_common_ompio_print_queue *q,
|
||||
int mca_common_ompio_unregister_print_entry ( struct mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry *x)
|
||||
{
|
||||
|
||||
@ -76,7 +77,7 @@ int mca_common_ompio_unregister_print_entry ( mca_common_ompio_print_queue *q,
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q)
|
||||
int mca_common_ompio_empty_print_queue( struct mca_common_ompio_print_queue *q)
|
||||
{
|
||||
if (q->count == 0) {
|
||||
return 1;
|
||||
@ -85,7 +86,7 @@ int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q)
|
||||
int mca_common_ompio_full_print_queue( struct mca_common_ompio_print_queue *q)
|
||||
{
|
||||
if (q->count < MCA_COMMON_OMPIO_QUEUESIZE) {
|
||||
return 0;
|
||||
@ -95,7 +96,7 @@ int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q)
|
||||
}
|
||||
|
||||
|
||||
int mca_common_ompio_print_time_info( mca_common_ompio_print_queue *q,
|
||||
int mca_common_ompio_print_time_info( struct mca_common_ompio_print_queue *q,
|
||||
char *name,
|
||||
struct mca_io_ompio_file_t *fh){
|
||||
|
||||
|
@ -32,33 +32,36 @@ struct mca_io_ompio_file_t;
|
||||
#define MCA_COMMON_OMPIO_QUEUESIZE 2048
|
||||
|
||||
/*To extract time-information */
|
||||
typedef struct {
|
||||
struct mca_common_ompio_print_entry{
|
||||
double time[3];
|
||||
int nprocs_for_coll;
|
||||
int aggregator;
|
||||
}mca_common_ompio_print_entry;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
typedef struct mca_common_ompio_print_entry mca_common_ompio_print_entry;
|
||||
|
||||
struct mca_common_ompio_print_queue {
|
||||
mca_common_ompio_print_entry entry[MCA_COMMON_OMPIO_QUEUESIZE + 1];
|
||||
int first;
|
||||
int last;
|
||||
int count;
|
||||
} mca_common_ompio_print_queue;
|
||||
};
|
||||
typedef struct mca_common_ompio_print_queue mca_common_ompio_print_queue;
|
||||
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_register_print_entry (mca_common_ompio_print_queue *q,
|
||||
OMPI_DECLSPEC int mca_common_ompio_register_print_entry (struct mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry x);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_unregister_print_entry (mca_common_ompio_print_queue *q,
|
||||
OMPI_DECLSPEC int mca_common_ompio_unregister_print_entry (struct mca_common_ompio_print_queue *q,
|
||||
mca_common_ompio_print_entry *x);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q);
|
||||
OMPI_DECLSPEC int mca_common_ompio_empty_print_queue( struct mca_common_ompio_print_queue *q);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q);
|
||||
OMPI_DECLSPEC int mca_common_ompio_full_print_queue( struct mca_common_ompio_print_queue *q);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_initialize_print_queue(mca_common_ompio_print_queue **q);
|
||||
OMPI_DECLSPEC int mca_common_ompio_initialize_print_queue(struct mca_common_ompio_print_queue **q);
|
||||
|
||||
OMPI_DECLSPEC int mca_common_ompio_print_time_info( mca_common_ompio_print_queue *q,
|
||||
OMPI_DECLSPEC int mca_common_ompio_print_time_info( struct mca_common_ompio_print_queue *q,
|
||||
char *name_operation, struct mca_io_ompio_file_t *fh);
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/fbtl/fbtl.h"
|
||||
#include "ompi/mca/fbtl/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
/*
|
||||
* This structure is needed so that we can close the modules
|
||||
|
@ -24,12 +24,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mpi.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/fbtl/fbtl.h"
|
||||
#include "ompi/mca/fbtl/base/base.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
int mca_fbtl_base_file_unselect(mca_io_ompio_file_t *file)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fbtl/fbtl.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include <plfs.h>
|
||||
|
||||
extern int mca_fbtl_plfs_priority;
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -23,7 +23,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fbtl/fbtl.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio_request.h"
|
||||
|
||||
extern int mca_fbtl_posix_priority;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fbtl/fbtl.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include "ompi/mca/fs/pvfs2/fs_pvfs2.h"
|
||||
#include "pvfs2.h"
|
||||
#include "pvfs2-compat.h"
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include <math.h>
|
||||
#include "ompi/mca/fcoll/base/fcoll_base_coll_array.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
|
||||
int fcoll_base_coll_allgatherv_array (void *sbuf,
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
/*
|
||||
* This structure is needed so that we can close the modules
|
||||
|
@ -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-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -24,12 +24,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mpi.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
int mca_fcoll_base_file_unselect(mca_io_ompio_file_t *file)
|
||||
{
|
||||
|
@ -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-2014 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -28,7 +28,7 @@
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
@ -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-2014 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -28,7 +28,7 @@
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
@ -23,8 +23,7 @@
|
||||
#include "mpi.h"
|
||||
#include "ompi/constants.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/io/io.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include "math.h"
|
||||
#include <unistd.h>
|
||||
|
||||
@ -38,5 +37,5 @@ mca_fcoll_individual_file_read_all (mca_io_ompio_file_t *fh,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
return ompio_io_ompio_file_read( fh, buf, count, datatype, status);
|
||||
return mca_common_ompio_file_read( fh, buf, count, datatype, status);
|
||||
}
|
||||
|
@ -25,8 +25,7 @@
|
||||
#include "mpi.h"
|
||||
#include "ompi/constants.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/io/io.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include "math.h"
|
||||
#include <unistd.h>
|
||||
|
||||
@ -37,5 +36,5 @@ int mca_fcoll_individual_file_write_all (mca_io_ompio_file_t *fh,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
return ompio_io_ompio_file_write (fh, buf, count, datatype, status);
|
||||
return mca_common_ompio_file_write (fh, buf, count, datatype, status);
|
||||
}
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -28,7 +28,7 @@
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
@ -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-2014 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -28,7 +28,7 @@
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fcoll/fcoll.h"
|
||||
#include "ompi/mca/fcoll/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
|
@ -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-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -27,7 +27,7 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/fs/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
/*
|
||||
* This structure is needed so that we can close the modules
|
||||
|
@ -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-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -24,13 +24,14 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mpi.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/fs/base/base.h"
|
||||
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
int mca_fs_base_file_unselect(mca_io_ompio_file_t *file)
|
||||
{
|
||||
if (NULL != file->f_fs && NULL != file->f_fs->fs_module_finalize) {
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/fs/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
#ifdef HAVE_SYS_STATFS_H
|
||||
#include <sys/statfs.h> /* or <sys/vfs.h> */
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
extern int mca_fs_lustre_priority;
|
||||
extern int mca_fs_lustre_stripe_size;
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
#include <plfs.h>
|
||||
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -36,7 +36,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
extern int mca_fs_pvfs2_priority;
|
||||
extern int mca_fs_pvfs2_stripe_size;
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/fs/fs.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
extern int mca_fs_ufs_priority;
|
||||
|
||||
|
@ -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 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -41,7 +41,6 @@
|
||||
#include "ompi/datatype/ompi_datatype.h"
|
||||
#include "ompi/request/request.h"
|
||||
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
extern int mca_io_ompio_cycle_buffer_size;
|
||||
extern int mca_io_ompio_bytes_per_agg;
|
||||
@ -219,6 +218,7 @@ typedef int (*mca_io_ompio_set_aggregator_props_fn_t) (struct mca_io_ompio_file_
|
||||
size_t bytes_per_proc);
|
||||
|
||||
|
||||
struct mca_common_ompio_print_queue;
|
||||
|
||||
/**
|
||||
* Back-end structure for MPI_File
|
||||
@ -289,8 +289,8 @@ struct mca_io_ompio_file_t {
|
||||
mca_sharedfp_base_module_t *f_sharedfp;
|
||||
|
||||
/* Timing information */
|
||||
mca_common_ompio_print_queue *f_coll_write_time;
|
||||
mca_common_ompio_print_queue *f_coll_read_time;
|
||||
struct mca_common_ompio_print_queue *f_coll_write_time;
|
||||
struct mca_common_ompio_print_queue *f_coll_read_time;
|
||||
|
||||
/*initial list of aggregators and groups*/
|
||||
int *f_init_aggr_list;
|
||||
@ -320,17 +320,15 @@ struct mca_io_ompio_data_t {
|
||||
typedef struct mca_io_ompio_data_t mca_io_ompio_data_t;
|
||||
|
||||
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
|
||||
/* functions to retrieve the number of aggregators and the size of the
|
||||
temporary buffer on aggregators from the fcoll modules */
|
||||
OMPI_DECLSPEC void mca_io_ompio_get_num_aggregators ( int *num_aggregators);
|
||||
OMPI_DECLSPEC void mca_io_ompio_get_bytes_per_agg ( int *bytes_per_agg);
|
||||
|
||||
|
||||
OMPI_DECLSPEC int mca_io_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles,
|
||||
size_t bpc, int max_data, uint32_t iov_count,
|
||||
struct iovec *decoded_iov, int *ii, int *jj,
|
||||
size_t *tbw );
|
||||
|
||||
OMPI_DECLSPEC int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_open (ompi_communicator_t *comm,
|
||||
@ -339,82 +337,9 @@ OMPI_DECLSPEC int ompio_io_ompio_file_open (ompi_communicator_t *comm,
|
||||
ompi_info_t *info,
|
||||
mca_io_ompio_file_t *fh,bool use_sharedfp);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_write_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_write (mca_io_ompio_file_t *fh,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_close (mca_io_ompio_file_t *fh);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_write_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_iwrite_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_iwrite (mca_io_ompio_file_t *fh,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_iwrite_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_iread (mca_io_ompio_file_t *fh,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_read (mca_io_ompio_file_t *fh,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status);
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_iread_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_iread_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request);
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_read_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status);
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_read_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status);
|
||||
OMPI_DECLSPEC int ompio_io_ompio_file_get_size (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE *size);
|
||||
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -59,102 +59,7 @@ int mca_io_ompio_file_read (ompi_file_t *fp,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_read(&data->ompio_fh,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_read (mca_io_ompio_file_t *fh,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
|
||||
size_t total_bytes_read = 0; /* total bytes that have been read*/
|
||||
size_t bytes_per_cycle = 0; /* total read in each cycle by each process*/
|
||||
int index = 0;
|
||||
int cycles = 0;
|
||||
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
|
||||
size_t max_data=0, real_bytes_read=0;
|
||||
ssize_t ret_code=0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file vie iovec */
|
||||
|
||||
if ( 0 == count ) {
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (fh->f_amode & MPI_MODE_WRONLY){
|
||||
printf("Improper use of FILE Mode, Using WRONLY for Read!\n");
|
||||
ret = OMPI_ERROR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
|
||||
if ( -1 == mca_io_ompio_cycle_buffer_size ) {
|
||||
bytes_per_cycle = max_data;
|
||||
}
|
||||
else {
|
||||
bytes_per_cycle = mca_io_ompio_cycle_buffer_size;
|
||||
}
|
||||
cycles = ceil((float)max_data/bytes_per_cycle);
|
||||
|
||||
#if 0
|
||||
printf ("Bytes per Cycle: %d Cycles: %d max_data:%d \n",bytes_per_cycle, cycles, max_data);
|
||||
#endif
|
||||
|
||||
j = fh->f_index_in_file_view;
|
||||
|
||||
for (index = 0; index < cycles; index++) {
|
||||
|
||||
mca_io_ompio_build_io_array ( fh,
|
||||
index,
|
||||
cycles,
|
||||
bytes_per_cycle,
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_read);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
ret_code = fh->f_fbtl->fbtl_preadv (fh);
|
||||
if ( 0<= ret_code ) {
|
||||
real_bytes_read+=(size_t)ret_code;
|
||||
}
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = real_bytes_read;
|
||||
}
|
||||
ret = mca_common_ompio_file_read(&data->ompio_fh,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -170,39 +75,11 @@ int mca_io_ompio_file_read_at (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_read_at(&data->ompio_fh, offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at(&data->ompio_fh, offset,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_read_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = ompio_io_ompio_file_read (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
|
||||
// An explicit offset file operation is not suppsed to modify
|
||||
// the internal file pointer. So reset the pointer
|
||||
// to the previous value
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int mca_io_ompio_file_iread (ompi_file_t *fh,
|
||||
void *buf,
|
||||
int count,
|
||||
@ -213,103 +90,12 @@ int mca_io_ompio_file_iread (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_iread(&data->ompio_fh,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iread(&data->ompio_fh,buf,count,datatype,request);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int ompio_io_ompio_file_iread (mca_io_ompio_file_t *fh,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_ompio_request_t *ompio_req=NULL;
|
||||
|
||||
ompio_req = OBJ_NEW(mca_ompio_request_t);
|
||||
ompio_req->req_type = MCA_OMPIO_REQUEST_READ;
|
||||
ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
|
||||
|
||||
if ( 0 == count ) {
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
|
||||
ompio_req->req_ompi.req_status._ucount = 0;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
if ( NULL != fh->f_fbtl->fbtl_ipreadv ) {
|
||||
// This fbtl has support for non-blocking operations
|
||||
|
||||
size_t total_bytes_read = 0; /* total bytes that have been read*/
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
|
||||
size_t max_data = 0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file vie iovec */
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
|
||||
// Non-blocking operations have to occur in a single cycle
|
||||
j = fh->f_index_in_file_view;
|
||||
|
||||
mca_io_ompio_build_io_array ( fh,
|
||||
0, // index
|
||||
1, // no. of cyces
|
||||
max_data, // setting bytes per cycle to match data
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_read);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
fh->f_fbtl->fbtl_ipreadv (fh, (ompi_request_t *) ompio_req);
|
||||
}
|
||||
|
||||
if ( false == mca_io_ompio_progress_is_registered ) {
|
||||
// Lazy initialization of progress function to minimize impact
|
||||
// on other ompi functionality in case its not used.
|
||||
opal_progress_register (mca_io_ompio_component_progress);
|
||||
mca_io_ompio_progress_is_registered=true;
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// This fbtl does not support non-blocking operations
|
||||
ompi_status_public_t status;
|
||||
ret = ompio_io_ompio_file_read (fh, buf, count, datatype, &status);
|
||||
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = ret;
|
||||
ompio_req->req_ompi.req_status._ucount = status._ucount;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
}
|
||||
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_io_ompio_file_iread_at (ompi_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
@ -321,38 +107,7 @@ int mca_io_ompio_file_iread_at (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_iread_at(&data->ompio_fh,offset,buf,count,datatype,request);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_iread_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = ompio_io_ompio_file_iread (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
|
||||
/* An explicit offset file operation is not suppsed to modify
|
||||
** the internal file pointer. So reset the pointer
|
||||
** to the previous value
|
||||
** It is OK to reset the position already here, althgouth
|
||||
** the operation might still be pending/ongoing, since
|
||||
** the entire array of <offset, length, memaddress> have
|
||||
** already been constructed in the file_iread operation
|
||||
*/
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
ret = mca_common_ompio_file_iread_at(&data->ompio_fh,offset,buf,count,datatype,request);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -411,7 +166,7 @@ int mca_io_ompio_file_iread_all (ompi_file_t *fh,
|
||||
/* this fcoll component does not support non-blocking
|
||||
collective I/O operations. WE fake it with
|
||||
individual non-blocking I/O operations. */
|
||||
ret = ompio_io_ompio_file_iread ( fp, buf, count, datatype, request );
|
||||
ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request );
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -429,33 +184,11 @@ int mca_io_ompio_file_read_at_all (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_read_at_all(&data->ompio_fh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at_all(&data->ompio_fh,offset,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_read_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t * status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = fh->f_fcoll->fcoll_file_read_all (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_io_ompio_file_iread_at_all (ompi_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
@ -467,41 +200,10 @@ int mca_io_ompio_file_iread_at_all (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
|
||||
ret = ompio_io_ompio_file_iread_at_all ( &data->ompio_fh, offset, buf, count, datatype, request );
|
||||
ret = mca_common_ompio_file_iread_at_all ( &data->ompio_fh, offset, buf, count, datatype, request );
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_iread_at_all (mca_io_ompio_file_t *fp,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
|
||||
ompio_io_ompio_file_get_position (fp, &prev_offset );
|
||||
ompi_io_ompio_set_explicit_offset (fp, offset);
|
||||
|
||||
if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) {
|
||||
ret = fp->f_fcoll->fcoll_file_iread_all (fp,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
}
|
||||
else {
|
||||
/* this fcoll component does not support non-blocking
|
||||
collective I/O operations. WE fake it with
|
||||
individual non-blocking I/O operations. */
|
||||
ret = ompio_io_ompio_file_iread ( fp, buf, count, datatype, request );
|
||||
}
|
||||
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fp, prev_offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Infrastructure for shared file pointer operations
|
||||
** (individual and ordered)*/
|
||||
@ -685,7 +387,7 @@ int mca_io_ompio_file_read_at_all_begin (ompi_file_t *fh,
|
||||
printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n");
|
||||
return MPI_ERR_REQUEST;
|
||||
}
|
||||
ret = ompio_io_ompio_file_iread_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req );
|
||||
ret = mca_common_ompio_file_iread_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req );
|
||||
fp->f_split_coll_in_use = true;
|
||||
return ret;
|
||||
}
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -45,7 +45,7 @@
|
||||
** routines are the ones registered with the ompio modules.
|
||||
** The
|
||||
**
|
||||
** ompio_io_ompio_file_read/write[_at]
|
||||
** mca_common_ompio_file_read/write[_at]
|
||||
**
|
||||
** routesin are used e.g. from the shared file pointer modules.
|
||||
** The main difference is, that the first one takes an ompi_file_t
|
||||
@ -67,94 +67,10 @@ int mca_io_ompio_file_write (ompi_file_t *fp,
|
||||
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
|
||||
fh = &data->ompio_fh;
|
||||
|
||||
ret = ompio_io_ompio_file_write(fh,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write(fh,buf,count,datatype,status);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_write (mca_io_ompio_file_t *fh,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
int index = 0;
|
||||
int cycles = 0;
|
||||
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
size_t bytes_per_cycle=0;
|
||||
size_t total_bytes_written = 0;
|
||||
size_t max_data=0, real_bytes_written=0;
|
||||
ssize_t ret_code=0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file view iovec */
|
||||
|
||||
if ( 0 == count ) {
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
|
||||
if ( -1 == mca_io_ompio_cycle_buffer_size ) {
|
||||
bytes_per_cycle = max_data;
|
||||
}
|
||||
else {
|
||||
bytes_per_cycle = mca_io_ompio_cycle_buffer_size;
|
||||
}
|
||||
cycles = ceil((float)max_data/bytes_per_cycle);
|
||||
|
||||
#if 0
|
||||
printf ("Bytes per Cycle: %d Cycles: %d\n", bytes_per_cycle, cycles);
|
||||
#endif
|
||||
|
||||
j = fh->f_index_in_file_view;
|
||||
for (index = 0; index < cycles; index++) {
|
||||
mca_io_ompio_build_io_array ( fh,
|
||||
index,
|
||||
cycles,
|
||||
bytes_per_cycle,
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_written);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
ret_code =fh->f_fbtl->fbtl_pwritev (fh);
|
||||
if ( 0<= ret_code ) {
|
||||
real_bytes_written+= (size_t)ret_code;
|
||||
}
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
|
||||
if ( MPI_STATUS_IGNORE != status ) {
|
||||
status->_ucount = real_bytes_written;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_io_ompio_file_write_at (ompi_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
@ -167,35 +83,11 @@ int mca_io_ompio_file_write_at (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_write_at (&data->ompio_fh, offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at (&data->ompio_fh, offset,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_write_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = ompio_io_ompio_file_write (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
// An explicit offset file operation is not suppsed to modify
|
||||
// the internal file pointer. So reset the pointer
|
||||
// to the previous value
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset );
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_io_ompio_file_iwrite (ompi_file_t *fp,
|
||||
const void *buf,
|
||||
int count,
|
||||
@ -206,98 +98,11 @@ int mca_io_ompio_file_iwrite (ompi_file_t *fp,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_iwrite(&data->ompio_fh,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iwrite(&data->ompio_fh,buf,count,datatype,request);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_iwrite (mca_io_ompio_file_t *fh,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
mca_ompio_request_t *ompio_req=NULL;
|
||||
|
||||
ompio_req = OBJ_NEW(mca_ompio_request_t);
|
||||
ompio_req->req_type = MCA_OMPIO_REQUEST_WRITE;
|
||||
ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
|
||||
|
||||
if ( 0 == count ) {
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
|
||||
ompio_req->req_ompi.req_status._ucount = 0;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
if ( NULL != fh->f_fbtl->fbtl_ipwritev ) {
|
||||
/* This fbtl has support for non-blocking operations */
|
||||
|
||||
uint32_t iov_count = 0;
|
||||
struct iovec *decoded_iov = NULL;
|
||||
size_t max_data = 0;
|
||||
size_t total_bytes_written =0;
|
||||
int i = 0; /* index into the decoded iovec of the buffer */
|
||||
int j = 0; /* index into the file vie iovec */
|
||||
|
||||
ompi_io_ompio_decode_datatype (fh,
|
||||
datatype,
|
||||
count,
|
||||
buf,
|
||||
&max_data,
|
||||
&decoded_iov,
|
||||
&iov_count);
|
||||
j = fh->f_index_in_file_view;
|
||||
|
||||
/* Non blocking operations have to occur in a single cycle */
|
||||
mca_io_ompio_build_io_array ( fh,
|
||||
0, // index of current cycle iteration
|
||||
1, // number of cycles
|
||||
max_data, // setting bytes_per_cycle to max_data
|
||||
max_data,
|
||||
iov_count,
|
||||
decoded_iov,
|
||||
&i,
|
||||
&j,
|
||||
&total_bytes_written);
|
||||
|
||||
if (fh->f_num_of_io_entries) {
|
||||
fh->f_fbtl->fbtl_ipwritev (fh, (ompi_request_t *) ompio_req);
|
||||
}
|
||||
|
||||
if ( false == mca_io_ompio_progress_is_registered ) {
|
||||
// Lazy initialization of progress function to minimize impact
|
||||
// on other ompi functionality in case its not used.
|
||||
opal_progress_register (mca_io_ompio_component_progress);
|
||||
mca_io_ompio_progress_is_registered=true;
|
||||
}
|
||||
|
||||
fh->f_num_of_io_entries = 0;
|
||||
if (NULL != fh->f_io_array) {
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
if (NULL != decoded_iov) {
|
||||
free (decoded_iov);
|
||||
decoded_iov = NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// This fbtl does not support non-blocking write operations
|
||||
ompi_status_public_t status;
|
||||
ret = ompio_io_ompio_file_write(fh,buf,count,datatype, &status);
|
||||
|
||||
ompio_req->req_ompi.req_status.MPI_ERROR = ret;
|
||||
ompio_req->req_ompi.req_status._ucount = status._ucount;
|
||||
ompi_request_complete (&ompio_req->req_ompi, false);
|
||||
}
|
||||
|
||||
*request = (ompi_request_t *) ompio_req;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_io_ompio_file_iwrite_at (ompi_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
@ -310,165 +115,11 @@ int mca_io_ompio_file_iwrite_at (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_iwrite_at(&data->ompio_fh,offset,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iwrite_at(&data->ompio_fh,offset,buf,count,datatype,request);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_iwrite_at (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = ompio_io_ompio_file_iwrite (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
|
||||
/* An explicit offset file operation is not suppsed to modify
|
||||
** the internal file pointer. So reset the pointer
|
||||
** to the previous value
|
||||
** It is OK to reset the position already here, althgouth
|
||||
** the operation might still be pending/ongoing, since
|
||||
** the entire array of <offset, length, memaddress> have
|
||||
** already been constructed in the file_iwrite operation
|
||||
*/
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Helper function used by both read and write operations */
|
||||
/**************************************************************/
|
||||
|
||||
int mca_io_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles,
|
||||
size_t bytes_per_cycle, int max_data, uint32_t iov_count,
|
||||
struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw )
|
||||
{
|
||||
OPAL_PTRDIFF_TYPE disp;
|
||||
int block = 1;
|
||||
size_t total_bytes_written = *tbw; /* total bytes that have been written*/
|
||||
size_t bytes_to_write_in_cycle = 0; /* left to be written in a cycle*/
|
||||
size_t sum_previous_counts = 0;
|
||||
size_t sum_previous_length = 0;
|
||||
int k = 0; /* index into the io_array */
|
||||
int i = *ii;
|
||||
int j = *jj;
|
||||
|
||||
sum_previous_length = fh->f_position_in_file_view;
|
||||
|
||||
if ((index == cycles-1) && (max_data % bytes_per_cycle)) {
|
||||
bytes_to_write_in_cycle = max_data % bytes_per_cycle;
|
||||
}
|
||||
else {
|
||||
bytes_to_write_in_cycle = bytes_per_cycle;
|
||||
}
|
||||
|
||||
fh->f_io_array = (mca_io_ompio_io_array_t *)malloc
|
||||
(OMPIO_IOVEC_INITIAL_SIZE * sizeof (mca_io_ompio_io_array_t));
|
||||
if (NULL == fh->f_io_array) {
|
||||
opal_output(1, "OUT OF MEMORY\n");
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
while (bytes_to_write_in_cycle) {
|
||||
/* reallocate if needed */
|
||||
if (OMPIO_IOVEC_INITIAL_SIZE*block <= k) {
|
||||
block ++;
|
||||
fh->f_io_array = (mca_io_ompio_io_array_t *)realloc
|
||||
(fh->f_io_array, OMPIO_IOVEC_INITIAL_SIZE *
|
||||
block * sizeof (mca_io_ompio_io_array_t));
|
||||
if (NULL == fh->f_io_array) {
|
||||
opal_output(1, "OUT OF MEMORY\n");
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
}
|
||||
|
||||
if (decoded_iov[i].iov_len -
|
||||
(total_bytes_written - sum_previous_counts) <= 0) {
|
||||
sum_previous_counts += decoded_iov[i].iov_len;
|
||||
i = i + 1;
|
||||
}
|
||||
|
||||
disp = (OPAL_PTRDIFF_TYPE)decoded_iov[i].iov_base +
|
||||
(total_bytes_written - sum_previous_counts);
|
||||
fh->f_io_array[k].memory_address = (IOVBASE_TYPE *)disp;
|
||||
|
||||
if (decoded_iov[i].iov_len -
|
||||
(total_bytes_written - sum_previous_counts) >=
|
||||
bytes_to_write_in_cycle) {
|
||||
fh->f_io_array[k].length = bytes_to_write_in_cycle;
|
||||
}
|
||||
else {
|
||||
fh->f_io_array[k].length = decoded_iov[i].iov_len -
|
||||
(total_bytes_written - sum_previous_counts);
|
||||
}
|
||||
|
||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) {
|
||||
if (fh->f_decoded_iov[j].iov_len -
|
||||
(fh->f_total_bytes - sum_previous_length) <= 0) {
|
||||
sum_previous_length += fh->f_decoded_iov[j].iov_len;
|
||||
j = j + 1;
|
||||
if (j == (int)fh->f_iov_count) {
|
||||
j = 0;
|
||||
sum_previous_length = 0;
|
||||
fh->f_offset += fh->f_view_extent;
|
||||
fh->f_position_in_file_view = sum_previous_length;
|
||||
fh->f_index_in_file_view = j;
|
||||
fh->f_total_bytes = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
disp = (OPAL_PTRDIFF_TYPE)fh->f_decoded_iov[j].iov_base +
|
||||
(fh->f_total_bytes - sum_previous_length);
|
||||
fh->f_io_array[k].offset = (IOVBASE_TYPE *)(intptr_t)(disp + fh->f_offset);
|
||||
|
||||
if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) {
|
||||
if (fh->f_decoded_iov[j].iov_len -
|
||||
(fh->f_total_bytes - sum_previous_length)
|
||||
< fh->f_io_array[k].length) {
|
||||
fh->f_io_array[k].length = fh->f_decoded_iov[j].iov_len -
|
||||
(fh->f_total_bytes - sum_previous_length);
|
||||
}
|
||||
}
|
||||
|
||||
total_bytes_written += fh->f_io_array[k].length;
|
||||
fh->f_total_bytes += fh->f_io_array[k].length;
|
||||
bytes_to_write_in_cycle -= fh->f_io_array[k].length;
|
||||
k = k + 1;
|
||||
}
|
||||
fh->f_position_in_file_view = sum_previous_length;
|
||||
fh->f_index_in_file_view = j;
|
||||
fh->f_num_of_io_entries = k;
|
||||
|
||||
#if 0
|
||||
if (fh->f_rank == 0) {
|
||||
int d;
|
||||
printf("*************************** %d\n", fh->f_num_of_io_entries);
|
||||
|
||||
for (d=0 ; d<fh->f_num_of_io_entries ; d++) {
|
||||
printf(" ADDRESS: %p OFFSET: %p LENGTH: %d\n",
|
||||
fh->f_io_array[d].memory_address,
|
||||
fh->f_io_array[d].offset,
|
||||
fh->f_io_array[d].length);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
*ii = i;
|
||||
*jj = j;
|
||||
*tbw = total_bytes_written;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/* Collective operations */
|
||||
/******************************************************************/
|
||||
@ -512,7 +163,7 @@ int mca_io_ompio_file_write_at_all (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_write_at_all(&data->ompio_fh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at_all(&data->ompio_fh,offset,buf,count,datatype,status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -541,33 +192,12 @@ int mca_io_ompio_file_iwrite_all (ompi_file_t *fh,
|
||||
/* this fcoll component does not support non-blocking
|
||||
collective I/O operations. WE fake it with
|
||||
individual non-blocking I/O operations. */
|
||||
ret = ompio_io_ompio_file_iwrite ( fp, buf, count, datatype, request );
|
||||
ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_write_at_all (mca_io_ompio_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_status_public_t *status)
|
||||
{
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
ompio_io_ompio_file_get_position (fh, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, offset);
|
||||
ret = fh->f_fcoll->fcoll_file_write_all (fh,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
status);
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fh, prev_offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int mca_io_ompio_file_iwrite_at_all (ompi_file_t *fh,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
@ -580,46 +210,10 @@ int mca_io_ompio_file_iwrite_at_all (ompi_file_t *fh,
|
||||
mca_io_ompio_data_t *data;
|
||||
|
||||
data = (mca_io_ompio_data_t *) fh->f_io_selected_data;
|
||||
ret = ompio_io_ompio_file_iwrite_at_all ( &data->ompio_fh, offset, buf, count, datatype, request );
|
||||
ret = mca_common_ompio_file_iwrite_at_all ( &data->ompio_fh, offset, buf, count, datatype, request );
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ompio_io_ompio_file_iwrite_at_all (mca_io_ompio_file_t *fp,
|
||||
OMPI_MPI_OFFSET_TYPE offset,
|
||||
const void *buf,
|
||||
int count,
|
||||
struct ompi_datatype_t *datatype,
|
||||
ompi_request_t **request)
|
||||
{
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
OMPI_MPI_OFFSET_TYPE prev_offset;
|
||||
|
||||
ompio_io_ompio_file_get_position (fp, &prev_offset );
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fp, offset);
|
||||
|
||||
if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) {
|
||||
ret = fp->f_fcoll->fcoll_file_iwrite_all (fp,
|
||||
buf,
|
||||
count,
|
||||
datatype,
|
||||
request);
|
||||
}
|
||||
else {
|
||||
/* this fcoll component does not support non-blocking
|
||||
collective I/O operations. WE fake it with
|
||||
individual non-blocking I/O operations. */
|
||||
ret = ompio_io_ompio_file_iwrite ( fp, buf, count, datatype, request );
|
||||
}
|
||||
|
||||
ompi_io_ompio_set_explicit_offset (fp, prev_offset);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Infrastructure for shared file pointer operations */
|
||||
/* (Individual and collective */
|
||||
@ -806,7 +400,7 @@ int mca_io_ompio_file_write_at_all_begin (ompi_file_t *fh,
|
||||
printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n");
|
||||
return MPI_ERR_REQUEST;
|
||||
}
|
||||
ret = ompio_io_ompio_file_iwrite_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req );
|
||||
ret = mca_common_ompio_file_iwrite_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req );
|
||||
fp->f_split_coll_in_use = true;
|
||||
|
||||
return ret;
|
||||
|
@ -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) 2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -23,7 +23,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include <semaphore.h>
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -66,7 +66,7 @@ int mca_sharedfp_addproc_iread(mca_io_ompio_file_t *fh,
|
||||
"mca_sharedfp_addproc_iread: Offset received is %lld\n",offset);
|
||||
}
|
||||
/* Read from the file */
|
||||
ret = ompio_io_ompio_file_iread_at ( sh->sharedfh, offset, buf, count, datatype, request);
|
||||
ret = mca_common_ompio_file_iread_at ( sh->sharedfh, offset, buf, count, datatype, request);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -180,7 +180,7 @@ int mca_sharedfp_addproc_read_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* read from the file */
|
||||
ret = ompio_io_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req);
|
||||
ret = mca_common_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req);
|
||||
fh->f_split_coll_in_use = true;
|
||||
|
||||
exit:
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -64,7 +64,7 @@ int mca_sharedfp_addproc_iwrite(mca_io_ompio_file_t *fh,
|
||||
"sharedfp_addproc_iwrite: Offset received is %lld\n",offset);
|
||||
}
|
||||
/* Write to the file */
|
||||
ret = ompio_io_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -176,7 +176,7 @@ int mca_sharedfp_addproc_write_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* write to the file */
|
||||
ret = ompio_io_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req);
|
||||
ret = mca_common_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req);
|
||||
fh->f_split_coll_in_use = true;
|
||||
|
||||
exit:
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -62,7 +62,7 @@ int mca_sharedfp_addproc_read ( mca_io_ompio_file_t *fh,
|
||||
"mca_sharedfp_addproc_read: Offset received is %lld\n",offset);
|
||||
}
|
||||
/* Read from the file */
|
||||
ret = ompio_io_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -172,7 +172,7 @@ int mca_sharedfp_addproc_read_ordered (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* read from the file */
|
||||
ret = ompio_io_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
|
||||
exit:
|
||||
if ( NULL != buff ) {
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -65,7 +65,7 @@ int mca_sharedfp_addproc_write (mca_io_ompio_file_t *fh,
|
||||
"sharedfp_addproc_write: Offset received is %lld\n",offset);
|
||||
}
|
||||
/* Write to the file */
|
||||
ret = ompio_io_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -173,7 +173,7 @@ int mca_sharedfp_addproc_write_ordered (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* write to the file */
|
||||
ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
|
||||
exit:
|
||||
if ( NULL != buff ) {
|
||||
|
@ -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-2013 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -28,7 +28,7 @@
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||
#include "ompi/mca/sharedfp/base/base.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
/*
|
||||
* This structure is needed so that we can close the modules
|
||||
|
@ -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-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -24,13 +24,14 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mpi.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "opal/util/show_help.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||
#include "ompi/mca/sharedfp/base/base.h"
|
||||
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
int mca_sharedfp_base_file_unselect(mca_io_ompio_file_t *file)
|
||||
{
|
||||
if (NULL != file->f_sharedfp && NULL != file->f_sharedfp->sharedfp_module_finalize) {
|
||||
|
@ -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) 2013 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -25,6 +25,7 @@
|
||||
#include "ompi/constants.h"
|
||||
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||
#include "ompi/mca/sharedfp/base/base.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -175,7 +176,7 @@ int mca_sharedfp_individual_collaborate_data(struct mca_sharedfp_base_data_t *sh
|
||||
}
|
||||
|
||||
/*Read from the local data file*/
|
||||
ompio_io_ompio_file_read_at ( headnode->datafilehandle,
|
||||
mca_common_ompio_file_read_at ( headnode->datafilehandle,
|
||||
local_off[i], buff, ind_recordlength[i],
|
||||
MPI_BYTE, &status);
|
||||
|
||||
@ -188,7 +189,7 @@ int mca_sharedfp_individual_collaborate_data(struct mca_sharedfp_base_data_t *sh
|
||||
}
|
||||
|
||||
/*Write into main data file*/
|
||||
ompio_io_ompio_file_write_at( sh->sharedfh, offsetbuff[idx], buff,
|
||||
mca_common_ompio_file_write_at( sh->sharedfh, offsetbuff[idx], buff,
|
||||
ind_recordlength[i], MPI_BYTE, &status);
|
||||
|
||||
}
|
||||
@ -275,7 +276,7 @@ int mca_sharedfp_individual_get_timestamps_and_reclengths ( double **buff, long
|
||||
ctr = 0;
|
||||
for (i = 0; i < headnode->numofrecordsonfile ; i++) {
|
||||
|
||||
ompio_io_ompio_file_read_at(headnode->metadatafilehandle,metaoffset, &rec, 32, MPI_BYTE,&status);
|
||||
mca_common_ompio_file_read_at(headnode->metadatafilehandle,metaoffset, &rec, 32, MPI_BYTE,&status);
|
||||
|
||||
*(*rec_length + ctr) = rec.recordlength;
|
||||
*(*buff + ctr) = rec.timestamp;
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -133,9 +133,9 @@ int mca_sharedfp_individual_write_metadata_file(struct mca_sharedfp_base_data_t
|
||||
|
||||
/*Write to the metadata file*/
|
||||
|
||||
ret = ompio_io_ompio_file_write_at ( (headnode)->metadatafilehandle,
|
||||
(headnode)->metadatafile_offset,
|
||||
&buff,32, MPI_BYTE, &status);
|
||||
ret = mca_common_ompio_file_write_at ( (headnode)->metadatafilehandle,
|
||||
(headnode)->metadatafile_offset,
|
||||
&buff,32, MPI_BYTE, &status);
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -76,8 +76,8 @@ int mca_sharedfp_individual_iwrite(mca_io_ompio_file_t *fh,
|
||||
|
||||
|
||||
/*Write the data into individual file*/
|
||||
ret = ompio_io_ompio_file_iwrite_at ( headnode->datafilehandle, headnode->datafile_offset,
|
||||
buf, count, datatype, request);
|
||||
ret = mca_common_ompio_file_iwrite_at ( headnode->datafilehandle, headnode->datafile_offset,
|
||||
buf, count, datatype, request);
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
opal_output(0,"sharedfp_individual_iwrite: Error while iwriting the datafile \n");
|
||||
return ret;
|
||||
@ -189,7 +189,7 @@ int mca_sharedfp_individual_write_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
ret = sh->comm->c_coll.coll_bcast ( &global_offset, 1, OMPI_OFFSET_DATATYPE,
|
||||
0, sh->comm, sh->comm->c_coll.coll_bcast_module );
|
||||
0, sh->comm, sh->comm->c_coll.coll_bcast_module );
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
opal_output(0,"sharedfp_individual_write_ordered_begin: Error while bcasting global offset \n");
|
||||
goto exit;
|
||||
@ -198,8 +198,8 @@ int mca_sharedfp_individual_write_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
sh->global_offset = global_offset;
|
||||
|
||||
/*use file_write_at_all to ensure the order*/
|
||||
ret = ompio_io_ompio_file_iwrite_at_all(sh->sharedfh,offset, buf,count,datatype,
|
||||
&fh->f_split_coll_req);
|
||||
ret = mca_common_ompio_file_iwrite_at_all(sh->sharedfh,offset, buf,count,datatype,
|
||||
&fh->f_split_coll_req);
|
||||
fh->f_split_coll_in_use = true;
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
opal_output(0,"sharedfp_individual_write_ordered_begin: Error while writing the datafile \n");
|
||||
|
@ -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) 2013 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -71,9 +71,9 @@ int mca_sharedfp_individual_write (mca_io_ompio_file_t *fh,
|
||||
mca_sharedfp_individual_insert_metadata(OMPI_FILE_WRITE_SHARED, totalbytes, sh);
|
||||
|
||||
/*Write the data into individual file*/
|
||||
ret = ompio_io_ompio_file_write_at ( headnode->datafilehandle,
|
||||
headnode->datafile_offset,
|
||||
buf, count, datatype, status);
|
||||
ret = mca_common_ompio_file_write_at ( headnode->datafilehandle,
|
||||
headnode->datafile_offset,
|
||||
buf, count, datatype, status);
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
opal_output(0,"mca_sharedfp_individual_write: Error while writing the datafile \n");
|
||||
return -1;
|
||||
@ -191,7 +191,7 @@ int mca_sharedfp_individual_write_ordered (mca_io_ompio_file_t *fh,
|
||||
sh->global_offset = global_offset;
|
||||
|
||||
/*use file_write_at_all to ensure the order*/
|
||||
ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset, buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset, buf,count,datatype,status);
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
opal_output(0,"sharedfp_individual_write_ordered: Error while writing the datafile \n");
|
||||
}
|
||||
|
@ -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) 2013 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -25,7 +25,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -82,7 +82,7 @@ int mca_sharedfp_lockedfile_iread(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* Read the file */
|
||||
ret = ompio_io_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -205,7 +205,7 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
"sharedfp_lockedfile_read_ordered_begin: Offset returned is %lld\n",offset);
|
||||
}
|
||||
|
||||
ret = ompio_io_ompio_file_iread_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req );
|
||||
ret = mca_common_ompio_file_iread_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req );
|
||||
fh->f_split_coll_in_use = true;
|
||||
|
||||
exit:
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -82,7 +82,7 @@ int mca_sharedfp_lockedfile_iwrite(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* Write to the file */
|
||||
ret = ompio_io_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -204,7 +204,7 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
"sharedfp_lockedfile_write_ordered_begin: Offset returned is %lld\n",offset);
|
||||
}
|
||||
|
||||
ret = ompio_io_ompio_file_iwrite_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req );
|
||||
ret = mca_common_ompio_file_iwrite_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req );
|
||||
fh->f_split_coll_in_use = true;
|
||||
|
||||
exit:
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -77,7 +77,7 @@ int mca_sharedfp_lockedfile_read ( mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* Read the file */
|
||||
ret = ompio_io_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -192,7 +192,7 @@ int mca_sharedfp_lockedfile_read_ordered (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* read to the file */
|
||||
ret = ompio_io_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
|
||||
exit:
|
||||
if ( NULL != buff ) {
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -80,7 +80,7 @@ int mca_sharedfp_lockedfile_write (mca_io_ompio_file_t *fh,
|
||||
"sharedfp_lockedfile_write: Offset received is %lld\n",offset);
|
||||
}
|
||||
/* Write to the file */
|
||||
ret = ompio_io_ompio_file_write_at ( sh->sharedfh, offset, buf, count, datatype, status);
|
||||
ret = mca_common_ompio_file_write_at ( sh->sharedfh, offset, buf, count, datatype, status);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -199,7 +199,7 @@ int mca_sharedfp_lockedfile_write_ordered (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* write to the file */
|
||||
ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
|
||||
exit:
|
||||
if ( NULL != buff ) {
|
||||
|
@ -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-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/mca/mca.h"
|
||||
#include "ompi/mca/sharedfp/sharedfp.h"
|
||||
#include "ompi/mca/io/ompio/io_ompio.h"
|
||||
#include "ompi/mca/common/ompio/common_ompio.h"
|
||||
#include <semaphore.h>
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -78,7 +78,7 @@ int mca_sharedfp_sm_iread(mca_io_ompio_file_t *fh,
|
||||
"sharedfp_sm_iread: Offset received is %lld\n",offset);
|
||||
}
|
||||
/* Read the file */
|
||||
ret = ompio_io_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -202,7 +202,7 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* read to the file */
|
||||
ret = ompio_io_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype,
|
||||
ret = mca_common_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype,
|
||||
&fh->f_split_coll_req);
|
||||
fh->f_split_coll_in_use = true;
|
||||
|
||||
|
@ -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) 2013 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -80,7 +80,7 @@ int mca_sharedfp_sm_iwrite(mca_io_ompio_file_t *fh,
|
||||
"sharedfp_sm_iwrite: Offset received is %lld\n",offset);
|
||||
}
|
||||
/* Write to the file */
|
||||
ret = ompio_io_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
ret = mca_common_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -205,7 +205,7 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* read to the file */
|
||||
ret = ompio_io_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype,
|
||||
ret = mca_common_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype,
|
||||
&fh->f_split_coll_req);
|
||||
fh->f_split_coll_in_use = true;
|
||||
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -77,7 +77,7 @@ int mca_sharedfp_sm_read ( mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* Read the file */
|
||||
ret = ompio_io_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -195,7 +195,7 @@ int mca_sharedfp_sm_read_ordered (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* read to the file */
|
||||
ret = ompio_io_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
|
||||
exit:
|
||||
if ( NULL != buff ) {
|
||||
|
@ -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) 2013-2015 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2013-2016 University of Houston. All rights reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -81,7 +81,7 @@ int mca_sharedfp_sm_write (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
/* Write to the file*/
|
||||
ret = ompio_io_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -202,7 +202,7 @@ int mca_sharedfp_sm_write_ordered (mca_io_ompio_file_t *fh,
|
||||
"sharedfp_sm_write_ordered: Offset returned is %lld\n",offset);
|
||||
}
|
||||
/* write to the file */
|
||||
ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status);
|
||||
|
||||
exit:
|
||||
if ( NULL != buff ) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user