Skip to content

Commit 7e7e79d

Browse files
committed
handle TAG more correctly
even though currently MPI_ANY_TAG is the same in ABI and OMPI Signed-off-by: Howard Pritchard <[email protected]>
1 parent e60fc03 commit 7e7e79d

File tree

16 files changed

+33
-14
lines changed

16 files changed

+33
-14
lines changed

ompi/mpi/bindings/ompi_bindings/c_type.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,21 @@ def type_text(self, enable_count=False):
573573
return 'int'
574574

575575

576-
@Type.add_type('TAG')
576+
@Type.add_type('TAG', abi_type=['ompi'])
577577
class TypeRank(Type):
578578

579579
def type_text(self, enable_count=False):
580580
return 'int'
581581

582+
@Type.add_type('TAG', abi_type=['standard'])
583+
class TypeRank(StandardABIType):
584+
585+
@property
586+
def init_code(self):
587+
return [f'int {self.tmpname} = {ConvertFuncs.TAG}({self.name});']
588+
589+
def type_text(self, enable_count=False):
590+
return 'int'
582591

583592
@Type.add_type('COMM', abi_type=['ompi'])
584593
class TypeCommunicator(Type):

ompi/mpi/bindings/ompi_bindings/consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ class ConvertFuncs:
279279
INFO = 'ompi_convert_abi_info_intern_info'
280280
FILE = 'ompi_convert_abi_file_intern_file'
281281
TS_LEVEL = 'ompi_convert_abi_ts_level_intern_ts_level'
282+
TAG = 'ompi_convert_abi_tag_intern_tag'
282283

283284

284285
class ConvertOMPIToStandard:

ompi/mpi/c/abi_converters.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,15 @@ __opal_attribute_always_inline__ static inline int ompi_convert_ts_level_ompi_to
981981
return ts_level;
982982
}
983983

984+
__opal_attribute_always_inline__ static inline int ompi_convert_abi_tag_intern_tag(int tag)
985+
{
986+
if (MPI_ANY_TAG_ABI_INTERNAL == tag) {
987+
return MPI_ANY_TAG;
988+
} else {
989+
return tag;
990+
}
991+
}
992+
984993
#if defined(c_plusplus) || defined(__cplusplus)
985994
}
986995
#endif

ompi/mpi/c/improbe.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "ompi/request/request.h"
2626
#include "ompi/message/message.h"
2727

28-
PROTOTYPE ERROR_CLASS improbe(INT source, INT tag, COMM comm, INT_OUT flag,
28+
PROTOTYPE ERROR_CLASS improbe(INT source, TAG tag, COMM comm, INT_OUT flag,
2929
MESSAGE_OUT message, STATUS_OUT status)
3030
{
3131
int rc;

ompi/mpi/c/iprobe.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "ompi/request/request.h"
3232
#include "ompi/runtime/ompi_spc.h"
3333

34-
PROTOTYPE ERROR_CLASS iprobe(INT source, INT tag, COMM comm, INT_OUT flag, STATUS_OUT status)
34+
PROTOTYPE ERROR_CLASS iprobe(INT source, TAG tag, COMM comm, INT_OUT flag, STATUS_OUT status)
3535
{
3636
int rc;
3737

ompi/mpi/c/irecv.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "ompi/runtime/ompi_spc.h"
3434

3535
PROTOTYPE ERROR_CLASS irecv(BUFFER_OUT buf, COUNT count, DATATYPE type,
36-
INT source, INT tag, COMM comm, REQUEST_INOUT request)
36+
INT source, TAG tag, COMM comm, REQUEST_INOUT request)
3737
{
3838
int rc = MPI_SUCCESS;
3939

ompi/mpi/c/irsend.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "ompi/runtime/ompi_spc.h"
3838

3939
PROTOTYPE ERROR_CLASS Irsend(BUFFER buf, COUNT count, DATATYPE type, INT dest,
40-
INT tag, COMM comm, REQUEST_INOUT request)
40+
TAG tag, COMM comm, REQUEST_INOUT request)
4141
{
4242
int rc;
4343

ompi/mpi/c/isendrecv.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
PROTOTYPE ERROR_CLASS isendrecv(BUFFER sendbuf, COUNT sendcount, DATATYPE sendtype,
4141
INT dest, INT sendtag, BUFFER_OUT recvbuf, COUNT recvcount,
42-
DATATYPE recvtype, INT source, INT recvtag,
42+
DATATYPE recvtype, INT source, TAG recvtag,
4343
COMM comm, REQUEST_INOUT request)
4444
{
4545
int rc = MPI_SUCCESS;

ompi/mpi/c/isendrecv_replace.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int ompi_isendrecv_replace_complete_func (ompi_comm_request_t *request)
106106
}
107107

108108
PROTOTYPE ERROR_CLASS isendrecv_replace(BUFFER_OUT buf, COUNT count, DATATYPE datatype,
109-
INT dest, INT sendtag, INT source, INT recvtag,
109+
INT dest, INT sendtag, INT source, TAG recvtag,
110110
COMM comm, REQUEST_INOUT request)
111111
{
112112
int rc = MPI_SUCCESS;

ompi/mpi/c/mprobe.c.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "ompi/request/request.h"
2828
#include "ompi/message/message.h"
2929

30-
PROTOTYPE ERROR_CLASS mprobe(INT source, INT tag, COMM comm,
30+
PROTOTYPE ERROR_CLASS mprobe(INT source, TAG tag, COMM comm,
3131
MESSAGE_OUT message, STATUS_OUT status)
3232
{
3333
int rc;

0 commit comments

Comments
 (0)