Skip to content

Commit

Permalink
Merge pull request #12361 from jtronge/io-framework-bigcount
Browse files Browse the repository at this point in the history
Prepare ompio frameworks for bigcount
  • Loading branch information
hppritcha authored Mar 4, 2024
2 parents 4b5fad4 + 03d8ba8 commit 067545a
Show file tree
Hide file tree
Showing 121 changed files with 979 additions and 627 deletions.
6 changes: 3 additions & 3 deletions ompi/file/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 University of Houston. All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
* Copyright (c) 2018 Triad National Security, LLC. All rights
* Copyright (c) 2024 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -289,8 +289,8 @@ static void file_destructor(ompi_file_t *file)
/* Finalize the module */

switch (file->f_io_version) {
case MCA_IO_BASE_V_2_0_0:
file->f_io_selected_module.v2_0_0.io_module_file_close(file);
case MCA_IO_BASE_V_3_0_0:
file->f_io_selected_module.v3_0_0.io_module_file_close(file);
break;
default:
/* Should never get here */
Expand Down
38 changes: 20 additions & 18 deletions ompi/mca/common/ompio/common_ompio.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018 DataDirect Networks. All rights reserved.
* Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (c) 2024 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -249,34 +251,34 @@ typedef struct mca_common_ompio_data_t mca_common_ompio_data_t;
#include "common_ompio_print_queue.h"
#include "common_ompio_aggregators.h"

OMPI_DECLSPEC int mca_common_ompio_file_write (ompio_file_t *fh, const void *buf, int count,
OMPI_DECLSPEC int mca_common_ompio_file_write (ompio_file_t *fh, const void *buf, size_t count,
struct ompi_datatype_t *datatype,
ompi_status_public_t *status);

OMPI_DECLSPEC int mca_common_ompio_file_write_at (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status);

OMPI_DECLSPEC int mca_common_ompio_file_iwrite (ompio_file_t *fh, const void *buf, int count,
OMPI_DECLSPEC int mca_common_ompio_file_iwrite (ompio_file_t *fh, const void *buf, size_t count,
struct ompi_datatype_t *datatype, ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset,
const void *buf, int count, struct ompi_datatype_t *datatype,
const void *buf, size_t count, struct ompi_datatype_t *datatype,
ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_file_write_all (ompio_file_t *fh, const void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status);

OMPI_DECLSPEC int mca_common_ompio_file_write_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status);

OMPI_DECLSPEC int mca_common_ompio_file_iwrite_all (ompio_file_t *fp, const void *buf,
int count, struct ompi_datatype_t *datatype, ompi_request_t **request);
size_t count, struct ompi_datatype_t *datatype, ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, const void *buf,
int count, struct ompi_datatype_t *datatype, ompi_request_t **request);
size_t count, struct ompi_datatype_t *datatype, ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_build_io_array ( ompio_fview_t *fview, int index, int cycles,
size_t bytes_per_cycle, size_t max_data, uint32_t iov_count,
Expand All @@ -285,32 +287,32 @@ OMPI_DECLSPEC int mca_common_ompio_build_io_array ( ompio_fview_t *fview, int in
int *num_io_entries );


OMPI_DECLSPEC int mca_common_ompio_file_read (ompio_file_t *fh, void *buf, int count,
OMPI_DECLSPEC int mca_common_ompio_file_read (ompio_file_t *fh, void *buf, size_t count,
struct ompi_datatype_t *datatype, ompi_status_public_t *status);

OMPI_DECLSPEC int mca_common_ompio_file_read_at (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t * status);

OMPI_DECLSPEC int mca_common_ompio_file_iread (ompio_file_t *fh, void *buf, int count,
OMPI_DECLSPEC int mca_common_ompio_file_iread (ompio_file_t *fh, void *buf, size_t count,
struct ompi_datatype_t *datatype, ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_file_iread_at (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset,
void *buf, int count, struct ompi_datatype_t *datatype,
void *buf, size_t count, struct ompi_datatype_t *datatype,
ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_file_read_all (ompio_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype,
OMPI_DECLSPEC int mca_common_ompio_file_read_all (ompio_file_t *fh, void *buf, size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t * status);

OMPI_DECLSPEC int mca_common_ompio_file_read_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset,
void *buf, int count, struct ompi_datatype_t *datatype,
void *buf, size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t * status);

OMPI_DECLSPEC int mca_common_ompio_file_iread_all (ompio_file_t *fp, void *buf, int count, struct ompi_datatype_t *datatype,
OMPI_DECLSPEC int mca_common_ompio_file_iread_all (ompio_file_t *fp, void *buf, size_t count, struct ompi_datatype_t *datatype,
ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_file_iread_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset,
void *buf, int count, struct ompi_datatype_t *datatype,
void *buf, size_t count, struct ompi_datatype_t *datatype,
ompi_request_t **request);

OMPI_DECLSPEC int mca_common_ompio_file_open (ompi_communicator_t *comm, const char *filename,
Expand All @@ -330,7 +332,7 @@ OMPI_DECLSPEC int mca_common_ompio_set_file_defaults (ompio_file_t *fh);
OMPI_DECLSPEC int mca_common_ompio_set_view (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE disp,
ompi_datatype_t *etype, ompi_datatype_t *filetype, const char *datarep,
opal_info_t *info);
OMPI_DECLSPEC int mca_common_ompio_base_file_read_all (struct ompio_file_t *fh, void *buf, int count,
OMPI_DECLSPEC int mca_common_ompio_base_file_read_all (struct ompio_file_t *fh, void *buf, size_t count,
struct ompi_datatype_t *datatype, ompi_status_public_t *status);


Expand All @@ -341,7 +343,7 @@ OMPI_DECLSPEC int mca_common_ompio_base_file_read_all (struct ompio_file_t *fh,
*/
OMPI_DECLSPEC int mca_common_ompio_decode_datatype (struct ompio_file_t *fh,
struct ompi_datatype_t *datatype,
int count,
size_t count,
const void *buf,
size_t *max_data,
opal_convertor_t *convertor,
Expand Down
10 changes: 6 additions & 4 deletions ompi/mca/common/ompio/common_ompio_aggregators.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
* Copyright (c) 2024 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -1048,19 +1050,19 @@ int mca_common_ompio_merge_groups(ompio_file_t *fh,
int num_merge_aggrs)
{
int i = 0;
int *sizes_old_group;
size_t *sizes_old_group;
int ret;
int *displs = NULL;
ptrdiff_t *displs = NULL;

sizes_old_group = (int*)malloc(num_merge_aggrs * sizeof(int));
sizes_old_group = (size_t *)malloc(num_merge_aggrs * sizeof(size_t));
if (NULL == sizes_old_group) {
opal_output (1, "OUT OF MEMORY\n");
ret = OMPI_ERR_OUT_OF_RESOURCE;
goto exit;
}


displs = (int*)malloc(num_merge_aggrs * sizeof(int));
displs = (ptrdiff_t *)malloc(num_merge_aggrs * sizeof(ptrdiff_t));
if (NULL == displs) {
opal_output (1, "OUT OF MEMORY\n");
ret = OMPI_ERR_OUT_OF_RESOURCE;
Expand Down
4 changes: 3 additions & 1 deletion ompi/mca/common/ompio/common_ompio_file_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2018 DataDirect Networks. All rights reserved.
* Copyright (c) 2024 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -591,7 +593,7 @@ int mca_common_ompio_create_incomplete_file_handle (const char *filename,

int mca_common_ompio_decode_datatype (struct ompio_file_t *fh,
ompi_datatype_t *datatype,
int count,
size_t count,
const void *buf,
size_t *max_data,
opal_convertor_t *conv,
Expand Down
26 changes: 14 additions & 12 deletions ompi/mca/common/ompio/common_ompio_file_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (c) 2024 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -55,16 +57,16 @@
*/

static int mca_common_ompio_file_read_default (ompio_file_t *fh, void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status);

static int mca_common_ompio_file_read_pipelined (ompio_file_t *fh, void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status);

int mca_common_ompio_file_read (ompio_file_t *fh,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_status_public_t *status)
{
Expand Down Expand Up @@ -109,7 +111,7 @@ int mca_common_ompio_file_read (ompio_file_t *fh,
}

int mca_common_ompio_file_read_default (ompio_file_t *fh, void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status)
{
size_t total_bytes_read = 0; /* total bytes that have been read*/
Expand Down Expand Up @@ -171,7 +173,7 @@ int mca_common_ompio_file_read_default (ompio_file_t *fh, void *buf,
}

int mca_common_ompio_file_read_pipelined (ompio_file_t *fh, void *buf,
int count, struct ompi_datatype_t *datatype,
size_t count, struct ompi_datatype_t *datatype,
ompi_status_public_t *status)
{
size_t tbr = 0; /* total bytes that have been read*/
Expand Down Expand Up @@ -322,7 +324,7 @@ int mca_common_ompio_file_read_pipelined (ompio_file_t *fh, void *buf,
int mca_common_ompio_file_read_at (ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE offset,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_status_public_t * status)
{
Expand Down Expand Up @@ -403,7 +405,7 @@ static void mca_common_ompio_post_next_read_subreq(struct mca_ompio_request_t *r

int mca_common_ompio_file_iread (ompio_file_t *fh,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_request_t **request)
{
Expand Down Expand Up @@ -531,7 +533,7 @@ int mca_common_ompio_file_iread (ompio_file_t *fh,
int mca_common_ompio_file_iread_at (ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE offset,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_request_t **request)
{
Expand Down Expand Up @@ -563,7 +565,7 @@ int mca_common_ompio_file_iread_at (ompio_file_t *fh,
/* Infrastructure for collective operations */
int mca_common_ompio_file_read_all (ompio_file_t *fh,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_status_public_t * status)
{
Expand Down Expand Up @@ -617,7 +619,7 @@ int mca_common_ompio_file_read_all (ompio_file_t *fh,
int mca_common_ompio_file_read_at_all (ompio_file_t *fh,
OMPI_MPI_OFFSET_TYPE offset,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_status_public_t * status)
{
Expand All @@ -638,7 +640,7 @@ int mca_common_ompio_file_read_at_all (ompio_file_t *fh,

int mca_common_ompio_file_iread_all (ompio_file_t *fp,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_request_t **request)
{
Expand All @@ -664,7 +666,7 @@ int mca_common_ompio_file_iread_all (ompio_file_t *fp,
int mca_common_ompio_file_iread_at_all (ompio_file_t *fp,
OMPI_MPI_OFFSET_TYPE offset,
void *buf,
int count,
size_t count,
struct ompi_datatype_t *datatype,
ompi_request_t **request)
{
Expand Down
Loading

0 comments on commit 067545a

Please sign in to comment.