Skip to content

Commit 05a7e3d

Browse files
committed
add abi_get/set_fortran_booleans c interfaces
Signed-off-by: Howard Pritchard <[email protected]>
1 parent 8bb81d4 commit 05a7e3d

File tree

8 files changed

+298
-52
lines changed

8 files changed

+298
-52
lines changed

ompi/include/mpi.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,8 @@ OMPI_DECLSPEC int MPI_Abi_version(int *abi_major, int *abi_minor);
14571457
OMPI_DECLSPEC int MPI_Abi_details(int *buflen, char *details, MPI_Info *info);
14581458
OMPI_DECLSPEC int MPI_Abi_get_fortran_info(MPI_Info *info);
14591459
OMPI_DECLSPEC int MPI_Abi_set_fortran_info(MPI_Info info);
1460+
OMPI_DECLSPEC int MPI_Abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set);
1461+
OMPI_DECLSPEC int MPI_Abi_set_fortran_booleans(int logical_size, void *logical_true, void *logical_false);
14601462
OMPI_DECLSPEC int MPI_Abort(MPI_Comm comm, int errorcode);
14611463
OMPI_DECLSPEC int MPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
14621464
int target_rank, MPI_Aint target_disp, int target_count,
@@ -2633,6 +2635,8 @@ OMPI_DECLSPEC int PMPI_Abi_version(int *abi_major, int *abi_minor);
26332635
OMPI_DECLSPEC int PMPI_Abi_details(int *buflen, char *details, MPI_Info *info);
26342636
OMPI_DECLSPEC int PMPI_Abi_get_fortran_info(MPI_Info *info);
26352637
OMPI_DECLSPEC int PMPI_Abi_set_fortran_info(MPI_Info info);
2638+
OMPI_DECLSPEC int PMPI_Abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set);
2639+
OMPI_DECLSPEC int PMPI_Abi_set_fortran_booleans(int logical_size, void *logical_true, void *logical_false);
26362640
OMPI_DECLSPEC int PMPI_Abort(MPI_Comm comm, int errorcode);
26372641
OMPI_DECLSPEC int PMPI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
26382642
int target_rank, MPI_Aint target_disp, int target_count,

ompi/mpi/bindings/ompi_bindings/c_type.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,29 +1944,14 @@ class TypeEventCBFunction(Type):
19441944
def type_text(self, enable_count=False):
19451945
return 'MPI_T_event_cb_function'
19461946

1947-
@Type.add_type('VOID', abi_type=['ompi'])
1947+
@Type.add_type('VOID')
19481948
class TypeVoid(Type):
19491949

19501950
def type_text(self, enable_count=False):
19511951
return 'void *'
19521952

1953-
@Type.add_type('VOID', abi_type=['standard'])
1954-
class TypeVoidStandard(StandardABIType):
1955-
1956-
def type_text(self, enable_count=False):
1957-
return 'void *'
1958-
1959-
@Type.add_type('VOID_CONST', abi_type=['ompi'])
1953+
@Type.add_type('VOID_CONST')
19601954
class TypeVoidConst(Type):
19611955

19621956
def type_text(self, enable_count=False):
19631957
return 'const void *'
1964-
1965-
@Type.add_type('VOID_CONST', abi_type=['standard'])
1966-
class TypeVoidConst(StandardABIType):
1967-
1968-
def type_text(self, enable_count=False):
1969-
return 'const void *'
1970-
1971-
1972-

