From 2770a12bebed7942b42a21bf63dfdafdfcf0fda4 Mon Sep 17 00:00:00 2001 From: Eugene Loh Date: Fri, 18 Mar 2011 21:36:35 +0000 Subject: [PATCH] Continue clean up of thread options started in r22841, 22842, and 22849. No need for any CMRs to 1.5... that was already done in CMR 2728. This commit was SVN r24545. The following SVN revision numbers were found above: r22841 --> open-mpi/ompi@b400b84162a9737d9c5ba58b4f993326aca13a8c --- README | 18 ++++++------- .../win32/CMakeModules/ompi_configure.cmake | 10 +++---- ompi/config/ompi_config_threads.m4 | 12 ++++----- ompi/mca/btl/openib/btl_openib_fd.c | 4 +-- ompi/mca/mpool/base/mpool_base_init.c | 6 ++--- ompi/mca/op/example/op_example_component.c | 12 ++++----- ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c | 2 +- ompi/mca/osc/rdma/osc_rdma_data_move.c | 2 +- ompi/mca/pml/bfo/pml_bfo_comm.h | 4 +-- ompi/mca/pml/bfo/pml_bfo_recvreq.h | 4 +-- ompi/mca/pml/bfo/pml_bfo_sendreq.h | 2 +- ompi/mca/pml/csum/pml_csum_comm.h | 4 +-- ompi/mca/pml/csum/pml_csum_recvreq.h | 4 +-- ompi/mca/pml/csum/pml_csum_sendreq.h | 2 +- ompi/mca/pml/dr/pml_dr_comm.h | 4 +-- ompi/mca/pml/dr/pml_dr_sendreq.h | 2 +- ompi/mca/pml/ob1/pml_ob1_comm.h | 4 +-- ompi/mca/pml/ob1/pml_ob1_recvreq.h | 4 +-- ompi/mca/pml/ob1/pml_ob1_sendreq.h | 2 +- ompi/mca/pml/v/pml_v_component.c | 10 +++---- ompi/mpi/man/man3/MPI_Init_thread.3in | 2 +- ompi/request/req_wait.c | 4 +-- ompi/runtime/ompi_mpi_init.c | 2 +- ompi/tools/ompi_info/param.c | 6 ++--- opal/class/opal_atomic_lifo.h | 12 ++++----- opal/class/opal_object.h | 6 ++--- opal/include/opal_config_bottom.h | 2 -- opal/runtime/opal_progress.c | 26 +++++++++---------- opal/runtime/opal_progress.h | 2 +- opal/threads/condition.h | 24 ++++++++--------- opal/threads/mutex.c | 6 ++--- opal/threads/mutex.h | 22 ++++++++-------- opal/threads/mutex_unix.h | 2 +- .../notifier/command/notifier_command_child.c | 4 +-- .../notifier/command/notifier_command_fd.c | 4 +-- orte/runtime/orte_wait.c | 2 +- orte/tools/orte-info/param.c | 6 ++--- test/threads/opal_condition.c | 4 +-- test/threads/opal_thread.c | 4 +-- 39 files changed, 125 insertions(+), 127 deletions(-) diff --git a/README b/README index 56627c59f0..efaa3069fe 100644 --- a/README +++ b/README @@ -381,9 +381,10 @@ MPI Functionality and Features - MPI_THREAD_MULTIPLE support is included, but is only lightly tested. It likely does not work for thread-intensive applications. Note that *only* the MPI point-to-point communication functions for the - BTL's listed above are considered thread safe. Other support - functions (e.g., MPI attributes) have not been certified as safe - when simultaneously used by multiple threads. + BTL's listed earlier (search for "MPI_THREAD_MULTIPLE support") are + considered thread safe. Other support functions (e.g., MPI attributes) + have not been certified as safe when simultaneously used by multiple + threads. Note that Open MPI's thread support is in a fairly early stage; the above devices are likely to *work*, but the latency is likely to be @@ -804,18 +805,17 @@ for a full list); a summary of the more commonly used ones follows: --with-threads; this is currently disabled by default. Enabling this feature will automatically --enable-opal-multi-threads. +--enable-opal-multi-threads + Enables thread lock support in the OPAL and ORTE layers. Does + not enable MPI_THREAD_MULTIPLE - see above option for that feature. + This is currently disabled by default. + --with-fca= Specify the directory where the Voltaire FCA library and header files are located. FCA is the support library for Voltaire QDR switches. - ---enable-opal-multi-threads - Enables thread lock support in the OPAL and ORTE layers. Does - not enable MPI_THREAD_MULTIPLE - see above option for that feature. - This is currently disabled by default. - --disable-mpi-cxx Disable building the C++ MPI bindings. Note that this does *not* disable the C++ checks during configure; some of Open MPI's tools diff --git a/contrib/platform/win32/CMakeModules/ompi_configure.cmake b/contrib/platform/win32/CMakeModules/ompi_configure.cmake index 3e2bef81cf..9424a22ca5 100644 --- a/contrib/platform/win32/CMakeModules/ompi_configure.cmake +++ b/contrib/platform/win32/CMakeModules/ompi_configure.cmake @@ -200,15 +200,15 @@ OMPI_DEF_OPT(OPAL_ENABLE_MEM_PROFILE "Whether we want the memory profiling or no OMPI_DEF_OPT(OMPI_ENABLE_MPI_PROFILING "Whether we want MPI profiling or not." ON) -OMPI_DEF_OPT(OMPI_ENABLE_THREAD_MULTIPLE "Enable MPI Thread Multiple." OFF) +OMPI_DEF_OPT(OMPI_ENABLE_THREAD_MULTIPLE "Enable MPI_THREAD_MULTIPLE." OFF) -OMPI_DEF(OMPI_ENABLE_PROGRESS_THREADS 0 "Hardcode the OMPI progress thread to be off." 0 1) +OMPI_DEF(OMPI_ENABLE_PROGRESS_THREADS 0 "Hardwire OMPI progress threads to be off." 0 1) -OMPI_DEF(ORTE_ENABLE_PROGRESS_THREADS 0 "Hardcode the ORTE progress thread to be off." 0 1) +OMPI_DEF(ORTE_ENABLE_PROGRESS_THREADS 0 "Hardwire ORTE progress threads to be off." 0 1) -OMPI_DEF_OPT(OPAL_ENABLE_MULTI_THREADS "Whether we should enable support for multiple user threads" OFF) +OMPI_DEF_OPT(OPAL_ENABLE_MULTI_THREADS "Whether we should enable OPAL thread support." OFF) -OMPI_DEF_OPT(OPAL_ENABLE_PTY_SUPPORT "Whether we should use progress threads rather than polling." OFF) +OMPI_DEF_OPT(OPAL_ENABLE_PTY_SUPPORT "Whether we should enable PTY support for STDIO forwarding." OFF) OMPI_DEF_OPT ( OMPI_GROUP_SPARSE "Wether we want sparse process groups." OFF) diff --git a/ompi/config/ompi_config_threads.m4 b/ompi/config/ompi_config_threads.m4 index a4d2be5f02..21534fcbc9 100644 --- a/ompi/config/ompi_config_threads.m4 +++ b/ompi/config/ompi_config_threads.m4 @@ -30,23 +30,23 @@ AC_DEFUN([OMPI_CONFIG_THREADS],[ # # -# Thread Multiple +# MPI_THREAD_MULTIPLE # # --enable-mpi-thread-multiple # #if OMPI_ENABLE_THREAD_MULTIPLE == 0 /* Not available */ # #if OMPI_ENABLE_THREAD_MULTIPLE == 1 /* Available */ # -AC_MSG_CHECKING([if want MPI thread support]) +AC_MSG_CHECKING([if want MPI_THREAD_MULTIPLE support]) AC_ARG_ENABLE([mpi_thread_multiple], [AC_HELP_STRING([--enable-mpi-thread-multiple], - [Enable thread support for MPI applications (default: disabled)])], + [Enable MPI_THREAD_MULTIPLE support (default: disabled)])], [enable_mpi_threads="$enableval"], [enable_mpi_threads="undef"]) # if they did not want OPAL thread support, then they cannot have this option if test "$enable_mpi_threads" = "yes" -a "$enable_opal_multi_threads" = "no"; then AC_MSG_WARN(["failed"]) - AC_MSG_WARN(["*** You have requested MPI thread multiple support but thread"]) + AC_MSG_WARN(["*** You have requested MPI_THREAD_MULTIPLE support but thread"]) AC_MSG_WARN(["*** support was disabled within the OPAL code base by"]) AC_MSG_WARN(["*** --disable-opal-multi-threads on your configure command."]) AC_MSG_ERROR(["*** Can not continue."]) @@ -66,7 +66,7 @@ elif test "$enable_mpi_threads" = "yes" -a "$enable_opal_multi_threads" = "undef OPAL_ENABLE_MULTI_THREADS=1 enable_opal_multi_threads="yes" AC_DEFINE_UNQUOTED([OPAL_ENABLE_MULTI_THREADS], [$OPAL_ENABLE_MULTI_THREADS], - [Whether we should enable support for multiple user threads]) + [Whether we should enable thread support within the OPAL code base]) ompi_want_mpi_threads=1 OMPI_ENABLE_THREAD_MULTIPLE=1 AC_MSG_RESULT([Enabled - OPAL thread support automatically enabled]) @@ -77,7 +77,7 @@ else AC_MSG_RESULT([Disabled]) fi AC_DEFINE_UNQUOTED([OMPI_ENABLE_THREAD_MULTIPLE], [$ompi_want_mpi_threads], - [Enable MPI Thread Multiple]) + [Enable MPI_THREAD_MULTIPLE]) ])dnl diff --git a/ompi/mca/btl/openib/btl_openib_fd.c b/ompi/mca/btl/openib/btl_openib_fd.c index ff807036f3..788b308527 100644 --- a/ompi/mca/btl/openib/btl_openib_fd.c +++ b/ompi/mca/btl/openib/btl_openib_fd.c @@ -15,12 +15,12 @@ * #if conditionals). We also don't protect including . * That's because this component currently only compiles on Linux and * Solaris, and both of these OS's have pthreads. Using the run-time - * conditionals gives us bettern compile-time checking, even of code + * conditionals gives us better compile-time checking, even of code * that isn't activated. * * Note, too, that the functionality in this file does *not* require * all the heavyweight OMPI thread infrastructure (e.g., from - * --enable-mpi-threads or --enable-progress-threads). All work that + * --enable-mpi-thread-multiple or --enable-progress-threads). All work that * is done in a separate progress thread is very carefully segregated * from that of the main thread, and communication back to the main * thread diff --git a/ompi/mca/mpool/base/mpool_base_init.c b/ompi/mca/mpool/base/mpool_base_init.c index 19b4a9dd92..752718f6b0 100644 --- a/ompi/mca/mpool/base/mpool_base_init.c +++ b/ompi/mca/mpool/base/mpool_base_init.c @@ -24,7 +24,7 @@ OBJ_CLASS_INSTANCE(mca_mpool_base_selected_module_t, opal_list_item_t, NULL, NULL); static bool mca_mpool_enable_progress_threads = true; -static bool mca_mpool_enable_mpi_threads = true; +static bool mca_mpool_enable_mpi_thread_multiple = true; /** * Function for weeding out mpool modules that don't want to run. @@ -34,10 +34,10 @@ static bool mca_mpool_enable_mpi_threads = true; * will be closed and unloaded. The selected modules will be returned * to the caller in a opal_list_t. */ -int mca_mpool_base_init(bool enable_progress_threads, bool enable_mpi_threads) +int mca_mpool_base_init(bool enable_progress_threads, bool enable_mpi_thread_multiple) { mca_mpool_enable_progress_threads = enable_progress_threads; - mca_mpool_enable_mpi_threads = enable_mpi_threads; + mca_mpool_enable_mpi_thread_multiple = enable_mpi_thread_multiple; return OMPI_SUCCESS; } diff --git a/ompi/mca/op/example/op_example_component.c b/ompi/mca/op/example/op_example_component.c index fd27724074..73dbf7dda9 100644 --- a/ompi/mca/op/example/op_example_component.c +++ b/ompi/mca/op/example/op_example_component.c @@ -38,7 +38,7 @@ static int example_component_open(void); static int example_component_close(void); static int example_component_init_query(bool enable_progress_threads, - bool enable_mpi_threads); + bool enable_mpi_thread_multiple); static struct ompi_op_base_module_1_0_0_t * example_component_op_query(struct ompi_op_t *op, int *priority); static int example_component_register(void); @@ -168,7 +168,7 @@ static int example_component_register(void) * Query whether this component wants to be used in this process. */ static int example_component_init_query(bool enable_progress_threads, - bool enable_mpi_threads) + bool enable_mpi_thread_multiple) { opal_output(ompi_op_base_output, "example component init query"); @@ -184,9 +184,9 @@ static int example_component_init_query(bool enable_progress_threads, the MPI_Op component selection process. The input parameters enable_progress_threads and - enable_mpi_threads also tell the component the following: + enable_mpi_thread_multiple also tell the component the following: - - If enable_process_threads==true, then the component is + - If enable_progress_threads==true, then the component is allowed to have a progress thread in the background that is supported by the OMPI infrastructure (i.e., all of OMPI's locks and whatnot are active in this build). Note that the @@ -199,7 +199,7 @@ static int example_component_init_query(bool enable_progress_threads, multi-threaded safe and whether multi-threading sync/IPC mechanisms in the OMPI code base are active. - - If enable_mpi_threads==true, the MPI_THREAD_MULTIPLE is + - If enable_mpi_thread_multiple==true, then MPI_THREAD_MULTIPLE is active. Note that a component can uses these values to deactivate @@ -223,7 +223,7 @@ static int example_component_init_query(bool enable_progress_threads, be called in the future for each intrinsic MPI_Op). Otherwise, return OMPI_ERR_NOT_SUPPORTED (indicating that this component will be closed and discarded). */ - if (mca_op_example_component.hardware_available && !enable_mpi_threads) { + if (mca_op_example_component.hardware_available && !enable_mpi_thread_multiple) { return OMPI_SUCCESS; } return OMPI_ERR_NOT_SUPPORTED; diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c b/ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c index 15f8fd138b..01fb223dd8 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c @@ -37,7 +37,7 @@ static inline int32_t create_send_tag(ompi_osc_pt2pt_module_t *module) { -#if OPAL_HAVE_THREAD_SUPPORT && OPAL_HAVE_ATOMIC_CMPSET_32 +#if OPAL_ENABLE_MULTI_THREADS && OPAL_HAVE_ATOMIC_CMPSET_32 int32_t newval, oldval; do { oldval = module->p2p_tag_counter; diff --git a/ompi/mca/osc/rdma/osc_rdma_data_move.c b/ompi/mca/osc/rdma/osc_rdma_data_move.c index 7e6e80fc2e..909530f72c 100644 --- a/ompi/mca/osc/rdma/osc_rdma_data_move.c +++ b/ompi/mca/osc/rdma/osc_rdma_data_move.c @@ -42,7 +42,7 @@ static inline int32_t create_send_tag(ompi_osc_rdma_module_t *module) { -#if OPAL_HAVE_THREAD_SUPPORT && OPAL_HAVE_ATOMIC_CMPSET_32 +#if OPAL_ENABLE_MULTI_THREADS && OPAL_HAVE_ATOMIC_CMPSET_32 int32_t newval, oldval; do { oldval = module->m_tag_counter; diff --git a/ompi/mca/pml/bfo/pml_bfo_comm.h b/ompi/mca/pml/bfo/pml_bfo_comm.h index c9564480fb..44c8c4bc6e 100644 --- a/ompi/mca/pml/bfo/pml_bfo_comm.h +++ b/ompi/mca/pml/bfo/pml_bfo_comm.h @@ -32,7 +32,7 @@ struct mca_pml_bfo_comm_proc_t { opal_object_t super; uint16_t expected_sequence; /**< send message sequence number - receiver side */ struct ompi_proc_t* ompi_proc; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile int32_t send_sequence; /**< send side sequence number */ #else int32_t send_sequence; /**< send side sequence number */ @@ -50,7 +50,7 @@ typedef struct mca_pml_bfo_comm_proc_t mca_pml_bfo_comm_proc_t; */ struct mca_pml_comm_t { opal_object_t super; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile uint32_t recv_sequence; /**< recv request sequence number - receiver side */ #else uint32_t recv_sequence; /**< recv request sequence number - receiver side */ diff --git a/ompi/mca/pml/bfo/pml_bfo_recvreq.h b/ompi/mca/pml/bfo/pml_bfo_recvreq.h index 2de56b126f..69d12b0434 100644 --- a/ompi/mca/pml/bfo/pml_bfo_recvreq.h +++ b/ompi/mca/pml/bfo/pml_bfo_recvreq.h @@ -194,7 +194,7 @@ recv_request_pml_complete(mca_pml_bfo_recv_request_t *recvreq) static inline bool recv_request_pml_complete_check(mca_pml_bfo_recv_request_t *recvreq) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_rmb(); #endif if(recvreq->req_match_received && @@ -241,7 +241,7 @@ static inline void recv_req_matched(mca_pml_bfo_recv_request_t *req, #if PML_BFO req->req_msgseq = hdr->hdr_seq; #endif /* PML_BFO */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_wmb(); #endif if(req->req_recv.req_bytes_packed > 0) { diff --git a/ompi/mca/pml/bfo/pml_bfo_sendreq.h b/ompi/mca/pml/bfo/pml_bfo_sendreq.h index 15e682be06..f8b975e220 100644 --- a/ompi/mca/pml/bfo/pml_bfo_sendreq.h +++ b/ompi/mca/pml/bfo/pml_bfo_sendreq.h @@ -263,7 +263,7 @@ send_request_pml_complete(mca_pml_bfo_send_request_t *sendreq) static inline bool send_request_pml_complete_check(mca_pml_bfo_send_request_t *sendreq) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_rmb(); #endif /* if no more events are expected for the request and the whole message is diff --git a/ompi/mca/pml/csum/pml_csum_comm.h b/ompi/mca/pml/csum/pml_csum_comm.h index adb65a635a..71a6eb3df5 100644 --- a/ompi/mca/pml/csum/pml_csum_comm.h +++ b/ompi/mca/pml/csum/pml_csum_comm.h @@ -31,7 +31,7 @@ struct mca_pml_csum_comm_proc_t { opal_object_t super; uint16_t expected_sequence; /**< send message sequence number - receiver side */ struct ompi_proc_t* ompi_proc; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile int32_t send_sequence; /**< send side sequence number */ #else int32_t send_sequence; /**< send side sequence number */ @@ -49,7 +49,7 @@ typedef struct mca_pml_csum_comm_proc_t mca_pml_csum_comm_proc_t; */ struct mca_pml_comm_t { opal_object_t super; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile uint32_t recv_sequence; /**< recv request sequence number - receiver side */ #else uint32_t recv_sequence; /**< recv request sequence number - receiver side */ diff --git a/ompi/mca/pml/csum/pml_csum_recvreq.h b/ompi/mca/pml/csum/pml_csum_recvreq.h index 6fbd8fb4ad..b62d96a116 100644 --- a/ompi/mca/pml/csum/pml_csum_recvreq.h +++ b/ompi/mca/pml/csum/pml_csum_recvreq.h @@ -180,7 +180,7 @@ recv_request_pml_complete(mca_pml_csum_recv_request_t *recvreq) static inline bool recv_request_pml_complete_check(mca_pml_csum_recv_request_t *recvreq) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_rmb(); #endif if(recvreq->req_match_received && @@ -220,7 +220,7 @@ static inline void recv_req_matched(mca_pml_csum_recv_request_t *req, req->req_recv.req_base.req_ompi.req_status.MPI_SOURCE = hdr->hdr_src; req->req_recv.req_base.req_ompi.req_status.MPI_TAG = hdr->hdr_tag; req->req_match_received = true; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_wmb(); #endif if(req->req_recv.req_bytes_packed > 0) { diff --git a/ompi/mca/pml/csum/pml_csum_sendreq.h b/ompi/mca/pml/csum/pml_csum_sendreq.h index 17f17a4d01..bdaeb7e841 100644 --- a/ompi/mca/pml/csum/pml_csum_sendreq.h +++ b/ompi/mca/pml/csum/pml_csum_sendreq.h @@ -257,7 +257,7 @@ send_request_pml_complete(mca_pml_csum_send_request_t *sendreq) static inline bool send_request_pml_complete_check(mca_pml_csum_send_request_t *sendreq) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_rmb(); #endif /* if no more events are expected for the request and the whole message is diff --git a/ompi/mca/pml/dr/pml_dr_comm.h b/ompi/mca/pml/dr/pml_dr_comm.h index ee8f9533bc..cc6e1d62d4 100644 --- a/ompi/mca/pml/dr/pml_dr_comm.h +++ b/ompi/mca/pml/dr/pml_dr_comm.h @@ -32,7 +32,7 @@ BEGIN_C_DECLS struct mca_pml_dr_comm_proc_t { opal_object_t super; uint16_t expected_sequence; /**< send message sequence number - receiver side */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile int32_t send_sequence; /**< send side sequence number */ #else int32_t send_sequence; /**< send side sequence number */ @@ -54,7 +54,7 @@ typedef struct mca_pml_dr_comm_proc_t mca_pml_dr_comm_proc_t; */ struct mca_pml_comm_t { opal_object_t super; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile uint32_t recv_sequence; /**< recv request sequence number - receiver side */ #else uint32_t recv_sequence; /**< recv request sequence number - receiver side */ diff --git a/ompi/mca/pml/dr/pml_dr_sendreq.h b/ompi/mca/pml/dr/pml_dr_sendreq.h index 0389c8f264..76057097e4 100644 --- a/ompi/mca/pml/dr/pml_dr_sendreq.h +++ b/ompi/mca/pml/dr/pml_dr_sendreq.h @@ -43,7 +43,7 @@ struct mca_pml_dr_send_request_t { mca_pml_base_send_request_t req_send; mca_pml_dr_comm_proc_t* req_proc; mca_pml_dr_endpoint_t* req_endpoint; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile int32_t req_state; volatile int32_t req_lock; #else diff --git a/ompi/mca/pml/ob1/pml_ob1_comm.h b/ompi/mca/pml/ob1/pml_ob1_comm.h index cadf317d61..ea11654b08 100644 --- a/ompi/mca/pml/ob1/pml_ob1_comm.h +++ b/ompi/mca/pml/ob1/pml_ob1_comm.h @@ -31,7 +31,7 @@ struct mca_pml_ob1_comm_proc_t { opal_object_t super; uint16_t expected_sequence; /**< send message sequence number - receiver side */ struct ompi_proc_t* ompi_proc; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile int32_t send_sequence; /**< send side sequence number */ #else int32_t send_sequence; /**< send side sequence number */ @@ -49,7 +49,7 @@ typedef struct mca_pml_ob1_comm_proc_t mca_pml_ob1_comm_proc_t; */ struct mca_pml_comm_t { opal_object_t super; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile uint32_t recv_sequence; /**< recv request sequence number - receiver side */ #else uint32_t recv_sequence; /**< recv request sequence number - receiver side */ diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.h b/ompi/mca/pml/ob1/pml_ob1_recvreq.h index a923631ed4..182e3d2d28 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.h +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.h @@ -179,7 +179,7 @@ recv_request_pml_complete(mca_pml_ob1_recv_request_t *recvreq) static inline bool recv_request_pml_complete_check(mca_pml_ob1_recv_request_t *recvreq) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_rmb(); #endif if(recvreq->req_match_received && @@ -219,7 +219,7 @@ static inline void recv_req_matched(mca_pml_ob1_recv_request_t *req, req->req_recv.req_base.req_ompi.req_status.MPI_SOURCE = hdr->hdr_src; req->req_recv.req_base.req_ompi.req_status.MPI_TAG = hdr->hdr_tag; req->req_match_received = true; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_wmb(); #endif if(req->req_recv.req_bytes_packed > 0) { diff --git a/ompi/mca/pml/ob1/pml_ob1_sendreq.h b/ompi/mca/pml/ob1/pml_ob1_sendreq.h index ebe06c6ac8..6b00c96ee1 100644 --- a/ompi/mca/pml/ob1/pml_ob1_sendreq.h +++ b/ompi/mca/pml/ob1/pml_ob1_sendreq.h @@ -254,7 +254,7 @@ send_request_pml_complete(mca_pml_ob1_send_request_t *sendreq) static inline bool send_request_pml_complete_check(mca_pml_ob1_send_request_t *sendreq) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_rmb(); #endif /* if no more events are expected for the request and the whole message is diff --git a/ompi/mca/pml/v/pml_v_component.c b/ompi/mca/pml/v/pml_v_component.c index de42d123a0..cf08517374 100644 --- a/ompi/mca/pml/v/pml_v_component.c +++ b/ompi/mca/pml/v/pml_v_component.c @@ -25,7 +25,7 @@ static int mca_pml_v_component_open(void); static int mca_pml_v_component_close(void); static int mca_pml_v_component_parasite_close(void); -static mca_pml_base_module_t *mca_pml_v_component_init(int* priority, bool enable_threads, bool enable_progress_threads); +static mca_pml_base_module_t *mca_pml_v_component_init(int* priority, bool enable_progress_threads, bool enable_mpi_thread_multiple); static int mca_pml_v_component_finalize(void); static int mca_pml_v_component_parasite_finalize(void); @@ -56,7 +56,7 @@ mca_pml_base_component_2_0_0_t mca_pml_v_component = }; static bool pml_v_enable_progress_treads = OMPI_ENABLE_PROGRESS_THREADS; -static bool pml_v_enable_mpi_threads = OMPI_ENABLE_THREAD_MULTIPLE; +static bool pml_v_enable_mpi_thread_multiple = OMPI_ENABLE_THREAD_MULTIPLE; /******************************************************************************* * MCA level functions - parasite setup @@ -161,12 +161,12 @@ static int mca_pml_v_component_parasite_close(void) */ static mca_pml_base_module_t *mca_pml_v_component_init(int *priority, bool enable_progress_threads, - bool enable_mpi_threads) + bool enable_mpi_thread_multiple) { V_OUTPUT_VERBOSE(1, "init: I'm not supposed to be here until BTL loading stuff gets fixed!? That's strange..."); pml_v_enable_progress_treads = enable_progress_threads; - pml_v_enable_mpi_threads = enable_mpi_threads; + pml_v_enable_mpi_thread_multiple = enable_mpi_thread_multiple; /* I NEVER want to be the selected PML, so I report less than possible * priority and a NULL module @@ -202,7 +202,7 @@ static int mca_pml_v_enable(bool enable) /* Check if a protocol have been selected during init */ if(! mca_vprotocol_base_selected()) mca_vprotocol_base_select(pml_v_enable_progress_treads, - pml_v_enable_mpi_threads); + pml_v_enable_mpi_thread_multiple); /* Check if we succeeded selecting a protocol */ if(mca_vprotocol_base_selected()) { diff --git a/ompi/mpi/man/man3/MPI_Init_thread.3in b/ompi/mpi/man/man3/MPI_Init_thread.3in index 41ef5e2b64..05e61085c8 100644 --- a/ompi/mpi/man/man3/MPI_Init_thread.3in +++ b/ompi/mpi/man/man3/MPI_Init_thread.3in @@ -124,7 +124,7 @@ opening files, reading standard input, or writing to standard output. .SH MPI_THREAD_MULTIPLE Support . MPI_THREAD_MULTIPLE support is included if Open MPI was configured -with the --enable-thread-multiple configure switch. You can check the +with the --enable-mpi-thread-multiple configure switch. You can check the output of .BR ompi_info (1) to see if Open MPI has MPI_THREAD_MULTIPLE support: diff --git a/ompi/request/req_wait.c b/ompi/request/req_wait.c index 17a08c1d0b..206cf0326c 100644 --- a/ompi/request/req_wait.c +++ b/ompi/request/req_wait.c @@ -238,7 +238,7 @@ int ompi_request_default_wait_all( size_t count, */ OPAL_THREAD_LOCK(&ompi_request_lock); ompi_request_waiting++; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS /* * confirm the status of the pending requests. We have to do it before * taking the condition or otherwise we can miss some requests completion (the @@ -251,7 +251,7 @@ int ompi_request_default_wait_all( size_t count, completed++; } } -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ while( completed != count ) { /* check number of pending requests */ size_t start = ompi_request_completed; diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index 029af9cacd..3a690d9e46 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -376,7 +376,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) this value. */ ompi_mpi_thread_requested = requested; - if (OPAL_HAVE_THREAD_SUPPORT == 0) { + if (OPAL_ENABLE_MULTI_THREADS == 0) { ompi_mpi_thread_provided = *provided = MPI_THREAD_SINGLE; ompi_mpi_main_thread = NULL; } else if (OMPI_ENABLE_THREAD_MULTIPLE == 1) { diff --git a/ompi/tools/ompi_info/param.c b/ompi/tools/ompi_info/param.c index 731ba958ff..cddaa9bca3 100644 --- a/ompi/tools/ompi_info/param.c +++ b/ompi/tools/ompi_info/param.c @@ -572,9 +572,9 @@ void ompi_info_do_config(bool want_all) f77 = strdup("no"); } - if (OPAL_HAVE_SOLARIS_THREADS || OPAL_HAVE_POSIX_THREADS) { - asprintf(&threads, "%s (mpi: %s, progress: %s)", OPAL_HAVE_SOLARIS_THREADS ? "solaris" : - (OPAL_HAVE_POSIX_THREADS ? "posix" : "type unknown"), + if (OPAL_HAVE_SOLARIS_THREADS || OPAL_HAVE_POSIX_THREADS) { /* should just test OPAL_HAVE_THREADS */ + asprintf(&threads, "%s (MPI_THREAD_MULTIPLE: %s, progress: %s)", OPAL_HAVE_SOLARIS_THREADS ? "solaris" : + (OPAL_HAVE_POSIX_THREADS ? "posix" : "type unknown"), /* "type unknown" can presumably never happen */ OMPI_ENABLE_THREAD_MULTIPLE ? "yes" : "no", OMPI_ENABLE_PROGRESS_THREADS ? "yes" : "no"); } else { diff --git a/opal/class/opal_atomic_lifo.h b/opal/class/opal_atomic_lifo.h index 7418fcc3ea..8a8e21490e 100644 --- a/opal/class/opal_atomic_lifo.h +++ b/opal/class/opal_atomic_lifo.h @@ -24,9 +24,9 @@ #include "opal_config.h" #include "opal/class/opal_list.h" -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #include "opal/sys/atomic.h" -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ BEGIN_C_DECLS @@ -68,7 +68,7 @@ static inline bool opal_atomic_lifo_is_empty( opal_atomic_lifo_t* lifo ) static inline opal_list_item_t* opal_atomic_lifo_push( opal_atomic_lifo_t* lifo, opal_list_item_t* item ) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS do { item->opal_list_next = lifo->opal_lifo_head; opal_atomic_wmb(); @@ -84,7 +84,7 @@ static inline opal_list_item_t* opal_atomic_lifo_push( opal_atomic_lifo_t* lifo, item->opal_list_next = lifo->opal_lifo_head; lifo->opal_lifo_head = item; return (opal_list_item_t*)item->opal_list_next; -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ } /* Retrieve one element from the LIFO. If we reach the ghost element then the LIFO @@ -93,7 +93,7 @@ static inline opal_list_item_t* opal_atomic_lifo_push( opal_atomic_lifo_t* lifo, static inline opal_list_item_t* opal_atomic_lifo_pop( opal_atomic_lifo_t* lifo ) { opal_list_item_t* item; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS while((item = lifo->opal_lifo_head) != &(lifo->opal_lifo_ghost)) { opal_atomic_rmb(); @@ -109,7 +109,7 @@ static inline opal_list_item_t* opal_atomic_lifo_pop( opal_atomic_lifo_t* lifo ) #else item = lifo->opal_lifo_head; lifo->opal_lifo_head = (opal_list_item_t*)item->opal_list_next; -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ if( item == &(lifo->opal_lifo_ghost) ) return NULL; item->opal_list_next = NULL; return item; diff --git a/opal/class/opal_object.h b/opal/class/opal_object.h index a337c5ea5b..ddc82a92fb 100644 --- a/opal/class/opal_object.h +++ b/opal/class/opal_object.h @@ -122,9 +122,9 @@ #include #endif /* HAVE_STDLIB_H */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #include "opal/sys/atomic.h" -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ BEGIN_C_DECLS @@ -492,7 +492,7 @@ static inline opal_object_t *opal_obj_new(opal_class_t * cls) static inline int opal_obj_update(opal_object_t *object, int inc) __opal_attribute_always_inline__; static inline int opal_obj_update(opal_object_t *object, int inc) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS return opal_atomic_add_32(&(object->obj_reference_count), inc ); #else object->obj_reference_count += inc; diff --git a/opal/include/opal_config_bottom.h b/opal/include/opal_config_bottom.h index 7e5038356c..ce4e502f45 100644 --- a/opal/include/opal_config_bottom.h +++ b/opal/include/opal_config_bottom.h @@ -68,8 +68,6 @@ /* Do we have posix or solaris thread lib */ #define OPAL_HAVE_THREADS (OPAL_HAVE_POSIX_THREADS || OPAL_HAVE_SOLARIS_THREADS) -/* Do we have thread support? */ -#define OPAL_HAVE_THREAD_SUPPORT OPAL_ENABLE_MULTI_THREADS /* * BEGIN_C_DECLS should be used at the beginning of your declarations, diff --git a/opal/runtime/opal_progress.c b/opal/runtime/opal_progress.c index bc2604ef01..5a81685402 100644 --- a/opal/runtime/opal_progress.c +++ b/opal/runtime/opal_progress.c @@ -45,9 +45,9 @@ int opal_progress_spin_count = 10000; /* * Local variables */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS static opal_atomic_lock_t progress_lock; -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ /* callbacks to progress */ static opal_progress_callback_t *callbacks = NULL; @@ -71,7 +71,7 @@ static int32_t event_progress_delta = 0; static int32_t num_event_users = 0; /* How deep are we in opal_progress recursion? */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile #endif uint32_t opal_progress_recursion_depth_counter = 0; @@ -99,9 +99,9 @@ opal_progress_init(void) #endif /* reentrant issues */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_init(&progress_lock, OPAL_ATOMIC_UNLOCKED); -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ /* set the event tick rate */ opal_progress_set_event_poll_rate(10000); @@ -131,7 +131,7 @@ int opal_progress_finalize(void) { /* free memory associated with the callbacks */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_lock(&progress_lock); #endif @@ -142,7 +142,7 @@ opal_progress_finalize(void) callbacks = NULL; } -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_unlock(&progress_lock); #endif @@ -167,7 +167,7 @@ opal_progress(void) size_t i; int events = 0; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_add(&opal_progress_recursion_depth_counter, 1); #else ++opal_progress_recursion_depth_counter; @@ -221,7 +221,7 @@ opal_progress(void) #endif /* defined(__WINDOWS__) */ } #endif /* defined(__WINDOWS__) || defined(HAVE_SCHED_YIELD) */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_add(&opal_progress_recursion_depth_counter, -1); #else --opal_progress_recursion_depth_counter; @@ -336,7 +336,7 @@ opal_progress_register(opal_progress_callback_t cb) int ret = OPAL_SUCCESS; size_t index; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_lock(&progress_lock); #endif @@ -361,7 +361,7 @@ opal_progress_register(opal_progress_callback_t cb) cleanup: -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_unlock(&progress_lock); #endif @@ -374,7 +374,7 @@ opal_progress_unregister(opal_progress_callback_t cb) size_t i; int ret = OPAL_ERR_NOT_FOUND; -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_lock(&progress_lock); #endif @@ -402,7 +402,7 @@ opal_progress_unregister(opal_progress_callback_t cb) callbacks_len--; } -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_atomic_unlock(&progress_lock); #endif diff --git a/opal/runtime/opal_progress.h b/opal/runtime/opal_progress.h index a932f3f5fc..0915e64ad2 100644 --- a/opal/runtime/opal_progress.h +++ b/opal/runtime/opal_progress.h @@ -207,7 +207,7 @@ static inline bool opal_progress_spin(volatile bool* complete) * function. */ OPAL_DECLSPEC extern -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS volatile #endif uint32_t opal_progress_recursion_depth_counter; diff --git a/opal/threads/condition.h b/opal/threads/condition.h index 64aee579d2..53d7cbf3e9 100644 --- a/opal/threads/condition.h +++ b/opal/threads/condition.h @@ -67,7 +67,7 @@ static inline int opal_condition_wait(opal_condition_t *c, opal_mutex_t *m) int rc = 0; c->c_waiting++; -#if OPAL_ENABLE_DEBUG && !OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_DEBUG && !OPAL_ENABLE_MULTI_THREADS if (opal_mutex_check_locks && 0 == m->m_lock_debug) { \ opal_output(0, "Warning -- mutex not locked in condition_wait"); \ } \ @@ -75,9 +75,9 @@ static inline int opal_condition_wait(opal_condition_t *c, opal_mutex_t *m) #endif if (opal_using_threads()) { -#if OPAL_HAVE_POSIX_THREADS && OPAL_HAVE_THREAD_SUPPORT +#if OPAL_HAVE_POSIX_THREADS && OPAL_ENABLE_MULTI_THREADS rc = pthread_cond_wait(&c->c_cond, &m->m_lock_pthread); -#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_HAVE_THREAD_SUPPORT +#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_ENABLE_MULTI_THREADS rc = cond_wait(&c->c_cond, &m->m_lock_solaris); #else if (c->c_signaled) { @@ -102,7 +102,7 @@ static inline int opal_condition_wait(opal_condition_t *c, opal_mutex_t *m) } } -#if OPAL_ENABLE_DEBUG && !OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_DEBUG && !OPAL_ENABLE_MULTI_THREADS m->m_lock_debug++; #endif @@ -119,7 +119,7 @@ static inline int opal_condition_timedwait(opal_condition_t *c, struct timeval absolute; int rc = 0; -#if OPAL_ENABLE_DEBUG && !OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_DEBUG && !OPAL_ENABLE_MULTI_THREADS if (opal_mutex_check_locks && 0 == m->m_lock_debug) { \ opal_output(0, "Warning -- mutex not locked in condition_wait"); \ } \ @@ -128,9 +128,9 @@ static inline int opal_condition_timedwait(opal_condition_t *c, c->c_waiting++; if (opal_using_threads()) { -#if OPAL_HAVE_POSIX_THREADS && OPAL_HAVE_THREAD_SUPPORT +#if OPAL_HAVE_POSIX_THREADS && OPAL_ENABLE_MULTI_THREADS rc = pthread_cond_timedwait(&c->c_cond, &m->m_lock_pthread, abstime); -#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_HAVE_THREAD_SUPPORT +#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_ENABLE_MULTI_THREADS /* deal with const-ness */ timestruc_t to; to.tv_sec = abstime->tv_sec; @@ -165,7 +165,7 @@ static inline int opal_condition_timedwait(opal_condition_t *c, } } -#if OPAL_ENABLE_DEBUG && !OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_DEBUG && !OPAL_ENABLE_MULTI_THREADS m->m_lock_debug++; #endif @@ -178,11 +178,11 @@ static inline int opal_condition_signal(opal_condition_t *c) { if (c->c_waiting) { c->c_signaled++; -#if OPAL_HAVE_POSIX_THREADS && OPAL_HAVE_THREAD_SUPPORT +#if OPAL_HAVE_POSIX_THREADS && OPAL_ENABLE_MULTI_THREADS if(opal_using_threads()) { pthread_cond_signal(&c->c_cond); } -#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_HAVE_THREAD_SUPPORT +#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_ENABLE_MULTI_THREADS if(opal_using_threads()) { cond_signal(&c->c_cond); } @@ -194,7 +194,7 @@ static inline int opal_condition_signal(opal_condition_t *c) static inline int opal_condition_broadcast(opal_condition_t *c) { c->c_signaled = c->c_waiting; -#if OPAL_HAVE_POSIX_THREADS && OPAL_HAVE_THREAD_SUPPORT +#if OPAL_HAVE_POSIX_THREADS && OPAL_ENABLE_MULTI_THREADS if (opal_using_threads()) { if( 1 == c->c_waiting ) { pthread_cond_signal(&c->c_cond); @@ -202,7 +202,7 @@ static inline int opal_condition_broadcast(opal_condition_t *c) pthread_cond_broadcast(&c->c_cond); } } -#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_HAVE_THREAD_SUPPORT +#elif OPAL_HAVE_SOLARIS_THREADS && OPAL_ENABLE_MULTI_THREADS if (opal_using_threads()) { cond_broadcast(&c->c_cond); } diff --git a/opal/threads/mutex.c b/opal/threads/mutex.c index 749a35ea23..fc5a60f978 100644 --- a/opal/threads/mutex.c +++ b/opal/threads/mutex.c @@ -35,11 +35,11 @@ bool opal_mutex_check_locks = false; static void opal_mutex_construct(opal_mutex_t *m) { InterlockedExchange(&m->m_lock, 0); -#if !OPAL_HAVE_THREAD_SUPPORT && OPAL_ENABLE_DEBUG +#if !OPAL_ENABLE_MULTI_THREADS && OPAL_ENABLE_DEBUG m->m_lock_debug = 0; m->m_lock_file = NULL; m->m_lock_line = 0; -#endif /* !OPAL_HAVE_THREAD_SUPPORT && OPAL_ENABLE_DEBUG */ +#endif /* !OPAL_ENABLE_MULTI_THREADS && OPAL_ENABLE_DEBUG */ } static void opal_mutex_destruct(opal_mutex_t *m) @@ -77,7 +77,7 @@ static void opal_mutex_construct(opal_mutex_t *m) mutex_init(&m->m_lock_solaris, USYNC_THREAD, NULL); #endif -#if OPAL_ENABLE_DEBUG && !OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_DEBUG && !OPAL_ENABLE_MULTI_THREADS m->m_lock_debug = 0; m->m_lock_file = NULL; m->m_lock_line = 0; diff --git a/opal/threads/mutex.h b/opal/threads/mutex.h index 3a08811a39..da5b9e2034 100644 --- a/opal/threads/mutex.h +++ b/opal/threads/mutex.h @@ -27,9 +27,9 @@ #include "opal_config.h" -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #include "opal/sys/atomic.h" -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ #if OPAL_ENABLE_DEBUG #include "opal/util/output.h" #endif @@ -174,7 +174,7 @@ BEGIN_C_DECLS */ static inline bool opal_set_using_threads(bool have) { -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS opal_uses_threads = have; #else have = have; /* just shut up the compiler */ @@ -198,7 +198,7 @@ static inline bool opal_set_using_threads(bool have) * process, return immediately. */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #define OPAL_THREAD_LOCK(mutex) \ do { \ if (opal_using_threads()) { \ @@ -239,7 +239,7 @@ static inline bool opal_set_using_threads(bool have) * * Returns 0 if mutex was locked, non-zero otherwise. */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #define OPAL_THREAD_TRYLOCK(mutex) (opal_using_threads() ? opal_mutex_trylock(mutex) : 0) #elif OPAL_ENABLE_DEBUG static inline int @@ -283,7 +283,7 @@ opal_thread_debug_trylock(opal_mutex_t *mutex, const char *file, int line) * If there is no possibility that multiple threads are running in the * process, return immediately without modifying the mutex. */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #define OPAL_THREAD_UNLOCK(mutex) \ do { \ if (opal_using_threads()) { \ @@ -326,7 +326,7 @@ opal_thread_debug_trylock(opal_mutex_t *mutex, const char *file, int line) * process, invoke the action without acquiring the lock. */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #define OPAL_THREAD_SCOPED_LOCK(mutex, action) \ do { \ if(opal_using_threads()) { \ @@ -360,21 +360,21 @@ opal_thread_debug_trylock(opal_mutex_t *mutex, const char *file, int line) * indicates that threads are in use by the application or library. */ -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #define OPAL_THREAD_ADD32(x,y) \ (opal_using_threads() ? opal_atomic_add_32(x,y) : (*x += y)) #else #define OPAL_THREAD_ADD32(x,y) (*x += y) #endif -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #define OPAL_THREAD_ADD64(x,y) \ (opal_using_threads() ? opal_atomic_add_64(x,y) : (*x += y)) #else #define OPAL_THREAD_ADD64(x,y) (*x += y) #endif -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS #define OPAL_THREAD_ADD_SIZE_T(x,y) \ (opal_using_threads() ? opal_atomic_add_size_t(x,y) : (*x += y)) #else @@ -383,7 +383,7 @@ opal_thread_debug_trylock(opal_mutex_t *mutex, const char *file, int line) #define OPAL_CMPSET(x, y, z) ((*(x) == (y)) ? ((*(x) = (z)), 1) : 0) -#if OPAL_HAVE_THREAD_SUPPORT +#if OPAL_ENABLE_MULTI_THREADS # if OPAL_HAVE_ATOMIC_CMPSET_32 # define OPAL_ATOMIC_CMPSET_32(x, y, z) \ (opal_using_threads() ? opal_atomic_cmpset_32(x, y, z) : OPAL_CMPSET(x, y, z)) diff --git a/opal/threads/mutex_unix.h b/opal/threads/mutex_unix.h index 8f1dc041c7..27528e6b4b 100644 --- a/opal/threads/mutex_unix.h +++ b/opal/threads/mutex_unix.h @@ -59,7 +59,7 @@ struct opal_mutex_t { mutex_t m_lock_solaris; #endif -#if !OPAL_HAVE_THREAD_SUPPORT && OPAL_ENABLE_DEBUG +#if !OPAL_ENABLE_MULTI_THREADS && OPAL_ENABLE_DEBUG int m_lock_debug; const char *m_lock_file; int m_lock_line; diff --git a/orte/mca/notifier/command/notifier_command_child.c b/orte/mca/notifier/command/notifier_command_child.c index e9deb6d465..988966bcb1 100644 --- a/orte/mca/notifier/command/notifier_command_child.c +++ b/orte/mca/notifier/command/notifier_command_child.c @@ -14,12 +14,12 @@ * #if conditionals). We also don't protect including . * That's because this component currently only compiles on Linux and * Solaris, and both of these OS's have pthreads. Using the run-time - * conditionals gives us bettern compile-time checking, even of code + * conditionals gives us better compile-time checking, even of code * that isn't activated. * * Note, too, that the functionality in this file does *not* require * all the heavyweight OMPI thread infrastructure (e.g., from - * --enable-mpi-threads or --enable-progress-threads). All work that + * --enable-mpi-thread-multiple or --enable-progress-threads). All work that * is done in a separate progress thread is very carefully segregated * from that of the main thread, and communication back to the main * thread diff --git a/orte/mca/notifier/command/notifier_command_fd.c b/orte/mca/notifier/command/notifier_command_fd.c index 60dcb988fe..eb6c365f2e 100644 --- a/orte/mca/notifier/command/notifier_command_fd.c +++ b/orte/mca/notifier/command/notifier_command_fd.c @@ -14,12 +14,12 @@ * #if conditionals). We also don't protect including . * That's because this component currently only compiles on Linux and * Solaris, and both of these OS's have pthreads. Using the run-time - * conditionals gives us bettern compile-time checking, even of code + * conditionals gives us better compile-time checking, even of code * that isn't activated. * * Note, too, that the functionality in this file does *not* require * all the heavyweight OMPI thread infrastructure (e.g., from - * --enable-mpi-threads or --enable-progress-threads). All work that + * --enable-mpi-thread-multiple or --enable-progress-threads). All work that * is done in a separate progress thread is very carefully segregated * from that of the main thread, and communication back to the main * thread diff --git a/orte/runtime/orte_wait.c b/orte/runtime/orte_wait.c index 4f79ee3a54..cb4f67667e 100644 --- a/orte/runtime/orte_wait.c +++ b/orte/runtime/orte_wait.c @@ -403,7 +403,7 @@ orte_waitpid(pid_t wpid, int *status, int options) from under it. Yes, it's spinning. No, we won't spin for long. */ - if (!OPAL_HAVE_THREAD_SUPPORT) { + if (!OPAL_ENABLE_MULTI_THREADS) { opal_event_loop(opal_event_base, OPAL_EVLOOP_NONBLOCK); } } diff --git a/orte/tools/orte-info/param.c b/orte/tools/orte-info/param.c index 9ea6d1a452..50f7c7e47b 100644 --- a/orte/tools/orte-info/param.c +++ b/orte/tools/orte-info/param.c @@ -514,9 +514,9 @@ void orte_info_do_config(bool want_all) symbol_visibility = OPAL_C_HAVE_VISIBILITY ? "yes" : "no"; /* setup strings that require allocation */ - if (OPAL_HAVE_SOLARIS_THREADS || OPAL_HAVE_POSIX_THREADS) { - asprintf(&threads, "%s (mpi: %s, progress: %s)", OPAL_HAVE_SOLARIS_THREADS ? "solaris" : - (OPAL_HAVE_POSIX_THREADS ? "posix" : "type unknown"), + if (OPAL_HAVE_SOLARIS_THREADS || OPAL_HAVE_POSIX_THREADS) { /* should just test OPAL_HAVE_THREADS */ + asprintf(&threads, "%s (OPAL: %s, progress: %s)", OPAL_HAVE_SOLARIS_THREADS ? "solaris" : + (OPAL_HAVE_POSIX_THREADS ? "posix" : "type unknown"), /* "type unknown" can presumably never happen */ OPAL_ENABLE_MULTI_THREADS ? "yes" : "no", ORTE_ENABLE_PROGRESS_THREADS ? "yes" : "no"); } else { diff --git a/test/threads/opal_condition.c b/test/threads/opal_condition.c index e18999eec5..384894b5b0 100644 --- a/test/threads/opal_condition.c +++ b/test/threads/opal_condition.c @@ -30,7 +30,7 @@ #include "opal/sys/atomic.h" -#if !OPAL_HAVE_THREAD_SUPPORT +#if !OPAL_ENABLE_MULTI_THREADS /* If we don't have thread support, there's no point in running this test */ @@ -135,4 +135,4 @@ int main(int argc, char** argv) return test_finalize(); } -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */ diff --git a/test/threads/opal_thread.c b/test/threads/opal_thread.c index 8afc446108..42e27cb70c 100644 --- a/test/threads/opal_thread.c +++ b/test/threads/opal_thread.c @@ -13,7 +13,7 @@ #include "opal/sys/atomic.h" -#if !OPAL_HAVE_THREAD_SUPPORT +#if !OPAL_ENABLE_MULTI_THREADS /* If we don't have thread support, there's no point in running this test */ @@ -73,4 +73,4 @@ int main(int argc, char** argv) return test_finalize(); } -#endif /* OPAL_HAVE_THREAD_SUPPORT */ +#endif /* OPAL_ENABLE_MULTI_THREADS */