Skip to content

Commit d7363c9

Browse files
committed
Merge pull request open-mpi#401 from edgargabriel/pr/nb-coll-part2
Pr/nb coll part2
2 parents 1fef4c1 + aed305b commit d7363c9

34 files changed

+1654
-5
lines changed

ompi/include/mpi.h.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
1717
* reserved.
1818
* Copyright (c) 2011-2013 INRIA. All rights reserved.
19+
* Copyright (c) 2015 University of Houston. All rights reserved.
1920
* $COPYRIGHT$
2021
*
2122
* Additional copyrights may follow
@@ -1385,6 +1386,10 @@ OMPI_DECLSPEC int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf,
13851386
int count, MPI_Datatype datatype, MPI_Request *request);
13861387
OMPI_DECLSPEC int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf,
13871388
int count, MPI_Datatype datatype, MPI_Request *request);
1389+
OMPI_DECLSPEC int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf,
1390+
int count, MPI_Datatype datatype, MPI_Request *request);
1391+
OMPI_DECLSPEC int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf,
1392+
int count, MPI_Datatype datatype, MPI_Request *request);
13881393
OMPI_DECLSPEC int MPI_File_read(MPI_File fh, void *buf, int count,
13891394
MPI_Datatype datatype, MPI_Status *status);
13901395
OMPI_DECLSPEC int MPI_File_read_all(MPI_File fh, void *buf, int count,
@@ -1397,6 +1402,10 @@ OMPI_DECLSPEC int MPI_File_iread(MPI_File fh, void *buf, int count,
13971402
MPI_Datatype datatype, MPI_Request *request);
13981403
OMPI_DECLSPEC int MPI_File_iwrite(MPI_File fh, const void *buf, int count,
13991404
MPI_Datatype datatype, MPI_Request *request);
1405+
OMPI_DECLSPEC int MPI_File_iread_all(MPI_File fh, void *buf, int count,
1406+
MPI_Datatype datatype, MPI_Request *request);
1407+
OMPI_DECLSPEC int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count,
1408+
MPI_Datatype datatype, MPI_Request *request);
14001409
OMPI_DECLSPEC int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
14011410
OMPI_DECLSPEC int MPI_File_get_position(MPI_File fh, MPI_Offset *offset);
14021411
OMPI_DECLSPEC int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset,
@@ -2077,6 +2086,10 @@ OMPI_DECLSPEC int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf,
20772086
int count, MPI_Datatype datatype, MPI_Request *request);
20782087
OMPI_DECLSPEC int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf,
20792088
int count, MPI_Datatype datatype, MPI_Request *request);
2089+
OMPI_DECLSPEC int PMPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf,
2090+
int count, MPI_Datatype datatype, MPI_Request *request);
2091+
OMPI_DECLSPEC int PMPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf,
2092+
int count, MPI_Datatype datatype, MPI_Request *request);
20802093
OMPI_DECLSPEC int PMPI_File_read(MPI_File fh, void *buf, int count,
20812094
MPI_Datatype datatype, MPI_Status *status);
20822095
OMPI_DECLSPEC int PMPI_File_read_all(MPI_File fh, void *buf, int count,
@@ -2089,6 +2102,10 @@ OMPI_DECLSPEC int PMPI_File_iread(MPI_File fh, void *buf, int count,
20892102
MPI_Datatype datatype, MPI_Request *request);
20902103
OMPI_DECLSPEC int PMPI_File_iwrite(MPI_File fh, const void *buf, int count,
20912104
MPI_Datatype datatype, MPI_Request *request);
2105+
OMPI_DECLSPEC int PMPI_File_iread_all(MPI_File fh, void *buf, int count,
2106+
MPI_Datatype datatype, MPI_Request *request);
2107+
OMPI_DECLSPEC int PMPI_File_iwrite_all(MPI_File fh, const void *buf, int count,
2108+
MPI_Datatype datatype, MPI_Request *request);
20922109
OMPI_DECLSPEC int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
20932110
OMPI_DECLSPEC int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset);
20942111
OMPI_DECLSPEC int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset,

ompi/mca/io/io.h

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
1414
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
16+
* Copyright (c) 2015 University of Houston. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -188,6 +189,15 @@ typedef int (*mca_io_base_module_file_iwrite_at_fn_t)
188189
int count, struct ompi_datatype_t *datatype,
189190
struct ompi_request_t **request);
190191

192+
typedef int (*mca_io_base_module_file_iread_at_all_fn_t)
193+
(struct ompi_file_t *fh, MPI_Offset offset, void *buf,
194+
int count, struct ompi_datatype_t *datatype,
195+
struct ompi_request_t **request);
196+
typedef int (*mca_io_base_module_file_iwrite_at_all_fn_t)
197+
(struct ompi_file_t *fh, MPI_Offset offset, void *buf,
198+
int count, struct ompi_datatype_t *datatype,
199+
struct ompi_request_t **request);
200+
191201
typedef int (*mca_io_base_module_file_read_fn_t)
192202
(struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *
193203
datatype, struct ompi_status_public_t *status);
@@ -208,6 +218,13 @@ typedef int (*mca_io_base_module_file_iwrite_fn_t)
208218
(struct ompi_file_t *fh, void *buf, int count,
209219
struct ompi_datatype_t *datatype, struct ompi_request_t **request);
210220

