Skip to content

Commit ced48f8

Browse files
committed
Add more generated fortran functions
Signed-off-by: Jake Tronge <jtronge@lanl.gov>
1 parent 569efa1 commit ced48f8

26 files changed

+90
-637
lines changed

ompi/mpi/bindings/ompi_bindings/fortran_type.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,17 @@ def use(self):
473473

474474
def c_parameter(self):
475475
return f'MPI_Fint *{self.name}'
476+
477+
478+
@FortranType.add('OFFSET')
479+
class Offset(FortranType):
480+
"""MPI_Offset type."""
481+
482+
def declare(self):
483+
return f'INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: {self.name}'
484+
485+
def use(self):
486+
return [('mpi_f08_types', 'MPI_OFFSET_KIND')]
487+
488+
def c_parameter(self):
489+
return f'MPI_Offset *{self.name}'

ompi/mpi/bindings/ompi_bindings/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def load(fname, prefix=None, type_constructor=None):
105105
header.append(line)
106106

107107
if not prototype:
108-
raise RuntimeError('missing prototype')
108+
raise RuntimeError(f'missing prototype for {fname}')
109109
# Parse the prototype
110110
prototype = ''.join(prototype)
111111
prototype = prototype[len('PROTOTYPE'):]

ompi/mpi/fortran/use-mpi-f08/Makefile.am

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ mpi_api_files = \
127127
barrier_f08.F90 \
128128
barrier_init_f08.F90 \
129129
bcast_init_f08.F90 \
130-
bsend_init_f08.F90 \
131-
buffer_attach_f08.F90 \
132130
buffer_detach_f08.F90 \
133131
cancel_f08.F90 \
134132
cart_coords_f08.F90 \
@@ -177,7 +175,6 @@ mpi_api_files = \
177175
comm_split_f08.F90 \
178176
comm_split_type_f08.F90 \
179177
comm_test_inter_f08.F90 \
180-
compare_and_swap_f08.F90 \
181178
dist_graph_create_adjacent_f08.F90 \
182179
dist_graph_create_f08.F90 \
183180
dist_graph_neighbors_count_f08.F90 \
@@ -186,10 +183,8 @@ mpi_api_files = \
186183
errhandler_free_f08.F90 \
187184
error_class_f08.F90 \
188185
error_string_f08.F90 \
189-
exscan_f08.F90 \
190186
exscan_init_f08.F90 \
191187
f_sync_reg_f08.F90 \
192-
fetch_and_op_f08.F90 \
193188
file_call_errhandler_f08.F90 \
194189
file_close_f08.F90 \
195190
file_create_errhandler_f08.F90 \
@@ -205,15 +200,9 @@ mpi_api_files = \
205200
file_get_size_f08.F90 \
206201
file_get_type_extent_f08.F90 \
207202
file_get_view_f08.F90 \
208-
file_iread_at_f08.F90 \
209-
file_iread_f08.F90 \
210-
file_iread_at_all_f08.F90 \
211-
file_iread_all_f08.F90 \
212-
file_iread_shared_f08.F90 \
213203
file_iwrite_at_f08.F90 \
214204
file_iwrite_f08.F90 \
215205
file_iwrite_at_all_f08.F90 \
216-
file_iwrite_all_f08.F90 \
217206
file_iwrite_shared_f08.F90 \
218207
file_open_f08.F90 \
219208
file_preallocate_f08.F90 \

ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,20 @@ ready_prototype_files = \
139139
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/alltoallw_ts.c.in \
140140
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/bcast_ts.c.in \
141141
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/bsend_ts.c.in \
142+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/bsend_init_ts.c.in \
143+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in \
144+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in \
145+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in \
142146
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/send_ts.c.in \
143147
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/recv_ts.c.in \
144148
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/isend_ts.c.in \
145149
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/irecv_ts.c.in \
150+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_all_ts.c.in \
151+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_at_all_ts.c.in \
152+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_at_ts.c.in \
153+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_ts.c.in \
154+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in \
155+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in \
146156
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_ts.c.in \
147157
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in \
148158
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/waitall.c.in \

ompi/mpi/fortran/use-mpi-f08/bsend_init_f08.F90

Lines changed: 0 additions & 32 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/bsend_init_ts.c.in

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,16 @@
1919
* $HEADER$
2020
*/
2121

22-
#include "ompi_config.h"
23-
24-
#include "ompi/communicator/communicator.h"
25-
#include "ompi/errhandler/errhandler.h"
26-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27-
#include "ompi/mpi/fortran/base/constants.h"
28-
29-
static const char FUNC_NAME[] = "MPI_Bsend_init";
30-
31-
void ompi_bsend_init_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr)
22+
PROTOTYPE VOID bsend_init(BUFFER x, COUNT count, DATATYPE datatype, RANK dest,
23+
TAG tag, COMM comm, REQUEST_OUT request)
3224
{
3325
int c_ierr;
3426
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
3527
MPI_Request c_req;
3628
MPI_Comm c_comm = PMPI_Comm_f2c (*comm);
3729

3830
void *buf = OMPI_CFI_BASE_ADDR(x);
39-
int c_count = OMPI_FINT_2_INT(*count);
31+
@COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count;
4032

4133
OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr);
4234
if (MPI_SUCCESS != c_ierr) {
@@ -45,11 +37,11 @@ void ompi_bsend_init_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, MPI
4537
return;
4638
}
4739

