Skip to content

Commit 3dcdcaf

Browse files
mca/threads: remove libevent hack
Argobots/Qthreads-aware libevent should be used instead. Signed-off-by: Shintaro Iwasaki <siwasaki@anl.gov>
1 parent 569221c commit 3dcdcaf

File tree

8 files changed

+7
-155
lines changed

8 files changed

+7
-155
lines changed

Diff for: opal/mca/event/event.h

-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ BEGIN_C_DECLS
4848

4949
#define OPAL_TIMEOUT_DEFAULT {1, 0}
5050

51-
OPAL_DECLSPEC void opal_event_use_threads(void);
52-
5351
/**
5452
* Structure for event components.
5553
*/

Diff for: opal/mca/event/external/external.h

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ OPAL_DECLSPEC int opal_event_finalize(void);
7171

7272
#define opal_event_set_priority(x, n) event_priority_set((x), (n))
7373

74+
/* thread support APIs */
75+
#define opal_event_use_threads() evthread_use_pthreads()
76+
7477
/* Basic event APIs */
7578
#define opal_event_enable_debug_mode() event_enable_debug_mode()
7679

Diff for: opal/mca/event/libevent2022/libevent2022.h

+3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ OPAL_DECLSPEC int opal_event_finalize(void);
102102

103103
#define opal_event_set_priority(x, n) event_priority_set((x), (n))
104104

105+
/* thread support APIs */
106+
#define opal_event_use_threads() evthread_use_pthreads()
107+
105108
/* Basic event APIs */
106109
#define opal_event_enable_debug_mode() event_enable_debug_mode()
107110

Diff for: opal/mca/threads/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ The rest of the threading implementation follows the normal MCA model:
2626

2727
* `threads_<threading_model>_condition.c` defines an instance of `opal_condition_t` which is used by `condition.h` to define Open MPI specific condition variables.
2828

29-
* `threads_<threading_model>_event.c` defines an interface to Open MPI's libevent hooks. It allows the threading module to use threading model specific memory allocation and synchronization structures with Open MPI's libevent integration.
30-
3129
* `threads_<threading_model>_module.c` defines the interface to opal's thread handle. It provides ways of comparing threads, getting the value of a thread via its handle and the implementation of thread local storage.
3230

3331
* `threads_<threading_model>_mutex.c` provides a slow path interface to creating and destroying mutices dynamically via mca allocation. They can also be defined statically using the `.h` fast path interface.
@@ -36,6 +34,6 @@ The rest of the threading implementation follows the normal MCA model:
3634

3735
## TODO
3836

39-
Libevent integration with lightweight threading models is a work in progress. The current Open MPI libevent library assumes preemption and does not yield by default. Lightweight threading libraries typically require tasks to be cooperative and to voluntarily yield after some time.
37+
Some components in the current Open MPI runtime assume preemption and does not yield by default. Lightweight threading libraries typically require tasks to be cooperative and to voluntarily yield after some time.
4038

4139
Open MPI itself needs to be altered to use a common yielding model instead of usleep(3).

Diff for: opal/mca/threads/argobots/Makefile.am

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ libmca_threads_argobots_la_SOURCES = \
2424
threads_argobots.h \
2525
threads_argobots_component.c \
2626
threads_argobots_condition.c \
27-
threads_argobots_event.c \
2827
threads_argobots_module.c \
2928
threads_argobots_mutex.c \
3029
threads_argobots_mutex.h \

Diff for: opal/mca/threads/argobots/threads_argobots_event.c

-143
This file was deleted.

Diff for: opal/mca/threads/pthreads/threads_pthreads_module.c

-5
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,3 @@ int opal_tsd_keys_destruct(void)
137137
void opal_thread_set_main(void)
138138
{
139139
}
140-
141-
void opal_event_use_threads(void)
142-
{
143-
evthread_use_pthreads();
144-
}

Diff for: opal/mca/threads/threads.h

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ OPAL_DECLSPEC bool opal_thread_self_compare(opal_thread_t *);
132132
OPAL_DECLSPEC opal_thread_t *opal_thread_get_self(void);
133133
OPAL_DECLSPEC void opal_thread_kill(opal_thread_t *, int sig);
134134
OPAL_DECLSPEC void opal_thread_set_main(void);
135-
OPAL_DECLSPEC void opal_event_use_threads(void);
136135

137136
END_C_DECLS
138137

0 commit comments

Comments
 (0)