Skip to content

Commit b81d056

Browse files
committed
get rid of some aborts and switch to opal_output
Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent 3a8c892 commit b81d056

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

opal/mca/threads/argobots/threads_argobots_mutex.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2015-2016 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
18+
* Copyright (c) 2020 Triad National Security, LLC. All rights
19+
* reserved.
1820
*
1921
* $COPYRIGHT$
2022
*
@@ -34,6 +36,7 @@
3436

3537
#include "opal/class/opal_object.h"
3638
#include "opal/sys/atomic.h"
39+
#include "opal/util/output.h"
3740

3841
#include <abt.h>
3942

@@ -132,8 +135,7 @@ static inline int opal_mutex_trylock(opal_mutex_t *m)
132135
int ret = ABT_mutex_trylock(m->m_lock_argobots);
133136
if (ret != 0) {
134137
errno = ret;
135-
perror("opal_mutex_trylock()");
136-
abort();
138+
opal_output(0, "opal_mutex_trylock()");
137139
}
138140
return ret;
139141
#else
@@ -151,8 +153,7 @@ static inline void opal_mutex_lock(opal_mutex_t *m)
151153
int ret = ABT_mutex_lock(m->m_lock_argobots);
152154
if (ret != 0) {
153155
errno = ret;
154-
perror("opal_mutex_lock()");
155-
abort();
156+
opal_output(0, "opal_mutex_lock()");
156157
}
157158
#else
158159
ABT_mutex_lock(m->m_lock_argobots);
@@ -169,8 +170,7 @@ static inline void opal_mutex_unlock(opal_mutex_t *m)
169170
int ret = ABT_mutex_unlock(m->m_lock_argobots);
170171
if (ret != 0) {
171172
errno = ret;
172-
perror("opal_mutex_unlock");
173-
abort();
173+
opal_output(0, "opal_mutex_unlock()");
174174
}
175175
#else
176176
ABT_mutex_unlock(m->m_lock_argobots);

opal/mca/threads/pthreads/threads_pthreads_mutex.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2015-2016 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
18+
* Copyright (c) 2020 Triad National Security, LLC. All rights
19+
* reserved.
1820
*
1921
* $COPYRIGHT$
2022
*
@@ -45,6 +47,7 @@
4547

4648
#include "opal/class/opal_object.h"
4749
#include "opal/sys/atomic.h"
50+
#include "opal/util/output.h"
4851

4952
BEGIN_C_DECLS
5053

@@ -126,8 +129,7 @@ static inline int opal_mutex_trylock(opal_mutex_t *m)
126129
int ret = pthread_mutex_trylock(&m->m_lock_pthread);
127130
if (EDEADLK == ret) {
128131
errno = ret;
129-
perror("opal_mutex_trylock()");
130-
abort();
132+
opal_output(0,"opal_mutex_trylock() %d",ret);
131133
}
132134
return ret;
133135
#else
@@ -141,8 +143,7 @@ static inline void opal_mutex_lock(opal_mutex_t *m)
141143
int ret = pthread_mutex_lock(&m->m_lock_pthread);
142144
if (EDEADLK == ret) {
143145
errno = ret;
144-
perror("opal_mutex_lock()");
145-
abort();
146+
opal_output(0,"opal_mutex_lock() %d", ret);
146147
}
147148
#else
148149
pthread_mutex_lock(&m->m_lock_pthread);
@@ -155,8 +156,7 @@ static inline void opal_mutex_unlock(opal_mutex_t *m)
155156
int ret = pthread_mutex_unlock(&m->m_lock_pthread);
156157
if (EPERM == ret) {
157158
errno = ret;
158-
perror("opal_mutex_unlock");
159-
abort();
159+
opal_output(0,"opal_mutex_unlock() %d", ret);
160160
}
161161
#else
162162
pthread_mutex_unlock(&m->m_lock_pthread);

opal/mca/threads/qthreads/threads_qthreads_mutex.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2015-2016 Research Organization for Information Science
1616
* and Technology (RIST). All rights reserved.
1717
* Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
18+
* Copyright (c) 2020 Triad National Security, LLC. All rights
19+
* reserved.
1820
*
1921
* $COPYRIGHT$
2022
*
@@ -43,6 +45,7 @@
4345

4446
#include "opal/class/opal_object.h"
4547
#include "opal/sys/atomic.h"
48+
#include "opal/util/output.h"
4649

4750
#include <qthread/qthread.h>
4851

@@ -115,8 +118,7 @@ static inline int opal_mutex_trylock(opal_mutex_t *m)
115118
int ret = qthread_readFE_nb(NULL, &m->m_lock_qthreads);
116119
if (ret != 0) {
117120
errno = ret;
118-
perror("opal_mutex_trylock()");
119-
abort();
121+
opal_output(0, "opal_mutex_trylock() %d", ret);
120122
}
121123
return ret;
122124
#else
@@ -131,8 +133,7 @@ static inline void opal_mutex_lock(opal_mutex_t *m)
131133
int ret = qthread_lock(&m->m_lock_qthreads);
132134
if (ret != 0) {
133135
errno = ret;
134-
perror("opal_mutex_lock()");
135-
abort();
136+
opal_output(0, "opal_mutex_lock() %d", ret);
136137
}
137138
#else
138139
qthread_lock(&m->m_lock_qthreads);
@@ -147,8 +148,7 @@ static inline void opal_mutex_unlock(opal_mutex_t *m)
147148
int ret = qthread_unlock(&m->m_lock_qthreads);
148149
if (ret != 0) {
149150
errno = ret;
150-
perror("opal_mutex_unlock");
151-
abort();
151+
opal_output(0, "opal_mutex_unlock() %d", ret);
152152
}
153153
#else
154154
qthread_unlock(&m->m_lock_qthreads);

0 commit comments

Comments
 (0)