Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions ompi/mca/osc/pt2pt/osc_pt2pt.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ struct ompi_osc_pt2pt_peer_t {
int32_t passive_incoming_frag_count;

/** peer flags */
int32_t flags;
volatile int32_t flags;
};
typedef struct ompi_osc_pt2pt_peer_t ompi_osc_pt2pt_peer_t;

Expand All @@ -144,11 +144,15 @@ static inline bool ompi_osc_pt2pt_peer_eager_active (ompi_osc_pt2pt_peer_t *peer

static inline void ompi_osc_pt2pt_peer_set_flag (ompi_osc_pt2pt_peer_t *peer, int32_t flag, bool value)
{
if (value) {
peer->flags |= flag;
} else {
peer->flags &= ~flag;
}
int32_t peer_flags, new_flags;
do {
peer_flags = peer->flags;
if (value) {
new_flags = peer_flags | flag;
} else {
new_flags = peer_flags & ~flag;
}
} while (!OPAL_ATOMIC_CMPSET_32 (&peer->flags, peer_flags, new_flags));
}

static inline void ompi_osc_pt2pt_peer_set_locked (ompi_osc_pt2pt_peer_t *peer, bool value)
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/osc/pt2pt/osc_pt2pt_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ struct ompi_osc_pt2pt_sync_t {
int num_peers;

/** number of synchronization messages expected */
int32_t sync_expected;
volatile int32_t sync_expected;

/** eager sends are active to all peers in this access epoch */
bool eager_send_active;
volatile bool eager_send_active;

/** communication has started on this epoch */
bool epoch_active;
Expand Down Expand Up @@ -175,7 +175,7 @@ static inline void ompi_osc_pt2pt_sync_expected (ompi_osc_pt2pt_sync_t *sync)
static inline void ompi_osc_pt2pt_sync_reset (ompi_osc_pt2pt_sync_t *sync)
{
sync->type = OMPI_OSC_PT2PT_SYNC_TYPE_NONE;
sync->eager_send_active = 0;
sync->eager_send_active = false;
sync->epoch_active = 0;
sync->peer_list.peers = NULL;
sync->sync.pscw.group = NULL;
Expand Down