Loading scripts/compile_dep.sh +0 −5 Original line number Diff line number Diff line Loading @@ -450,11 +450,6 @@ if check_dependency "mercury" "${DEP_CONFIG[@]}"; then echo "############################################################ Installing: Mercury" CURR=${SOURCE}/mercury prepare_build_dir "${CURR}" cd "${CURR}" if [[ $(cat "${CURR}"/version.txt) == "2.0.1rc3" ]]; then echo "############ applying mercury atomic patch" git apply "${PATCH_DIR}"/mercury_c11_atomic.patch fi cd "${CURR}"/build PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig $CMAKE \ -DCMAKE_BUILD_TYPE:STRING=Release \ Loading scripts/dl_dep.sh +2 −2 Original line number Diff line number Diff line Loading @@ -406,7 +406,7 @@ fi # get Mercury if check_dependency "mercury-experimental" "${DEP_CONFIG[@]}"; then # currently not compatible with Hermes clonedeps "mercury" "https://github.com/mercury-hpc/mercury" "71672b0d453dc5a64d20f46b86f25fed12566eff" "--recurse-submodules" & clonedeps "mercury" "https://github.com/mercury-hpc/mercury" "75cb615894699a4df5872ba9d187f37cc94330a3" "--recurse-submodules" & elif check_dependency "mercury" "${DEP_CONFIG[@]}"; then clonedeps "mercury" "https://github.com/mercury-hpc/mercury" "4796aeeb90ba58be8a3b17a73f27aa3afed1ee0f" "--recurse-submodules" & fi Loading @@ -418,7 +418,7 @@ fi # get Margo if check_dependency "margo" "${DEP_CONFIG[@]}"; then clonedeps "margo" "https://github.com/mochi-hpc/mochi-margo" "84c7a123fcabaac1545cc0352a74ea27ed1d6a83" & clonedeps "margo" "https://github.com/mochi-hpc/mochi-margo" "34bff25aa8ec9e9348ee07a455308bfe3c17d623" & fi # get rocksdb Loading scripts/patches/mercury_c11_atomic.patchdeleted 100644 → 0 +0 −59 Original line number Diff line number Diff line diff --git a/src/util/mercury_atomic.h b/src/util/mercury_atomic.h index 63aa54e..92a0125 100644 --- a/src/util/mercury_atomic.h +++ b/src/util/mercury_atomic.h @@ -31,14 +31,31 @@ typedef OPA_int_t hg_atomic_int32_t; typedef OPA_ptr_t hg_atomic_int64_t; /* OPA has only limited 64-bit support */ # define HG_ATOMIC_VAR_INIT(x) OPA_PTR_T_INITIALIZER(x) #elif defined(HG_UTIL_HAS_STDATOMIC_H) -# include <stdatomic.h> + +# ifndef __cplusplus +# include <stdatomic.h> typedef atomic_int hg_atomic_int32_t; -# if (HG_UTIL_ATOMIC_LONG_WIDTH == 8) && !defined(__APPLE__) +# if (HG_UTIL_ATOMIC_LONG_WIDTH == 8) && !defined(__APPLE__) typedef atomic_long hg_atomic_int64_t; -# else +# else typedef atomic_llong hg_atomic_int64_t; -# endif -# define HG_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x) +# endif +# else +# include <atomic> +# define _Atomic(X) std::atomic< X > +typedef std::atomic<int> hg_atomic_int32_t; +# if (HG_UTIL_ATOMIC_LONG_WIDTH == 8) && !defined(__APPLE__) +typedef std::atomic<long> hg_atomic_int64_t; +# else +typedef std::atomic<long long> hg_atomic_int64_t; +# endif +# define memory_order_release std::memory_order_release +# define memory_order_acquire std::memory_order_acquire +# define memory_order_acq_rel std::memory_order_acq_rel +# define atomic_thread_fence std::atomic_thread_fence +# define atomic_fetch_add_explicit std::atomic_fetch_add_explicit +# endif +#define HG_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x) #elif defined(__APPLE__) # include <libkern/OSAtomic.h> typedef struct { @@ -495,7 +512,7 @@ hg_atomic_incr64(hg_atomic_int64_t *ptr) #if defined(_WIN32) ret = InterlockedIncrementNoFence64(&ptr->value); #elif defined(HG_UTIL_HAS_STDATOMIC_H) && !defined(HG_UTIL_HAS_OPA_PRIMITIVES_H) - ret = atomic_fetch_add_explicit(ptr, 1, memory_order_acq_rel) + 1; + ret = atomic_fetch_add_explicit(ptr, 1l, memory_order_acq_rel) + 1; #elif defined(__APPLE__) ret = OSAtomicIncrement64(&ptr->value); #else @@ -517,7 +534,7 @@ hg_atomic_decr64(hg_atomic_int64_t *ptr) #if defined(_WIN32) ret = InterlockedDecrementNoFence64(&ptr->value); #elif defined(HG_UTIL_HAS_STDATOMIC_H) && !defined(HG_UTIL_HAS_OPA_PRIMITIVES_H) - ret = atomic_fetch_sub_explicit(ptr, 1, memory_order_acq_rel) - 1; + ret = atomic_fetch_sub_explicit(ptr, 1l, memory_order_acq_rel) - 1; #elif defined(__APPLE__) ret = OSAtomicDecrement64(&ptr->value); #else Loading
scripts/compile_dep.sh +0 −5 Original line number Diff line number Diff line Loading @@ -450,11 +450,6 @@ if check_dependency "mercury" "${DEP_CONFIG[@]}"; then echo "############################################################ Installing: Mercury" CURR=${SOURCE}/mercury prepare_build_dir "${CURR}" cd "${CURR}" if [[ $(cat "${CURR}"/version.txt) == "2.0.1rc3" ]]; then echo "############ applying mercury atomic patch" git apply "${PATCH_DIR}"/mercury_c11_atomic.patch fi cd "${CURR}"/build PKG_CONFIG_PATH=${INSTALL}/lib/pkgconfig $CMAKE \ -DCMAKE_BUILD_TYPE:STRING=Release \ Loading
scripts/dl_dep.sh +2 −2 Original line number Diff line number Diff line Loading @@ -406,7 +406,7 @@ fi # get Mercury if check_dependency "mercury-experimental" "${DEP_CONFIG[@]}"; then # currently not compatible with Hermes clonedeps "mercury" "https://github.com/mercury-hpc/mercury" "71672b0d453dc5a64d20f46b86f25fed12566eff" "--recurse-submodules" & clonedeps "mercury" "https://github.com/mercury-hpc/mercury" "75cb615894699a4df5872ba9d187f37cc94330a3" "--recurse-submodules" & elif check_dependency "mercury" "${DEP_CONFIG[@]}"; then clonedeps "mercury" "https://github.com/mercury-hpc/mercury" "4796aeeb90ba58be8a3b17a73f27aa3afed1ee0f" "--recurse-submodules" & fi Loading @@ -418,7 +418,7 @@ fi # get Margo if check_dependency "margo" "${DEP_CONFIG[@]}"; then clonedeps "margo" "https://github.com/mochi-hpc/mochi-margo" "84c7a123fcabaac1545cc0352a74ea27ed1d6a83" & clonedeps "margo" "https://github.com/mochi-hpc/mochi-margo" "34bff25aa8ec9e9348ee07a455308bfe3c17d623" & fi # get rocksdb Loading
scripts/patches/mercury_c11_atomic.patchdeleted 100644 → 0 +0 −59 Original line number Diff line number Diff line diff --git a/src/util/mercury_atomic.h b/src/util/mercury_atomic.h index 63aa54e..92a0125 100644 --- a/src/util/mercury_atomic.h +++ b/src/util/mercury_atomic.h @@ -31,14 +31,31 @@ typedef OPA_int_t hg_atomic_int32_t; typedef OPA_ptr_t hg_atomic_int64_t; /* OPA has only limited 64-bit support */ # define HG_ATOMIC_VAR_INIT(x) OPA_PTR_T_INITIALIZER(x) #elif defined(HG_UTIL_HAS_STDATOMIC_H) -# include <stdatomic.h> + +# ifndef __cplusplus +# include <stdatomic.h> typedef atomic_int hg_atomic_int32_t; -# if (HG_UTIL_ATOMIC_LONG_WIDTH == 8) && !defined(__APPLE__) +# if (HG_UTIL_ATOMIC_LONG_WIDTH == 8) && !defined(__APPLE__) typedef atomic_long hg_atomic_int64_t; -# else +# else typedef atomic_llong hg_atomic_int64_t; -# endif -# define HG_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x) +# endif +# else +# include <atomic> +# define _Atomic(X) std::atomic< X > +typedef std::atomic<int> hg_atomic_int32_t; +# if (HG_UTIL_ATOMIC_LONG_WIDTH == 8) && !defined(__APPLE__) +typedef std::atomic<long> hg_atomic_int64_t; +# else +typedef std::atomic<long long> hg_atomic_int64_t; +# endif +# define memory_order_release std::memory_order_release +# define memory_order_acquire std::memory_order_acquire +# define memory_order_acq_rel std::memory_order_acq_rel +# define atomic_thread_fence std::atomic_thread_fence +# define atomic_fetch_add_explicit std::atomic_fetch_add_explicit +# endif +#define HG_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x) #elif defined(__APPLE__) # include <libkern/OSAtomic.h> typedef struct { @@ -495,7 +512,7 @@ hg_atomic_incr64(hg_atomic_int64_t *ptr) #if defined(_WIN32) ret = InterlockedIncrementNoFence64(&ptr->value); #elif defined(HG_UTIL_HAS_STDATOMIC_H) && !defined(HG_UTIL_HAS_OPA_PRIMITIVES_H) - ret = atomic_fetch_add_explicit(ptr, 1, memory_order_acq_rel) + 1; + ret = atomic_fetch_add_explicit(ptr, 1l, memory_order_acq_rel) + 1; #elif defined(__APPLE__) ret = OSAtomicIncrement64(&ptr->value); #else @@ -517,7 +534,7 @@ hg_atomic_decr64(hg_atomic_int64_t *ptr) #if defined(_WIN32) ret = InterlockedDecrementNoFence64(&ptr->value); #elif defined(HG_UTIL_HAS_STDATOMIC_H) && !defined(HG_UTIL_HAS_OPA_PRIMITIVES_H) - ret = atomic_fetch_sub_explicit(ptr, 1, memory_order_acq_rel) - 1; + ret = atomic_fetch_sub_explicit(ptr, 1l, memory_order_acq_rel) - 1; #elif defined(__APPLE__) ret = OSAtomicDecrement64(&ptr->value); #else