Skip to content

Commit 3518474

Browse files
committed
fix up some rebase issues
Signed-off-by: Howard Pritchard <[email protected]>
1 parent ec40163 commit 3518474

File tree

4 files changed

+20
-131
lines changed

4 files changed

+20
-131
lines changed

ompi/runtime/ompi_rte.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* reserved.
99
* Copyright (c) 2014-2018 Cisco Systems, Inc. All rights reserved
1010
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
11-
* Copyright (c) 2018 Triad National Security, LLC. All rights
11+
* Copyright (c) 2018-2020 Triad National Security, LLC. All rights
1212
* reserved.
1313
* Copyright (c) 2019 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
@@ -46,8 +46,8 @@
4646
#include "opal/util/string_copy.h"
4747
#include "opal/mca/hwloc/base/base.h"
4848
#include "opal/mca/pmix/base/base.h"
49-
#include "opal/threads/threads.h"
50-
#include "opal/threads/tsd.h"
49+
#include "opal/mca/threads/threads.h"
50+
#include "opal/mca/threads/tsd.h"
5151
#include "opal/class/opal_list.h"
5252
#include "opal/dss/dss.h"
5353

ompi/runtime/ompi_rte.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
77
* Copyright (c) 2019 Research Organization for Information Science
88
* and Technology (RIST). All rights reserved.
9+
* Copyright (c) 2020 Triad National Security, LLC. All rights
10+
* reserved.
911
*
1012
* $COPYRIGHT$
1113
*
@@ -169,7 +171,7 @@
169171

170172
struct opal_proc_t;
171173

172-
#include "opal/threads/threads.h"
174+
#include "opal/mca/threads/threads.h"
173175
#include "opal/util/proc.h"
174176
#include "opal/mca/hwloc/hwloc-internal.h"
175177
#include "opal/mca/pmix/pmix-internal.h"

opal/mca/pmix/base/base.h

Lines changed: 2 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
22
* Copyright (c) 2014-2019 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2020 Triad National Security, LLC. All rights
4+
* reserved.
35
* $COPYRIGHT$
46
*
57
* Additional copyrights may follow
@@ -35,21 +37,8 @@ OPAL_DECLSPEC int opal_pmix_base_exchange(pmix_info_t *info,
3537
pmix_pdata_t *pdat,
3638
int timeout);
3739

38-
OPAL_DECLSPEC void opal_pmix_base_set_evbase(opal_event_base_t *evbase);
39-
40-
#define opal_pmix_condition_wait(a,b) opal_cond_wait(a, b)
41-
typedef opal_cond_t opal_pmix_condition_t;
42-
#define opal_pmix_condition_broadcast(a) opal_cond_broadcast(a)
4340
#define opal_pmix_condition_signal(a) opal_cond_signal(a)
4441

