Skip to content

Commit de72219

Browse files
npe9hppritcha
authored andcommitted
Add threads framework
Add a framework to support different types of threading models including user space thread packages such as Qthreads and argobot: https://github.com/pmodels/argobots https://github.com/Qthreads/qthreads The default threading model is pthreads. Alternate thread models are specificed at configure time using the --with-threads=X option. The framework is static. The theading model to use is selected at Open MPI configure/build time. Signed-off-by: Noah Evans <noah.evans@gmail.com>
1 parent bfff578 commit de72219

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2315
-767
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ OPAL_CHECK_BROKEN_QSORT
972972
#
973973
# Check out what thread support we have
974974
#
975-
OPAL_CONFIG_THREADS
975+
#OPAL_CONFIG_THREADS
976976

977977
CFLAGS="$CFLAGS $THREAD_CFLAGS"
978978
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"

opal/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ endif
7171
include class/Makefile.am
7272
include memoryhooks/Makefile.am
7373
include runtime/Makefile.am
74-
include threads/Makefile.am
7574
include mca/Makefile.am
7675
include tools/Makefile.am
7776
include dss/Makefile.am

opal/mca/event/event.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ BEGIN_C_DECLS
4848

4949
#define OPAL_TIMEOUT_DEFAULT {1, 0}
5050

51+
OPAL_DECLSPEC void opal_event_use_threads(void);
52+
5153
/**
5254
* Structure for event components.
5355
*/

opal/mca/event/external/external.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ 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-
7774
/* Basic event APIs */
7875
#define opal_event_enable_debug_mode() event_enable_debug_mode()
7976

opal/mca/event/libevent2022/libevent2022.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ 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-
108105
/* Basic event APIs */
109106
#define opal_event_enable_debug_mode() event_enable_debug_mode()
110107

opal/mca/threads/Makefile.am

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2004-2005 The University of Tennessee and The University
6+
# of Tennessee Research Foundation. All rights
7+
# reserved.
8+
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
# University of Stuttgart. All rights reserved.
10+
# Copyright (c) 2004-2005 The Regents of the University of California.
11+
# All rights reserved.
12+
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
13+
# $COPYRIGHT$
14+
#
15+
# Additional copyrights may follow
16+
#
17+
# $HEADER$
18+
#
19+
20+
# main library setup
21+
noinst_LTLIBRARIES = libmca_threads.la
22+
libmca_threads_la_SOURCES =
23+
24+
# local files
25+
headers = threads.h
26+
nodist_headers =
27+
libmca_threads_la_SOURCES += $(headers)
28+
29+
# Conditionally install the header files
30+
if WANT_INSTALL_HEADERS
31+
opaldir = $(opalincludedir)/$(subdir)
32+
nobase_opal_HEADERS = $(headers)
33+
nobase_nodist_opal_HEADERS = $(nodist_headers)
34+
endif
35+
36+
include base/Makefile.am
37+
38+
distclean-local:
39+
rm -f base/static-components.h

opal/mca/threads/base/Makefile.am

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2004-2005 The University of Tennessee and The University
6+
# of Tennessee Research Foundation. All rights
7+
# reserved.
8+
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
# University of Stuttgart. All rights reserved.
10+
# Copyright (c) 2004-2005 The Regents of the University of California.
11+
# All rights reserved.
12+
# $COPYRIGHT$
13+
#
14+
# Additional copyrights may follow
15+
#
16+
# $HEADER$
17+
#
18+
19+
headers += \
20+
base/base.h \
21+
base/threads_base_null.h
22+
23+
libmca_threads_la_SOURCES += \
24+
base/threads_base_open.c

opal/mca/threads/base/base.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2014 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
13+
* $COPYRIGHT$
14+
*
15+
* Additional copyrights may follow
16+
*
17+
* $HEADER$
18+
*
19+
*/
20+
21+
#ifndef OPAL_THREADS_BASE_H
22+
#define OPAL_THREADS_BASE_H
23+
24+
#include "opal_config.h"
25+
#include "opal/mca/base/mca_base_framework.h"
26+
#include "opal/mca/threads/threads.h"
27+
28+
29+
/*
30+
* Global functions for MCA overall threads open and close
31+
*/
32+
33+
BEGIN_C_DECLS
34+
35+
/**
36+
* Framework structure declaration
37+
*/
38+
OPAL_DECLSPEC extern mca_base_framework_t opal_threads_base_framework;
39+
40+
END_C_DECLS
41+
42+
/* include implementation to call */
43+
#include MCA_threads_IMPLEMENTATION_HEADER
44+
45+
#endif /* OPAL_BASE_THREADS_H */

opal/mca/threads/base/owner.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# owner/status file
3+
# owner: institution that is responsible for this package
4+
# status: e.g. active, maintenance, unmaintained
5+
#
6+
owner: SNL
7+
status: maintenance
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* $COPYRIGHT$
13+
*
14+
* Additional copyrights may follow
15+
*
16+
* $HEADER$
17+
*/
18+
19+
#ifndef OPAL_MCA_TIMER_BASE_TIMER_BASE_NULL_H
20+
#define OPAL_MCA_TIMER_BASE_TIMER_BASE_NULL_H
21+
22+
int opal_condition_t_class;
23+
int opal_mutex_t_class;
24+
int opal_recursive_mutex_t_class;
25+
26+
int opal_thread_join(opal_thread_t *t, void **thr_return) {
27+
return 0;
28+
}
29+
30+
void opal_thread_set_main() {
31+
return 0;
32+
}
33+
int opal_thread_start(opal_thread_t *t) {
34+
return 0;
35+
}
36+
int *opal_thread_t_class = NULL;
37+
38+
int opal_tsd_key_create(opal_tsd_key_t *key, opal_tsd_destructor_t destructor)
39+
{
40+
return 0;
41+
}
42+
int opal_uses_threads = 0;
43+
int opal_tsd_keys_destruct()
44+
{
45+
return 0;
46+
}
47+
#endif

0 commit comments

Comments
 (0)