221+
typedef int (*mca_io_base_module_file_iread_all_fn_t)
222+
(struct ompi_file_t *fh, void *buf, int count,
223+
struct ompi_datatype_t *datatype, struct ompi_request_t **request);
224+
typedef int (*mca_io_base_module_file_iwrite_all_fn_t)
225+
(struct ompi_file_t *fh, void *buf, int count,
226+
struct ompi_datatype_t *datatype, struct ompi_request_t **request);
227+
211228
typedef int (*mca_io_base_module_file_seek_fn_t)
212229
(struct ompi_file_t *fh, MPI_Offset offset, int whence);
213230
typedef int (*mca_io_base_module_file_get_position_fn_t)
@@ -300,18 +317,22 @@ struct mca_io_base_module_2_0_0_t {
300317
mca_io_base_module_file_read_at_all_fn_t io_module_file_read_at_all;
301318
mca_io_base_module_file_write_at_fn_t io_module_file_write_at;
302319
mca_io_base_module_file_write_at_all_fn_t io_module_file_write_at_all;
303-
304-
mca_io_base_module_file_iread_at_fn_t io_module_file_iread_at;
305-
mca_io_base_module_file_iwrite_at_fn_t io_module_file_iwrite_at;
306-
320+
321+
mca_io_base_module_file_iread_at_fn_t io_module_file_iread_at;
322+
mca_io_base_module_file_iwrite_at_fn_t io_module_file_iwrite_at;
323+
mca_io_base_module_file_iread_at_all_fn_t io_module_file_iread_at_all;
324+
mca_io_base_module_file_iwrite_at_all_fn_t io_module_file_iwrite_at_all;
325+
307326
mca_io_base_module_file_read_fn_t io_module_file_read;
308327
mca_io_base_module_file_read_all_fn_t io_module_file_read_all;
309328
mca_io_base_module_file_write_fn_t io_module_file_write;
310329
mca_io_base_module_file_write_all_fn_t io_module_file_write_all;
311330

312331
mca_io_base_module_file_iread_fn_t io_module_file_iread;
313332
mca_io_base_module_file_iwrite_fn_t io_module_file_iwrite;
314-
333+
mca_io_base_module_file_iread_all_fn_t io_module_file_iread_all;
334+
mca_io_base_module_file_iwrite_all_fn_t io_module_file_iwrite_all;
335+
315336
mca_io_base_module_file_seek_fn_t io_module_file_seek;
316337
mca_io_base_module_file_get_position_fn_t io_module_file_get_position;
317338
mca_io_base_module_file_get_byte_offset_fn_t io_module_file_get_byte_offset;

ompi/mca/io/ompio/io_ompio_module.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ mca_io_base_module_2_0_0_t mca_io_ompio_module = {
4949

5050
mca_io_ompio_file_iread_at,
5151
mca_io_ompio_file_iwrite_at,
52+
mca_io_ompio_file_iread_at_all,
53+
mca_io_ompio_file_iwrite_at_all,
5254

5355
/* non-indexed IO operations */
5456
mca_io_ompio_file_read,
@@ -58,6 +60,8 @@ mca_io_base_module_2_0_0_t mca_io_ompio_module = {
5860

5961
mca_io_ompio_file_iread,
6062
mca_io_ompio_file_iwrite,
63+
mca_io_ompio_file_iread_all,
64+
mca_io_ompio_file_iwrite_all,
6165

6266
mca_io_ompio_file_seek,
6367
mca_io_ompio_file_get_position,

ompi/mca/io/romio314/src/io_romio314_module.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ mca_io_base_module_2_0_0_t mca_io_romio314_module = {
5959
mca_io_romio314_file_write_at_all,
6060
mca_io_romio314_file_iread_at,
6161
mca_io_romio314_file_iwrite_at,
62+
NULL, /* iread_at_all */
63+
NULL, /* iwrite_at_all */
6264

6365
/* non-indexed IO operations */
6466
mca_io_romio314_file_read,
@@ -67,6 +69,8 @@ mca_io_base_module_2_0_0_t mca_io_romio314_module = {
6769
mca_io_romio314_file_write_all,
6870
mca_io_romio314_file_iread,
6971
mca_io_romio314_file_iwrite,
72+
NULL, /* iread_all */
73+
NULL, /* iwrite_all */
7074

7175
mca_io_romio314_file_seek,
7276
mca_io_romio314_file_get_position,

ompi/mpi/c/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,14 @@ libmpi_c_mpi_la_SOURCES += \
406406
file_get_type_extent.c \
407407
file_get_view.c \
408408
file_iread_at.c \
409+
file_iread_at_all.c \
409410
file_iread.c \
411+
file_iread_all.c \
410412
file_iread_shared.c \
411413
file_iwrite_at.c \
414+
file_iwrite_at_all.c \
412415
file_iwrite.c \
416+
file_iwrite_all.c \
413417
file_iwrite_shared.c \
414418
file_open.c \
415419
file_preallocate.c \

ompi/mpi/c/file_iread_all.c

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
13+
* Copyright (c) 2015 University of Houston. All rights reserved.
14+
* $COPYRIGHT$
15+
*
16+
* Additional copyrights may follow
17+
*
18+
* $HEADER$
19+
*/
20+
21+
#include "ompi_config.h"
22+
23+
#include "ompi/mpi/c/bindings.h"
24+
#include "ompi/runtime/params.h"
25+
#include "ompi/errhandler/errhandler.h"
26+
#include "ompi/datatype/ompi_datatype.h"
27+
#include "ompi/file/file.h"
28+
#include "ompi/mca/io/io.h"
29+
#include "ompi/mca/io/base/io_base_request.h"
30+
#include "ompi/memchecker.h"
31+
32+
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
33+
#pragma weak MPI_File_iread_all = PMPI_File_iread_all
34+
#endif
35+
36+
#if OMPI_PROFILING_DEFINES
37+
#include "ompi/mpi/c/profile/defines.h"
38+
#endif
39+
40+
static const char FUNC_NAME[] = "MPI_File_iread_all";
41+
42+
43+
int MPI_File_iread_all(MPI_File fh, void *buf, int count,
44+
MPI_Datatype datatype, MPI_Request *request)
45+
{
46+
int rc;
47+
48+
MEMCHECKER(
49+
memchecker_datatype(datatype);
50+
);
51+
52+
if (MPI_PARAM_CHECK) {
53+
rc = MPI_SUCCESS;
54+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
55+
if (ompi_file_invalid(fh)) {
56+
fh = MPI_FILE_NULL;
57+
rc = MPI_ERR_FILE;
58+
} else if (count < 0) {
59+
rc = MPI_ERR_COUNT;
60+
} else if (NULL == request) {
61+
rc = MPI_ERR_REQUEST;
62+
} else {
63+
OMPI_CHECK_DATATYPE_FOR_RECV(rc, datatype, count);
64+
}
65+
OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME);
66+
}
67+
68+
OPAL_CR_ENTER_LIBRARY();
69+
70+
/* Call the back-end io component function */
71+
switch (fh->f_io_version) {
72+
case MCA_IO_BASE_V_2_0_0:
73+
rc = fh->f_io_selected_module.v2_0_0.
74+
io_module_file_iread_all(fh, buf, count, datatype, request);
75+
break;
76+
77+
default:
78+
rc = MPI_ERR_INTERN;
79+
break;
80+
}
81+
82+
/* All done */
83+
OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME);
84+
}

ompi/mpi/c/file_iread_at_all.c

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
13+
* Copyright (c) 2015 University of Houston. All rights reserved.
14+
* $COPYRIGHT$
15+
*
16+
* Additional copyrights may follow
17+
*
18+
* $HEADER$
19+
*/
20+
21+
#include "ompi_config.h"
22+
23+
#include "ompi/mpi/c/bindings.h"
24+
#include "ompi/runtime/params.h"
25+
#include "ompi/errhandler/errhandler.h"
26+
#include "ompi/datatype/ompi_datatype.h"
27+
#include "ompi/file/file.h"
28+
#include "ompi/mca/io/io.h"
29+
#include "ompi/mca/io/base/io_base_request.h"
30+
#include "ompi/memchecker.h"
31+
32+
#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
33+
#pragma weak MPI_File_iread_at_all = PMPI_File_iread_at_all
34+
#endif
35+
36+
#if OMPI_PROFILING_DEFINES
37+
#include "ompi/mpi/c/profile/defines.h"
38+
#endif
39+
40+
static const char FUNC_NAME[] = "MPI_File_iread_at_all";
41+
42+
43+
int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf,
44+
int count, MPI_Datatype datatype, MPI_Request *request)
45+
{
46+
int rc;
47+
48+
MEMCHECKER(
49+
memchecker_datatype(datatype);
50+
);
51+
52+
if (MPI_PARAM_CHECK) {
53+
rc = MPI_SUCCESS;
54+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
55+
if (ompi_file_invalid(fh)) {
56+
fh = MPI_FILE_NULL;
57+
rc = MPI_ERR_FILE;
58+
} else if (count < 0) {
59+
rc = MPI_ERR_COUNT;
60+
} else if (NULL == request) {
61+
rc = MPI_ERR_REQUEST;
62+
} else {
63+
OMPI_CHECK_DATATYPE_FOR_RECV(rc, datatype, count);
64+
}
65+
OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME);
66+
}
67+
68+
OPAL_CR_ENTER_LIBRARY();
69+
70+
/* Call the back-end io component function */
71+
switch (fh->f_io_version) {
72+
case MCA_IO_BASE_V_2_0_0:
73+
rc = fh->f_io_selected_module.v2_0_0.
74+
io_module_file_iread_at_all(fh, offset, buf, count, datatype,
75+
request);
76+
break;
77+
78+
default:
79+
rc = MPI_ERR_INTERN;
80+
break;
81+
}
82+
83+
/* All done */
84+
85+
OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME);
86+
}

0 commit comments

Comments
 (0)