Skip to content

Commit 33d5988

Browse files
authored
Merge pull request #3587 from hjelmn/event_abstraction
pmix/pmix2x: fix errors in event abstration
2 parents 4bfb0fc + a512b89 commit 33d5988

File tree

4 files changed

+27
-18
lines changed

4 files changed

+27
-18
lines changed

opal/mca/event/libevent2022/libevent2022.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ OPAL_DECLSPEC int opal_event_finalize(void);
110110

111111
#define opal_event_set(b, x, fd, fg, cb, arg) event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg))
112112

113+
#define opal_event_assign(x, b, fd, fg, cb, arg) event_assign((x), (b), (fd), (fg), (event_callback_fn) (cb), (arg))
114+
113115
#define opal_event_add(ev, tv) event_add((ev), (tv))
114116

115117
#define opal_event_del(ev) event_del((ev))

opal/mca/pmix/pmix2x/pmix2x.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
77
* All rights reserved.
88
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
9+
* Copyright (c) 2017 Los Alamos National Security, LLC. All rights
10+
* reserved.
911
* $COPYRIGHT$
1012
*
1113
* Additional copyrights may follow
@@ -308,9 +310,9 @@ void pmix2x_event_hdlr(size_t evhdlr_registration_id,
308310
}
309311

310312
/* now push it into the local thread */
311-
event_assign(&cd->ev, opal_pmix_base.evbase,
312-
-1, EV_WRITE, _event_hdlr, cd);
313-
event_active(&cd->ev, EV_WRITE, 1);
313+
opal_event_assign(&cd->ev, opal_pmix_base.evbase,
314+
-1, EV_WRITE, _event_hdlr, cd);
315+
opal_event_active(&cd->ev, EV_WRITE, 1);
314316
}
315317

316318
opal_vpid_t pmix2x_convert_rank(pmix_rank_t rank)

opal/mca/pmix/pmix2x/pmix2x.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
34
* Copyright (c) 2014-2015 Mellanox Technologies, Inc.
45
* All rights reserved.
56
* Copyright (c) 2016 Research Organization for Information Science
67
* and Technology (RIST). All rights reserved.
8+
* Copyright (c) 2017 Los Alamos National Security, LLC. All rights
9+
* reserved.
710
* $COPYRIGHT$
811
*
912
* Additional copyrights may follow
@@ -151,9 +154,9 @@ OBJ_CLASS_DECLARATION(pmix2x_threadshift_t);
151154
_cd->handler = (e); \
152155
_cd->opcbfunc = (cb); \
153156
_cd->cbdata = (cd); \
154-
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
155-
-1, EV_WRITE, (fn), (_cd)); \
156-
event_active(&((_cd)->ev), EV_WRITE, 1); \
157+
opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
158+
-1, EV_WRITE, (fn), (_cd)); \
159+
opal_event_active(&((_cd)->ev), EV_WRITE, 1); \
157160
} while(0)
158161

159162
#define OPAL_PMIX_THREADSHIFT(e, i, eh, fn, cb, cd) \
@@ -165,9 +168,9 @@ OBJ_CLASS_DECLARATION(pmix2x_threadshift_t);
165168
_cd->evhandler = (eh); \
166169
_cd->cbfunc = (cb); \
167170
_cd->cbdata = (cd); \
168-
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
169-
-1, EV_WRITE, (fn), (_cd)); \
170-
event_active(&((_cd)->ev), EV_WRITE, 1); \
171+
opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
172+
-1, EV_WRITE, (fn), (_cd)); \
173+
opal_event_active(&((_cd)->ev), EV_WRITE, 1); \
171174
} while(0)
172175

173176
#define OPAL_PMIX_NOTIFY_THREADSHIFT(s, sr, r, i, fn, cb, cd) \
@@ -180,9 +183,9 @@ OBJ_CLASS_DECLARATION(pmix2x_threadshift_t);
180183
_cd->info = (i); \
181184
_cd->opcbfunc = (cb); \
182185
_cd->cbdata = (cd); \
183-
event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
186+
opal_event_assign(&((_cd)->ev), opal_pmix_base.evbase, \
184187
-1, EV_WRITE, (fn), (_cd)); \
185-
event_active(&((_cd)->ev), EV_WRITE, 1); \
188+
opal_event_active(&((_cd)->ev), EV_WRITE, 1); \
186189
} while(0)
187190

188191
/**** CLIENT FUNCTIONS ****/

opal/mca/pmix/pmix2x/pmix2x_server_south.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Copyright (c) 2014 Mellanox Technologies, Inc.
88
* All rights reserved.
99
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
10+
* Copyright (c) 2017 Los Alamos National Security, LLC. All rights
11+
* reserved.
1012
* $COPYRIGHT$
1113
*
1214
* Additional copyrights may follow
@@ -297,9 +299,9 @@ int pmix2x_server_register_nspace(opal_jobid_t jobid,
297299
if (NULL == cbfunc) {
298300
_reg_nspace(0, 0, cd);
299301
} else {
300-
event_assign(&cd->ev, opal_pmix_base.evbase,
301-
-1, EV_WRITE, _reg_nspace, cd);
302-
event_active(&cd->ev, EV_WRITE, 1);
302+
opal_event_assign(&cd->ev, opal_pmix_base.evbase,
303+
-1, EV_WRITE, _reg_nspace, cd);
304+
opal_event_active(&cd->ev, EV_WRITE, 1);
303305
}
304306

305307
return OPAL_SUCCESS;
@@ -357,9 +359,9 @@ void pmix2x_server_deregister_nspace(opal_jobid_t jobid,
357359
if (NULL == cbfunc) {
358360
_dereg_nspace(0, 0, cd);
359361
} else {
360-
event_assign(&cd->ev, opal_pmix_base.evbase,
362+
opal_event_assign(&cd->ev, opal_pmix_base.evbase,
361363
-1, EV_WRITE, _dereg_nspace, cd);
362-
event_active(&cd->ev, EV_WRITE, 1);
364+
opal_event_active(&cd->ev, EV_WRITE, 1);
363365
}
364366
}
365367

@@ -427,9 +429,9 @@ void pmix2x_server_deregister_client(const opal_process_name_t *proc,
427429
if (NULL == cbfunc) {
428430
_dereg_client(0, 0, cd);
429431
} else {
430-
event_assign(&cd->ev, opal_pmix_base.evbase,
432+
opal_event_assign(&cd->ev, opal_pmix_base.evbase,
431433
-1, EV_WRITE, _dereg_client, cd);
432-
event_active(&cd->ev, EV_WRITE, 1);
434+
opal_event_active(&cd->ev, EV_WRITE, 1);
433435
}
434436
}
435437

0 commit comments

Comments
 (0)