Skip to content

Commit

Permalink
mca/threads: remove libevent hack
Browse files Browse the repository at this point in the history
Argobots/Qthreads-aware libevent should be used instead.

Signed-off-by: Shintaro Iwasaki <siwasaki@anl.gov>
  • Loading branch information
shintaro-iwasaki committed Mar 26, 2020
1 parent 569221c commit 3dcdcaf
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 155 deletions.
2 changes: 0 additions & 2 deletions opal/mca/event/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ BEGIN_C_DECLS

#define OPAL_TIMEOUT_DEFAULT {1, 0}

OPAL_DECLSPEC void opal_event_use_threads(void);

/**
* Structure for event components.
*/
Expand Down
3 changes: 3 additions & 0 deletions opal/mca/event/external/external.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ OPAL_DECLSPEC int opal_event_finalize(void);

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

/* thread support APIs */
#define opal_event_use_threads() evthread_use_pthreads()

/* Basic event APIs */
#define opal_event_enable_debug_mode() event_enable_debug_mode()

Expand Down
3 changes: 3 additions & 0 deletions opal/mca/event/libevent2022/libevent2022.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ OPAL_DECLSPEC int opal_event_finalize(void);

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

/* thread support APIs */
#define opal_event_use_threads() evthread_use_pthreads()

/* Basic event APIs */
#define opal_event_enable_debug_mode() event_enable_debug_mode()

Expand Down
4 changes: 1 addition & 3 deletions opal/mca/threads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ The rest of the threading implementation follows the normal MCA model:

* `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.

* `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.

* `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.

* `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.
Expand All @@ -36,6 +34,6 @@ The rest of the threading implementation follows the normal MCA model:

## TODO

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.
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.

Open MPI itself needs to be altered to use a common yielding model instead of usleep(3).
1 change: 0 additions & 1 deletion opal/mca/threads/argobots/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ libmca_threads_argobots_la_SOURCES = \
threads_argobots.h \
threads_argobots_component.c \
threads_argobots_condition.c \
threads_argobots_event.c \
threads_argobots_module.c \
threads_argobots_mutex.c \
threads_argobots_mutex.h \
Expand Down
143 changes: 0 additions & 143 deletions opal/mca/threads/argobots/threads_argobots_event.c

This file was deleted.

5 changes: 0 additions & 5 deletions opal/mca/threads/pthreads/threads_pthreads_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,3 @@ int opal_tsd_keys_destruct(void)
void opal_thread_set_main(void)
{
}

void opal_event_use_threads(void)
{
evthread_use_pthreads();
}
1 change: 0 additions & 1 deletion opal/mca/threads/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ OPAL_DECLSPEC bool opal_thread_self_compare(opal_thread_t *);
OPAL_DECLSPEC opal_thread_t *opal_thread_get_self(void);
OPAL_DECLSPEC void opal_thread_kill(opal_thread_t *, int sig);
OPAL_DECLSPEC void opal_thread_set_main(void);
OPAL_DECLSPEC void opal_event_use_threads(void);

END_C_DECLS

Expand Down

0 comments on commit 3dcdcaf

Please sign in to comment.