From b87196351db555bbccfa82f42418ba4e721a204e Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Sun, 9 Jun 2024 16:39:00 +0200 Subject: [PATCH] Release 24.06 Latest release. OpenMP Windows patch is now mainline. --- recipe/3910.patch | 91 ----------------------------------------------- recipe/meta.yaml | 10 ++---- 2 files changed, 3 insertions(+), 98 deletions(-) delete mode 100644 recipe/3910.patch diff --git a/recipe/3910.patch b/recipe/3910.patch deleted file mode 100644 index ba1e52b..0000000 --- a/recipe/3910.patch +++ /dev/null @@ -1,91 +0,0 @@ -From b236af724031134d626e64e3f28a94525981eb80 Mon Sep 17 00:00:00 2001 -From: Weiqun Zhang -Date: Sun, 28 Apr 2024 22:14:34 -0700 -Subject: [PATCH] Workaround for Windows omp_lock_t issue - ---- - Src/Base/AMReX_OpenMP.H | 8 ++++++++ - Src/Base/AMReX_OpenMP.cpp | 24 ++++++++++++++++++++++++ - 2 files changed, 32 insertions(+) - -diff --git a/Src/Base/AMReX_OpenMP.H b/Src/Base/AMReX_OpenMP.H -index 15d6854c92..67e180003d 100644 ---- a/Src/Base/AMReX_OpenMP.H -+++ b/Src/Base/AMReX_OpenMP.H -@@ -17,7 +17,15 @@ namespace amrex::OpenMP { - void Initialize (); - void Finalize (); - -+#if defined(_WIN32) -+ void** get_lock_impl (int ilock); -+ -+ inline omp_lock_t* get_lock (int ilock) { -+ return (omp_lock_t*)(*(get_lock_impl(ilock))); -+ } -+#else - omp_lock_t* get_lock (int ilock); -+#endif - } - - #else // AMREX_USE_OMP -diff --git a/Src/Base/AMReX_OpenMP.cpp b/Src/Base/AMReX_OpenMP.cpp -index fafb00c11c..53782c8c34 100644 ---- a/Src/Base/AMReX_OpenMP.cpp -+++ b/Src/Base/AMReX_OpenMP.cpp -@@ -137,7 +137,11 @@ namespace amrex::OpenMP - { - namespace { - constexpr int nlocks = 128; -+#if defined(_WIN32) -+ void* omp_locks[nlocks]; -+#else - omp_lock_t omp_locks[nlocks]; -+#endif - unsigned int initialized = 0; - } - -@@ -183,9 +187,17 @@ namespace amrex::OpenMP - } - } - -+#if defined(_WIN32) -+ for (auto& vp : omp_locks) { -+ auto* p = new omp_lock_t; -+ omp_init_lock(p); -+ vp = (void*) p; -+ } -+#else - for (auto& lck : omp_locks) { - omp_init_lock(&lck); - } -+#endif - - ++initialized; - } -@@ -195,14 +207,26 @@ namespace amrex::OpenMP - if (initialized) { - --initialized; - if (initialized == 0) { -+#if defined(_WIN32) -+ for (auto vp : omp_locks) { -+ auto* p = (omp_lock_t*)vp; -+ omp_destroy_lock(p); -+ delete p; -+ } -+#else - for (auto& lck : omp_locks) { - omp_destroy_lock(&lck); - } -+#endif - } - } - } - -+#if defined(_WIN32) -+ void** get_lock_impl(int ilock) -+#else - omp_lock_t* get_lock (int ilock) -+#endif - { - ilock = ilock % nlocks; - if (ilock < 0) { ilock += nlocks; } diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c175391..9b4f077 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,6 +1,6 @@ {% set name = "amrex" %} -{% set version = "24.05" %} -{% set build = 1 %} +{% set version = "24.06" %} +{% set build = 0 %} # ensure mpi is defined (needed for conda-smithy recipe-lint) {% set mpi = mpi or 'nompi' %} @@ -16,11 +16,7 @@ package: source: url: https://github.com/AMReX-Codes/amrex/archive/refs/tags/{{ version }}.tar.gz - sha256: 97b3d192480a3a1b3a0facd903ada05d5c4cfb915f3e7365ec104fbca54cfb68 - patches: - # OpenMP public symbols on Windows - # https://github.com/AMReX-Codes/amrex/pull/3910 - - 3910.patch + sha256: 5e9c67b1927ce5b2b7b1cc6bbdb38db4a6b183500e4c6eec690b135c88c90068 build: number: {{ build }}