Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threads squash rebase #6

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a8148b2
git up to HEAD
npe9 Feb 5, 2019
e30bd1a
add new wait_sync to pthreads mca
npe9 Feb 5, 2019
ed196ff
threads: improve pthreads comp configury
hppritcha Feb 5, 2019
7d3f6b9
small fixes to get the libevent thread working
npe9 Feb 5, 2019
db7591d
threads: add some copyrights
hppritcha Feb 5, 2019
cd586f5
threads: add some missed copyrights
hppritcha Feb 5, 2019
5b4c92b
threads: minor reformatting
hppritcha Feb 5, 2019
95d5cd0
readd stub header
npe9 Feb 5, 2019
a8b7820
fix thread_usage.h
npe9 Feb 5, 2019
770ae4b
get rid of null object leftovers
npe9 Feb 5, 2019
c30c6a5
reorgnize mutex header structure
npe9 Feb 5, 2019
4a9074e
sync_wait_mt no longer necessary
npe9 Feb 5, 2019
95c391f
add threading framework to opal_init
npe9 Feb 5, 2019
8116bdc
mca/threads: clean up
shintaro-iwasaki Feb 6, 2019
6514506
Merge pull request #2 from shintaro-iwasaki/threads-squash-rebase
npe9 Feb 6, 2019
df9ed9b
mca/threads: make a wrapper for cond.
shintaro-iwasaki Feb 7, 2019
e574970
mca/threads: fix Pthreads mutex implementation.
shintaro-iwasaki Feb 7, 2019
d498325
Merge pull request #4 from shintaro-iwasaki/threads-squash-rebase-pth
npe9 Feb 7, 2019
04ebf88
threads: rework configury
hppritcha Feb 7, 2019
026bb89
threads: remove workaround for mpi wrappers
hppritcha Feb 13, 2019
f203d57
config: fix thread configury
shintaro-iwasaki Feb 13, 2019
de2b838
config: implement Argobots check
shintaro-iwasaki Feb 13, 2019
c55be05
mca/threads: implement Argobots threading layer
shintaro-iwasaki Feb 13, 2019
fc5c7c5
[DON'T MERGE] libevent: reduce the poll interval.
shintaro-iwasaki Feb 14, 2019
9f26479
[DON'T MERGE] Fix tests to run make check.
shintaro-iwasaki Feb 7, 2019
e5791f9
Merge pull request #5 from shintaro-iwasaki/threads-squash-rebase-con…
hppritcha Feb 14, 2019
c7e4269
Merge pull request #3 from shintaro-iwasaki/threads-squash-rebase
hppritcha Feb 14, 2019
21b944c
threads/argobots: cast pointers for atomic functions
shintaro-iwasaki Mar 12, 2019
0e2245e
Merge pull request #6 from shintaro-iwasaki/thread-squash-rebase-abt-…
npe9 Mar 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ OPAL_CHECK_BROKEN_QSORT
#
# Check out what thread support we have
#
OPAL_CONFIG_THREADS
#OPAL_CONFIG_THREADS
Copy link
Owner Author

@hppritcha hppritcha Feb 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to set these compiler flags now in the threads framework in the various components, we may need to do something special here. We think we need to rework OPAL_CONFIG_THREADS to be more agnostic about type of threads. TODO: @hppritcha will enhance OPAL_CONFIG_THREADS


CFLAGS="$CFLAGS $THREAD_CFLAGS"
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
Expand Down
1 change: 0 additions & 1 deletion opal/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ endif
include class/Makefile.am
include memoryhooks/Makefile.am
include runtime/Makefile.am
include threads/Makefile.am
include mca/Makefile.am
include tools/Makefile.am
include dss/Makefile.am
2 changes: 2 additions & 0 deletions opal/mca/event/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ 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: 0 additions & 3 deletions opal/mca/event/external/external.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ 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: 0 additions & 3 deletions opal/mca/event/libevent2022/libevent2022.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ 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
40 changes: 40 additions & 0 deletions opal/mca/threads/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# main library setup
noinst_LTLIBRARIES = libmca_threads.la
libmca_threads_la_SOURCES =

# local files
headers = threads.h
nodist_headers =
libmca_threads_la_SOURCES += $(headers)

# Conditionally install the header files
if WANT_INSTALL_HEADERS
opaldir = $(opalincludedir)/$(subdir)
nobase_opal_HEADERS = $(headers)
nobase_nodist_opal_HEADERS = $(nodist_headers)
endif

include base/Makefile.am

distclean-local:
rm -f base/static-components.h
26 changes: 26 additions & 0 deletions opal/mca/threads/base/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

headers += \
base/base.h \
base/threads_base_null.h

libmca_threads_la_SOURCES += \
base/threads_base_open.c
47 changes: 47 additions & 0 deletions opal/mca/threads/base/base.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
*/

#ifndef OPAL_THREADS_BASE_H
#define OPAL_THREADS_BASE_H

#include "opal_config.h"
#include "opal/mca/base/mca_base_framework.h"
#include "opal/mca/threads/threads.h"


/*
* Global functions for MCA overall threads open and close
*/

BEGIN_C_DECLS

/**
* Framework structure declaration
*/
OPAL_DECLSPEC extern mca_base_framework_t opal_threads_base_framework;

END_C_DECLS

/* include implementation to call */
#include MCA_threads_IMPLEMENTATION_HEADER

#endif /* OPAL_BASE_THREADS_H */
7 changes: 7 additions & 0 deletions opal/mca/threads/base/owner.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# owner/status file
# owner: institution that is responsible for this package
# status: e.g. active, maintenance, unmaintained
#
owner: SNL
status: maintenance
54 changes: 54 additions & 0 deletions opal/mca/threads/base/threads_base_null.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/

#ifndef OPAL_MCA_TIMER_BASE_TIMER_BASE_NULL_H
#define OPAL_MCA_TIMER_BASE_TIMER_BASE_NULL_H

int opal_condition_t_class;
int opal_mutex_t_class;
int opal_recursive_mutex_t_class;

int opal_thread_join(opal_thread_t *t, void **thr_return)
{
return 0;
}

void opal_thread_set_main()
{
return 0;
}
int opal_thread_start(opal_thread_t *t)
{
return 0;
}

int *opal_thread_t_class = NULL;

int opal_tsd_key_create(opal_tsd_key_t *key, opal_tsd_destructor_t destructor)
{
return 0;
}

int opal_uses_threads = 0;
Copy link
Owner Author

@hppritcha hppritcha Feb 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really still use this file? Maybe not include this in the final PR?


int opal_tsd_keys_destruct()
{
return 0;
}
#endif
47 changes: 47 additions & 0 deletions opal/mca/threads/base/threads_base_open.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2019 Sandia National Laboratories. All rights reserved.
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/


#include "opal_config.h"

#include "opal/constants.h"
#include "opal/mca/threads/base/base.h"


/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#include "opal/mca/threads/base/static-components.h"

static int mca_threads_base_register(mca_base_register_flag_t flags)
{
// Do I need to register anything here?
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is where you'd define base MCA parameters for the threads component

return OPAL_SUCCESS;
}

/*
* Globals
*/
/* Use default register/open/close functions */
MCA_BASE_FRAMEWORK_DECLARE(opal, threads, "OPAL OS threads", mca_threads_base_register, NULL, NULL,
mca_threads_base_static_components, 0);
Loading