45-
typedef struct {
46-
opal_mutex_t mutex;
47-
opal_pmix_condition_t cond;
48-
volatile bool active;
49-
int status;
50-
} opal_pmix_lock_t;
51-
52-
5342
typedef struct {
5443
opal_event_base_t *evbase;
5544
int timeout;
@@ -60,112 +49,6 @@ typedef struct {
6049
extern opal_pmix_base_t opal_pmix_base;
6150

6251
#define OPAL_PMIX_CONDITION_STATIC_INIT PTHREAD_COND_INITIALIZER
63-
#define OPAL_PMIX_CONSTRUCT_LOCK(l) \
64-
do { \
65-
OBJ_CONSTRUCT(&(l)->mutex, opal_mutex_t); \
66-
opal_cond_init(&(l)->cond); \
67-
(l)->active = true; \
68-
OPAL_POST_OBJECT((l)); \
69-
} while(0)
70-
71-
#define OPAL_PMIX_DESTRUCT_LOCK(l) \
72-
do { \
73-
OPAL_ACQUIRE_OBJECT((l)); \
74-
OBJ_DESTRUCT(&(l)->mutex); \
75-
opal_cond_destroy(&(l)->cond); \
76-
} while(0)
77-
78-
79-
#if OPAL_ENABLE_DEBUG
80-
#define OPAL_PMIX_ACQUIRE_THREAD(lck) \
81-
do { \
82-
opal_mutex_lock(&(lck)->mutex); \
83-
if (opal_debug_threads) { \
84-
opal_output(0, "Waiting for thread %s:%d", \
85-
__FILE__, __LINE__); \
86-
} \
87-
while ((lck)->active) { \
88-
opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \
89-
} \
90-
if (opal_debug_threads) { \
91-
opal_output(0, "Thread obtained %s:%d", \
92-
__FILE__, __LINE__); \
93-
} \
94-
(lck)->active = true; \
95-
} while(0)
96-
#else
97-
#define OPAL_PMIX_ACQUIRE_THREAD(lck) \
98-
do { \
99-
opal_mutex_lock(&(lck)->mutex); \
100-
while ((lck)->active) { \
101-
opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \
102-
} \
103-
(lck)->active = true; \
104-
} while(0)
105-
#endif
106-
107-
108-
#if OPAL_ENABLE_DEBUG
109-
#define OPAL_PMIX_WAIT_THREAD(lck) \
110-
do { \
111-
opal_mutex_lock(&(lck)->mutex); \
112-
if (opal_debug_threads) { \
113-
opal_output(0, "Waiting for thread %s:%d", \
114-
__FILE__, __LINE__); \
115-
} \
116-
while ((lck)->active) { \
117-
opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \
118-
} \
119-
if (opal_debug_threads) { \
120-
opal_output(0, "Thread obtained %s:%d", \
121-
__FILE__, __LINE__); \
122-
} \
123-
OPAL_ACQUIRE_OBJECT(&lck); \
124-
opal_mutex_unlock(&(lck)->mutex); \
125-
} while(0)
126-
#else
127-
#define OPAL_PMIX_WAIT_THREAD(lck) \
128-
do { \
129-
opal_mutex_lock(&(lck)->mutex); \
130-
while ((lck)->active) { \
131-
opal_pmix_condition_wait(&(lck)->cond, &(lck)->mutex); \
132-
} \
133-
OPAL_ACQUIRE_OBJECT(lck); \
134-
opal_mutex_unlock(&(lck)->mutex); \
135-
} while(0)
136-
#endif
137-
138-
139-
#if OPAL_ENABLE_DEBUG
140-
#define OPAL_PMIX_RELEASE_THREAD(lck) \
141-
do { \
142-
if (opal_debug_threads) { \
143-
opal_output(0, "Releasing thread %s:%d", \
144-
__FILE__, __LINE__); \
145-
} \
146-
(lck)->active = false; \
147-
opal_pmix_condition_broadcast(&(lck)->cond); \
148-
opal_mutex_unlock(&(lck)->mutex); \
149-
} while(0)
150-
#else
151-
#define OPAL_PMIX_RELEASE_THREAD(lck) \
152-
do { \
153-
assert(0 != opal_mutex_trylock(&(lck)->mutex)); \
154-
(lck)->active = false; \
155-
opal_pmix_condition_broadcast(&(lck)->cond); \
156-
opal_mutex_unlock(&(lck)->mutex); \
157-
} while(0)
158-
#endif
159-
160-
161-
#define OPAL_PMIX_WAKEUP_THREAD(lck) \
162-
do { \
163-
opal_mutex_lock(&(lck)->mutex); \
164-
(lck)->active = false; \
165-
OPAL_POST_OBJECT(lck); \
166-
opal_pmix_condition_broadcast(&(lck)->cond); \
167-
opal_mutex_unlock(&(lck)->mutex); \
168-
} while(0)
16952

17053
END_C_DECLS
17154

opal/mca/pmix/pmix-internal.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* reserved.
66
* Copyright (c) 2019 Research Organization for Information Science
77
* and Technology (RIST). All rights reserved.
8+
* Copyright (c) 2020 Triad National Security, LLC. All rights
9+
* reserved.
810
* $COPYRIGHT$
911
*
1012
* Additional copyrights may follow
@@ -24,6 +26,7 @@
2426

2527
#include "opal/mca/mca.h"
2628
#include "opal/mca/event/event.h"
29+
#include "opal/mca/threads/threads.h"
2730
#include "opal/dss/dss.h"
2831
#include "opal/runtime/opal.h"
2932
#include "opal/dss/dss.h"
@@ -61,21 +64,23 @@ typedef struct {
6164
} opal_info_item_t;
6265
OBJ_CLASS_DECLARATION(opal_info_item_t);
6366

67+
typedef opal_cond_t opal_pmix_condition_t;
6468

6569
typedef struct {
6670
opal_mutex_t mutex;
67-
pthread_cond_t cond;
71+
opal_pmix_condition_t cond;
6872
volatile bool active;
6973
int status;
7074
char *msg;
7175
} opal_pmix_lock_t;
7276

73-
#define opal_pmix_condition_wait(a,b) pthread_cond_wait(a, &(b)->m_lock_pthread)
77+
#define opal_pmix_condition_wait(a,b) opal_cond_wait(a, b)
78+
#define opal_pmix_condition_broadcast(a) opal_cond_broadcast(a)
7479

7580
#define OPAL_PMIX_CONSTRUCT_LOCK(l) \
7681
do { \
7782
OBJ_CONSTRUCT(&(l)->mutex, opal_mutex_t); \
78-
pthread_cond_init(&(l)->cond, NULL); \
83+
opal_cond_init(&(l)->cond); \
7984
(l)->active = true; \
8085
(l)->status = 0; \
8186
(l)->msg = NULL; \
@@ -86,7 +91,7 @@ typedef struct {
8691
do { \
8792
OPAL_ACQUIRE_OBJECT((l)); \
8893
OBJ_DESTRUCT(&(l)->mutex); \
89-
pthread_cond_destroy(&(l)->cond); \
94+
opal_cond_destroy(&(l)->cond); \
9095
if (NULL != (l)->msg) { \
9196
free((l)->msg); \
9297
} \
@@ -161,26 +166,25 @@ typedef struct {
161166
__FILE__, __LINE__); \
162167
} \
163168
(lck)->active = false; \
164-
pthread_cond_broadcast(&(lck)->cond); \
169+
opal_pmix_condition_broadcast(&(lck)->cond); \
165170
opal_mutex_unlock(&(lck)->mutex); \
166171
} while(0)
167172
#else
168173
#define OPAL_PMIX_RELEASE_THREAD(lck) \
169174
do { \
170175
assert(0 != opal_mutex_trylock(&(lck)->mutex)); \
171176
(lck)->active = false; \
172-
pthread_cond_broadcast(&(lck)->cond); \
177+
opal_pmix_condition_broadcast(&(lck)->cond); \
173178
opal_mutex_unlock(&(lck)->mutex); \
174179
} while(0)
175180
#endif
176181

177-
178182
#define OPAL_PMIX_WAKEUP_THREAD(lck) \
179183
do { \
180184
opal_mutex_lock(&(lck)->mutex); \
181185
(lck)->active = false; \
182186
OPAL_POST_OBJECT(lck); \
183-
pthread_cond_broadcast(&(lck)->cond); \
187+
opal_pmix_condition_broadcast(&(lck)->cond); \
184188
opal_mutex_unlock(&(lck)->mutex); \
185189
} while(0)
186190

0 commit comments

Comments
 (0)