Skip to content

Commit a3004ce

Browse files
committed
oshmem: Enable force output for error messages
This change fixes issue when oshmem related error messages are not visible for an user.
1 parent 1960f2c commit a3004ce

File tree

7 files changed

+34
-3
lines changed

7 files changed

+34
-3
lines changed

oshmem/mca/atomic/base/atomic_base_frame.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "opal/util/output.h"
1919
#include "opal/mca/base/base.h"
2020

21+
#include "oshmem/util/oshmem_util.h"
2122
#include "oshmem/mca/atomic/atomic.h"
2223
#include "oshmem/mca/atomic/base/base.h"
2324

@@ -73,6 +74,8 @@ static int mca_atomic_base_close(void)
7374

7475
static int mca_atomic_base_open(mca_base_open_flag_t flags)
7576
{
77+
oshmem_framework_open_output(&oshmem_atomic_base_framework);
78+
7679
/* Open up all available components */
7780
if (OPAL_SUCCESS !=
7881
mca_base_framework_components_open(&oshmem_atomic_base_framework, flags)) {

oshmem/mca/memheap/base/memheap_base_frame.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "opal/util/output.h"
1919
#include "opal/mca/base/base.h"
2020

21+
#include "oshmem/util/oshmem_util.h"
2122
#include "oshmem/mca/memheap/memheap.h"
2223
#include "oshmem/mca/memheap/base/base.h"
2324

@@ -41,7 +42,6 @@ mca_memheap_map_t mca_memheap_base_map = {{{0}}};
4142

4243
static int mca_memheap_base_register(mca_base_register_flag_t flags)
4344
{
44-
4545
(void) mca_base_var_register("oshmem",
4646
"memheap",
4747
"base",
@@ -124,6 +124,8 @@ static int mca_memheap_base_open(mca_base_open_flag_t flags)
124124
mca_memheap_base_map.n_segments = 0;
125125
mca_memheap_base_map.num_transports = 0;
126126

127+
oshmem_framework_open_output(&oshmem_memheap_base_framework);
128+
127129
/* Open up all available components */
128130
if (OPAL_SUCCESS !=
129131
mca_base_framework_components_open(&oshmem_memheap_base_framework, flags)) {

oshmem/mca/scoll/base/scoll_base_frame.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "opal/util/output.h"
1919
#include "opal/mca/base/base.h"
2020

21+
#include "oshmem/util/oshmem_util.h"
2122
#include "oshmem/mca/scoll/scoll.h"
2223
#include "oshmem/mca/scoll/base/base.h"
2324

@@ -100,6 +101,8 @@ static int mca_scoll_base_close(void)
100101

101102
static int mca_scoll_base_open(mca_base_open_flag_t flags)
102103
{
104+
oshmem_framework_open_output(&oshmem_scoll_base_framework);
105+
103106
/* Open up all available components */
104107
if (OPAL_SUCCESS !=
105108
mca_base_framework_components_open(&oshmem_scoll_base_framework, flags)) {

oshmem/mca/spml/base/spml_base_frame.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "opal/mca/base/base.h"
2626

2727
#include "oshmem/constants.h"
28+
#include "oshmem/util/oshmem_util.h"
2829
#include "oshmem/mca/spml/spml.h"
2930
#include "oshmem/mca/spml/base/base.h"
3031
#include "oshmem/mca/spml/base/spml_base_request.h"
@@ -108,6 +109,8 @@ static int mca_spml_base_open(mca_base_open_flag_t flags)
108109

109110
OBJ_CONSTRUCT(&mca_spml_base_spml, opal_pointer_array_t);
110111

112+
oshmem_framework_open_output(&oshmem_spml_base_framework);
113+
111114
/* Open up all available components */
112115
if (OPAL_SUCCESS !=
113116
mca_base_framework_components_open(&oshmem_spml_base_framework, flags)) {

oshmem/mca/sshmem/base/sshmem_base_open.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "opal/mca/base/base.h"
1717
#include "opal/mca/base/mca_base_var.h"
1818

19+
#include "oshmem/util/oshmem_util.h"
1920
#include "oshmem/mca/sshmem/sshmem.h"
2021
#include "oshmem/mca/sshmem/base/base.h"
2122

@@ -86,6 +87,8 @@ mca_sshmem_base_register (mca_base_register_flag_t flags)
8687

8788
static int mca_sshmem_base_open(mca_base_open_flag_t flags)
8889
{
90+
oshmem_framework_open_output(&oshmem_sshmem_base_framework);
91+
8992
/* Open up all available components */
9093
if (OPAL_SUCCESS !=
9194
mca_base_framework_components_open(&oshmem_sshmem_base_framework, flags)) {

oshmem/util/oshmem_util.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <stdarg.h>
1414
#include <stdio.h>
1515

16-
#include "opal/util/output.h"
17-
1816
#include "oshmem/constants.h"
1917
#include "oshmem/util/oshmem_util.h"
2018

@@ -45,6 +43,7 @@ void oshmem_output_verbose(int level, int output_id, const char* prefix,
4543
}
4644
}
4745

46+
4847
void oshmem_output(int output_id, const char* prefix, const char* file,
4948
int line, const char* function, const char* format, ...)
5049
{

oshmem/util/oshmem_util.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
#include "oshmem_config.h"
1515

16+
#include "opal/util/output.h"
17+
#include "opal/mca/base/base.h"
18+
#include "opal/mca/base/mca_base_framework.h"
19+
1620
/*
1721
* Environment variables
1822
*/
@@ -32,4 +36,18 @@ void oshmem_output_verbose(int level, int output_id, const char* prefix,
3236
void oshmem_output(int output_id, const char* prefix, const char* file,
3337
int line, const char* function, const char* format, ...);
3438

39+
40+
/* Force opening output for framework
41+
* We would like to display error messages in any case (debug/release mode,
42+
* set/unset verbose level)
43+
* Setting verbose level is not a way because it enables non error messages
44+
*/
45+
static inline void oshmem_framework_open_output(struct mca_base_framework_t *framework)
46+
{
47+
if (-1 == framework->framework_output) {
48+
framework->framework_output = opal_output_open(NULL);
49+
}
50+
}
51+
52+
3553
#endif /* OSHMEM_UTIL_H */

0 commit comments

Comments
 (0)