ompi/mpi/c/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ headers = bindings.h
5252
prototype_sources = \
5353
abi_get_fortran_info.c.in \
5454
abi_set_fortran_info.c.in \
55+
abi_get_fortran_booleans.c.in \
56+
abi_set_fortran_booleans.c.in \
5557
abort.c.in \
5658
accumulate.c.in \
5759
add_error_class.c.in \
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2+
/*
3+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
4+
* University Research and Technology
5+
* Corporation. All rights reserved.
6+
* Copyright (c) 2004-2020 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
9+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10+
* University of Stuttgart. All rights reserved.
11+
* Copyright (c) 2004-2005 The Regents of the University of California.
12+
* All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018-2025 Triad National Security, LLC. All rights
16+
* reserved.
17+
* $COPYRIGHT$
18+
*
19+
* Additional copyrights may follow
20+
*
21+
* $HEADER$
22+
*/
23+
24+
#include "ompi_config.h"
25+
26+
#include "ompi/mpi/c/bindings.h"
27+
#include "ompi/runtime/params.h"
28+
#include "ompi/communicator/communicator.h"
29+
#include "ompi/errhandler/errhandler.h"
30+
#include "ompi/info/info.h"
31+
#include "ompi/mpi/c/bindings.h"
32+
33+
PROTOTYPE ERROR_CLASS abi_get_fortran_booleans(INT logical_size, VOID logical_true,
34+
VOID logical_false, INT_OUT is_set)
35+
{
36+
int ret = MPI_SUCCESS;
37+
38+
if (MPI_PARAM_CHECK) {
39+
if ((NULL == logical_true) || (NULL == logical_false) ||
40+
(NULL == is_set)) {
41+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG,
42+
FUNC_NAME);
43+
}
44+
}
45+
46+
ret = ompi_abi_get_fortran_booleans(logical_size, logical_true, logical_false, is_set);
47+
OMPI_ERRHANDLER_NOHANDLE_RETURN( ret, ret, FUNC_NAME );
48+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2+
/*
3+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
4+
* University Research and Technology
5+
* Corporation. All rights reserved.
6+
* Copyright (c) 2004-2020 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
9+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10+
* University of Stuttgart. All rights reserved.
11+
* Copyright (c) 2004-2005 The Regents of the University of California.
12+
* All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018-2025 Triad National Security, LLC. All rights
16+
* reserved.
17+
* $COPYRIGHT$
18+
*
19+
* Additional copyrights may follow
20+
*
21+
* $HEADER$
22+
*/
23+
24+
#include "ompi_config.h"
25+
26+
#include "ompi/mpi/c/bindings.h"
27+
#include "ompi/runtime/params.h"
28+
#include "ompi/communicator/communicator.h"
29+
#include "ompi/errhandler/errhandler.h"
30+
#include "ompi/info/info.h"
31+
#include "ompi/mpi/c/bindings.h"
32+
33+
PROTOTYPE ERROR_CLASS abi_set_fortran_booleans(INT logical_size, VOID logical_true,
34+
VOID logical_false)
35+
{
36+
int ret = MPI_SUCCESS;
37+
38+
if (MPI_PARAM_CHECK) {
39+
if ((NULL == logical_true) || (NULL == logical_false)) {
40+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG,
41+
FUNC_NAME);
42+
}
43+
}
44+
45+
ret = ompi_abi_set_fortran_booleans(logical_size, logical_true, logical_false);
46+
OMPI_ERRHANDLER_NOHANDLE_RETURN( ret, ret, FUNC_NAME );
47+
}

ompi/mpi/c/abi_set_fortran_info.c.in

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,14 @@
3232
PROTOTYPE ERROR_CLASS abi_set_fortran_info(INFO info)
3333
{
3434
int ret = MPI_SUCCESS;
35-
static bool already_called = false;
3635

3736
if (MPI_PARAM_CHECK) {
3837
if (NULL == info) {
3938
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_INFO,
4039
FUNC_NAME);
4140
}
42-
if (true == already_called) {
43-
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ABI,
44-
FUNC_NAME);
45-
}
4641
}
4742

48-
already_called = true;
49-
50-
#if OMPI_BUILD_FORTRAN_BINDINGS
51-
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ABI, FUNC_NAME);
52-
#endif
53-
5443
ret = ompi_abi_set_fortran_info(info);
5544
OMPI_ERRHANDLER_NOHANDLE_RETURN( ret, ret, FUNC_NAME );
5645
}

ompi/mpi/c/bindings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ int ompi_isendrecv(const void * sendbuf, size_t sendcount, MPI_Datatype sendtype
125125
int ompi_abi_get_fortran_info(ompi_info_t **info);
126126
int ompi_abi_set_fortran_info(ompi_info_t *info);
127127
int ompi_abi_get_fortran_booleans(int logical_size, void *logical_true, void *logical_false, int *is_set);
128+
int ompi_abi_set_fortran_booleans(int logical_size, void *logical_true, void *logical_false);
128129

129130
END_C_DECLS
130131

0 commit comments

Comments
 (0)