Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 570d264

Browse files
PDevezetkordenbrock
authored andcommitted
mtl-portals4: Control that flowctl_idx is egal to REQ_FLOWCTL_TABLE_ID and use OPAL_ATOMIC_CMPSET_32 to test and set flowctl_active flag to true
1 parent 4860038 commit 570d264

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

ompi/mca/mtl/portals4/mtl_portals4_flowctl.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ ompi_mtl_portals4_flowctl_init(void)
7070
goto error;
7171
}
7272

73+
if (ompi_mtl_portals4.flowctl_idx != REQ_FLOWCTL_TABLE_ID) {
74+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
75+
"%s:%d: PtlPTAlloc did not allocate the requested PT: %d\n",
76+
__FILE__, __LINE__, ompi_mtl_portals4.flowctl_idx);
77+
goto error;
78+
}
79+
7380
ret = PtlCTAlloc(ompi_mtl_portals4.ni_h,
7481
&ompi_mtl_portals4.flowctl.trigger_ct_h);
7582
if (OPAL_UNLIKELY(PTL_OK != ret)) {
@@ -291,9 +298,7 @@ ompi_mtl_portals4_flowctl_trigger(void)
291298
{
292299
int ret;
293300

294-
if (false == ompi_mtl_portals4.flowctl.flowctl_active) {
295-
ompi_mtl_portals4.flowctl.flowctl_active = true;
296-
301+
if (true == OPAL_ATOMIC_CMPSET_32(&ompi_mtl_portals4.flowctl.flowctl_active, false, true)) {
297302
/* send trigger to root */
298303
ret = PtlPut(ompi_mtl_portals4.zero_md_h,
299304
0,

ompi/mca/mtl/portals4/mtl_portals4_flowctl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ OBJ_CLASS_DECLARATION(ompi_mtl_portals4_pending_request_t);
3434

3535

3636
struct ompi_mtl_portals4_flowctl_t {
37-
bool flowctl_active;
37+
int32_t flowctl_active;
3838

3939
int32_t send_slots;
4040
int32_t max_send_slots;

0 commit comments

Comments
 (0)