48-
c_ierr = PMPI_Bsend_init(OMPI_F2C_BOTTOM(buf), c_count,
49-
c_datatype,
50-
OMPI_FINT_2_INT(*dest),
51-
OMPI_FINT_2_INT(*tag),
52-
c_comm, &c_req);
40+
c_ierr = @INNER_CALL@(OMPI_F2C_BOTTOM(buf), c_count,
41+
c_datatype,
42+
OMPI_FINT_2_INT(*dest),
43+
OMPI_FINT_2_INT(*tag),
44+
c_comm, &c_req);
5345
if (c_datatype != c_type) {
5446
ompi_datatype_destroy(&c_datatype);
5547
}

ompi/mpi/fortran/use-mpi-f08/buffer_attach_f08.F90

Lines changed: 0 additions & 26 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/buffer_attach_ts.c.in

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@
1919
* $HEADER$
2020
*/
2121

22-
#include "ompi_config.h"
23-
24-
#include "ompi/communicator/communicator.h"
25-
#include "ompi/errhandler/errhandler.h"
26-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27-
28-
static const char FUNC_NAME[] = "MPI_Buffer_attach";
29-
30-
void ompi_buffer_attach_ts(CFI_cdesc_t *x, MPI_Fint *size, MPI_Fint *ierr)
22+
PROTOTYPE VOID buffer_attach(BUFFER_ASYNC x, COUNT size)
3123
{
3224
int c_ierr;
3325
if (OMPI_CFI_IS_CONTIGUOUS(x)) {

ompi/mpi/fortran/use-mpi-f08/compare_and_swap_f08.F90

Lines changed: 0 additions & 33 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/compare_and_swap_ts.c.in

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,9 @@
2222
* $HEADER$
2323
*/
2424

25-
#include "ompi_config.h"
26-
27-
#include "ompi/win/win.h"
28-
#include "ompi/errhandler/errhandler.h"
29-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
30-
#include "ompi/mpi/fortran/base/constants.h"
31-
32-
static const char FUNC_NAME[] = "MPI_Compare_and_swap";
33-
34-
void ompi_compare_and_swap_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, CFI_cdesc_t *x3,
35-
MPI_Fint *datatype, MPI_Fint *target_rank, MPI_Aint *target_disp,
36-
MPI_Fint *win, MPI_Fint *ierr)
25+
PROTOTYPE VOID compare_and_swap(BUFFER x1, BUFFER x2, BUFFER_ASYNC x3,
26+
DATATYPE datatype, RANK target_rank, AINT target_disp,
27+
WIN win)
3728
{
3829
int c_ierr;
3930
MPI_Datatype c_datatype = PMPI_Type_f2c(*datatype);

ompi/mpi/fortran/use-mpi-f08/exscan_f08.F90

Lines changed: 0 additions & 31 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/exscan_ts.c.in

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,8 @@
1919
* $HEADER$
2020
*/
2121

22-
#include "ompi_config.h"
23-
24-
#include "ompi/communicator/communicator.h"
25-
#include "ompi/errhandler/errhandler.h"
26-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27-
#include "ompi/mpi/fortran/base/constants.h"
28-
29-
static const char FUNC_NAME[] = "MPI_Exscan";
30-
31-
void ompi_exscan_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *count,
32-
MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm,
33-
MPI_Fint *ierr)
22+
PROTOTYPE VOID exscan(BUFFER x1, BUFFER_OUT x2, COUNT count,
23+
DATATYPE datatype, OP op, COMM comm)
3424
{
3525
int c_ierr;
3626
MPI_Comm c_comm = PMPI_Comm_f2c(*comm);
@@ -57,8 +47,8 @@ void ompi_exscan_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *count,
5747
sendbuf = (char *) OMPI_F2C_BOTTOM (sendbuf);
5848
recvbuf = (char *) OMPI_F2C_BOTTOM (recvbuf);
5949

60-
c_ierr = PMPI_Exscan(sendbuf, recvbuf,
61-
OMPI_FINT_2_INT(*count),
62-
c_type, c_op, c_comm);
50+
c_ierr = @INNER_CALL@(sendbuf, recvbuf,
51+
(@COUNT_TYPE@) *count,
52+
c_type, c_op, c_comm);
6353
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
6454
}

ompi/mpi/fortran/use-mpi-f08/fetch_and_op_f08.F90

Lines changed: 0 additions & 33 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/fetch_and_op_ts.c.in

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,9 @@
2222
* $HEADER$
2323
*/
2424

25-
#include "ompi_config.h"
26-
27-
#include "ompi/win/win.h"
28-
#include "ompi/errhandler/errhandler.h"
29-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
30-
#include "ompi/mpi/fortran/base/constants.h"
31-
32-
static const char FUNC_NAME[] = "MPI_Fetch_and_op";
33-
34-
void ompi_fetch_and_op_ts(CFI_cdesc_t *x1, CFI_cdesc_t *x2, MPI_Fint *datatype,
35-
MPI_Fint *target_rank, MPI_Aint *target_disp,
36-
MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr)
25+
PROTOTYPE VOID fetch_and_op(BUFFER x1, BUFFER_OUT x2, DATATYPE datatype,
26+
RANK target_rank, AINT target_disp,
27+
OP op, WIN win)
3728
{
3829
int c_ierr;
3930
MPI_Datatype c_datatype = PMPI_Type_f2c(*datatype);

0 commit comments

Comments
 (0)