Skip to content

Commit 32160d9

Browse files
committed
Replace the use of opal_output by opal_show_help in supported threading mca backends.
Signed-off-by: Jan Ciesko <[email protected]>
1 parent 89fc519 commit 32160d9

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

opal/mca/threads/argobots/threads_argobots_mutex.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* reserved.
2020
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
2121
* Copyright (c) 2021 Argonne National Laboratory. All rights reserved.
22+
* Copyright (c) 2022 Sandia National Laboratories. All rights reserved.
2223
* $COPYRIGHT$
2324
*
2425
* Additional copyrights may follow
@@ -39,6 +40,7 @@
3940
#include "opal/mca/threads/argobots/threads_argobots.h"
4041
#include "opal/mca/threads/mutex.h"
4142
#include "opal/util/output.h"
43+
#include "opal/util/show_help.h"
4244

4345
BEGIN_C_DECLS
4446

@@ -66,7 +68,7 @@ static inline void opal_thread_internal_mutex_lock(opal_thread_internal_mutex_t
6668
#if OPAL_ENABLE_DEBUG
6769
int ret = ABT_mutex_lock(mutex);
6870
if (ABT_SUCCESS != ret) {
69-
opal_output(0, "opal_thread_internal_mutex_lock()");
71+
opal_show_help("help-opal-threads.txt", "mutex lock failed", true);
7072
}
7173
#else
7274
ABT_mutex_lock(mutex);
@@ -81,7 +83,7 @@ static inline int opal_thread_internal_mutex_trylock(opal_thread_internal_mutex_
8183
return 1;
8284
} else if (ABT_SUCCESS != ret) {
8385
#if OPAL_ENABLE_DEBUG
84-
opal_output(0, "opal_thread_internal_mutex_trylock()");
86+
opal_show_help("help-opal-threads.txt", "mutex trylock failed", true);
8587
#endif
8688
return 1;
8789
}
@@ -94,7 +96,7 @@ static inline void opal_thread_internal_mutex_unlock(opal_thread_internal_mutex_
9496
#if OPAL_ENABLE_DEBUG
9597
int ret = ABT_mutex_unlock(mutex);
9698
if (ABT_SUCCESS != ret) {
97-
opal_output(0, "opal_thread_internal_mutex_unlock()");
99+
opal_show_help("help-opal-threads.txt", "mutex unlock failed", true);
98100
}
99101
#else
100102
ABT_mutex_unlock(mutex);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- text -*-
2+
#
3+
# Copyright (c) 2022 Sandia National Laboratories. All rights reserved.
4+
# $COPYRIGHT$
5+
#
6+
# Additional copyrights may follow
7+
#
8+
# $HEADER$
9+
#
10+
# This is the US/English help file for Open MPI's OPAL thread MCA.
11+
#
12+
[mutex init failed]
13+
A mutex initialization has failed.
14+
15+
[mutex lock failed]
16+
A mutex acquire (mutex lock) has failed.
17+
18+
[mutex unlock failed]
19+
A mutex release (mutex unlock) has failed.
20+
21+
[mutex trylock failed]
22+
A try to acquire a mutex (mutex trylock) has failed.

opal/mca/threads/pthreads/threads_pthreads_mutex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
#include "opal/class/opal_object.h"
5050
#include "opal/constants.h"
51-
#include "opal/util/output.h"
51+
#include "opal/util/show_help.h"
5252

5353
BEGIN_C_DECLS
5454

@@ -110,7 +110,7 @@ static inline void opal_thread_internal_mutex_lock(opal_thread_internal_mutex_t
110110
#if OPAL_ENABLE_DEBUG
111111
int ret = pthread_mutex_lock(p_mutex);
112112
if (EDEADLK == ret) {
113-
opal_output(0, "opal_thread_internal_mutex_lock() %d", ret);
113+
opal_show_help("help-opal-threads.txt", "mutex lock failed", true);
114114
}
115115
assert(0 == ret);
116116
#else

opal/mca/threads/qthreads/threads_qthreads_mutex.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "opal/constants.h"
4040
#include "opal/mca/threads/qthreads/threads_qthreads.h"
4141
#include "opal/sys/atomic.h"
42-
#include "opal/util/output.h"
42+
#include "opal/util/show_help.h"
4343

4444
BEGIN_C_DECLS
4545

@@ -55,7 +55,7 @@ static inline int opal_thread_internal_mutex_init(opal_thread_internal_mutex_t *
5555
#if OPAL_ENABLE_DEBUG
5656
int ret = qthread_spinlock_init(p_mutex,recursive);
5757
if (QTHREAD_SUCCESS != ret) {
58-
opal_output(0, "opal_thread_internal_mutex_init()");
58+
opal_show_help("help-opal-threads.txt", "mutex init failed", true);
5959
}
6060
#else
6161
qthread_spinlock_init(p_mutex,recursive);
@@ -69,7 +69,7 @@ static inline void opal_thread_internal_mutex_lock(opal_thread_internal_mutex_t
6969
#if OPAL_ENABLE_DEBUG
7070
int ret = qthread_spinlock_lock(p_mutex);
7171
if (QTHREAD_SUCCESS != ret) {
72-
opal_output(0, "opal_thread_internal_mutex_lock()");
72+
opal_show_help("help-opal-threads.txt", "mutex lock failed", true);
7373
}
7474
#else
7575
qthread_spinlock_lock(p_mutex);
@@ -84,7 +84,7 @@ static inline int opal_thread_internal_mutex_trylock(opal_thread_internal_mutex_
8484
return 1;
8585
} else if (QTHREAD_SUCCESS != ret) {
8686
#if OPAL_ENABLE_DEBUG
87-
opal_output(0, "opal_thread_internal_mutex_trylock()");
87+
opal_show_help("help-opal-threads.txt", "mutex trylock failed", true);
8888
#endif
8989
return 1;
9090
}
@@ -98,7 +98,7 @@ static inline void opal_thread_internal_mutex_unlock(opal_thread_internal_mutex_
9898
#if OPAL_ENABLE_DEBUG
9999
ret = qthread_spinlock_unlock(p_mutex);
100100
if (QTHREAD_SUCCESS != ret) {
101-
opal_output(0, "opal_thread_internal_mutex_unlock()");
101+
opal_show_help("help-opal-threads.txt", "mutex unlock failed", true);
102102
}
103103
#else
104104
qthread_spinlock_unlock(p_mutex);

0 commit comments

Comments
 (0)