Skip to content

Commit dae7987

Browse files
authored
AMReX/pyAMReX/PICSAR: Weekly Update (#4396)
* AMReX: Weekly Update * New Tool: `Release/updatepyAMReX.py` * pyAMReX: Weekly Update
1 parent 8e4b7e8 commit dae7987

File tree

8 files changed

+132
-6
lines changed

8 files changed

+132
-6
lines changed

.github/workflows/cuda.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
which nvcc || echo "nvcc not in PATH!"
112112
113113
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
114-
cd ../amrex && git checkout --detach da79aff8053058371a78d4bf85488384242368ee && cd -
114+
cd ../amrex && git checkout --detach be6c6415467d09da6109d27cfa218868abc1f9db && cd -
115115
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_PSATD=TRUE USE_CCACHE=TRUE -j 2
116116
117117
build_nvhpc21-11-nvcc:

Docs/source/maintenance/release.rst

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The following scripts automate this workflow, in case one needs a newer commit o
1313
.. code-block:: sh
1414
1515
./Tools/Release/updateAMReX.py
16+
./Tools/Release/updatepyAMReX.py
1617
./Tools/Release/updatePICSAR.py
1718
1819
@@ -32,6 +33,7 @@ In order to create a GitHub release, you need to:
3233
.. code-block:: sh
3334
3435
./Tools/Release/updateAMReX.py
36+
./Tools/Release/updatepyAMReX.py
3537
./Tools/Release/updatePICSAR.py
3638
3739
./Tools/Release/newVersion.sh

Regression/WarpX-GPU-tests.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ emailBody = Check https://ccse.lbl.gov/pub/GpuRegressionTesting/WarpX/ for more
6060

6161
[AMReX]
6262
dir = /home/regtester/git/amrex/
63-
branch = da79aff8053058371a78d4bf85488384242368ee
63+
branch = be6c6415467d09da6109d27cfa218868abc1f9db
6464

6565
[source]
6666
dir = /home/regtester/git/WarpX

Regression/WarpX-tests.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ emailBody = Check https://ccse.lbl.gov/pub/RegressionTesting/WarpX/ for more det
5959

6060
[AMReX]
6161
dir = /home/regtester/AMReX_RegTesting/amrex/
62-
branch = da79aff8053058371a78d4bf85488384242368ee
62+
branch = be6c6415467d09da6109d27cfa218868abc1f9db
6363

6464
[source]
6565
dir = /home/regtester/AMReX_RegTesting/warpx

Tools/Release/updatepyAMReX.py

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Copyright 2021 Axel Huebl
4+
#
5+
# This file is part of WarpX.
6+
#
7+
8+
# This file is a maintainer tool to bump the pyAMReX version that we pull in
9+
# when building WarpX.
10+
#
11+
import datetime
12+
from pathlib import Path
13+
import re
14+
import sys
15+
16+
import requests
17+
18+
# Maintainer Inputs ###########################################################
19+
20+
print("""Hi there, this is a WarpX maintainer tool to update the source
21+
code of WarpX to a new commit/release of pyAMReX.
22+
For it to work, you need write access on the source directory and
23+
you should be working in a clean git branch without ongoing
24+
rebase/merge/conflict resolves and without unstaged changes.""")
25+
26+
# check source dir
27+
REPO_DIR = Path(__file__).parent.parent.parent.absolute()
28+
print(f"\nYour current source directory is: {REPO_DIR}")
29+
30+
REPLY = input("Are you sure you want to continue? [y/N] ")
31+
print()
32+
if not REPLY in ["Y", "y"]:
33+
print("You did not confirm with 'y', aborting.")
34+
sys.exit(1)
35+
36+
37+
# Current Versions ############################################################
38+
39+
# pyAMReX development HEAD
40+
pyamrex_gh = requests.get('https://api.github.com/repos/AMReX-Codes/pyamrex/commits/development')
41+
pyamrex_HEAD = pyamrex_gh.json()["sha"]
42+
43+
# WarpX references to pyAMReX: cmake/dependencies/pyAMReX.cmake
44+
pyamrex_cmake_path = str(REPO_DIR.joinpath("cmake/dependencies/pyAMReX.cmake"))
45+
# branch/commit/tag (git fetcher) version
46+
# set(WarpX_pyamrex_branch "development" ...
47+
pyamrex_branch = f"unknown (format issue in {pyamrex_cmake_path})"
48+
with open(pyamrex_cmake_path, encoding='utf-8') as f:
49+
r_minimal = re.findall(r'.*set\(WarpX_pyamrex_branch\s+"(.+)"\s+.*',
50+
f.read(), re.MULTILINE)
51+
if len(r_minimal) >= 1:
52+
pyamrex_branch = r_minimal[0]
53+
54+
# minimal (external) version
55+
# find_package(AMReX YY.MM CONFIG ...
56+
pyamrex_minimal = f"unknown (format issue in {pyamrex_cmake_path})"
57+
with open(pyamrex_cmake_path, encoding='utf-8') as f:
58+
r_minimal = re.findall(r'.*find_package\(AMReX\s+(.+)\s+CONFIG\s+.*',
59+
f.read(), re.MULTILINE)
60+
if len(r_minimal) >= 1:
61+
pyamrex_minimal = r_minimal[0]
62+
63+
64+
# Ask for new #################################################################
65+
66+
print("""We will now run a few sed commands on your source directory.
67+
Please answer the following questions about the version number
68+
you want to require from pyAMReX:\n""")
69+
70+
print(f"Currently, WarpX builds against this pyAMReX commit/branch/sha: {pyamrex_branch}")
71+
print(f"pyAMReX HEAD commit (development branch): {pyamrex_HEAD}")
72+
pyamrex_new_branch = input(f"Update pyAMReX commit/branch/sha: ").strip()
73+
if not pyamrex_new_branch:
74+
pyamrex_new_branch = pyamrex_branch
75+
print(f"--> Nothing entered, will keep: {pyamrex_branch}")
76+
print()
77+
78+
print(f"Currently, a pre-installed pyAMReX is required at least at version: {pyamrex_minimal}")
79+
today = datetime.date.today().strftime("%y.%m")
80+
pyamrex_new_minimal = input(f"New minimal pyAMReX version (e.g. {today})? ").strip()
81+
if not pyamrex_new_minimal:
82+
pyamrex_new_minimal = pyamrex_minimal
83+
print(f"--> Nothing entered, will keep: {pyamrex_minimal}")
84+
85+
print()
86+
print(f"New pyAMReX commit/branch/sha: {pyamrex_new_branch}")
87+
print(f"New minimal pyAMReX version: {pyamrex_new_minimal}\n")
88+
89+
REPLY = input("Is this information correct? Will now start updating! [y/N] ")
90+
print()
91+
if not REPLY in ["Y", "y"]:
92+
print("You did not confirm with 'y', aborting.")
93+
sys.exit(1)
94+
95+
96+
# Updates #####################################################################
97+
98+
# WarpX references to pyAMReX: cmake/dependencies/pyAMReX.cmake
99+
with open(pyamrex_cmake_path, encoding='utf-8') as f:
100+
pyAMReX_cmake_content = f.read()
101+
102+
# branch/commit/tag (git fetcher) version
103+
# set(WarpX_pyamrex_branch "development" ...
104+
pyAMReX_cmake_content = re.sub(
105+
r'(.*set\(WarpX_pyamrex_branch\s+")(.+)("\s+.*)',
106+
r'\g<1>{}\g<3>'.format(pyamrex_new_branch),
107+
pyAMReX_cmake_content, flags = re.MULTILINE)
108+
109+
# minimal (external) version
110+
# find_package(AMReX YY.MM CONFIG ...
111+
pyAMReX_cmake_content = re.sub(
112+
r'(.*find_package\(pyAMReX\s+)(.+)(\s+CONFIG\s+.*)',
113+
r'\g<1>{}\g<3>'.format(pyamrex_new_minimal),
114+
pyAMReX_cmake_content, flags = re.MULTILINE)
115+
116+
with open(pyamrex_cmake_path, "w", encoding='utf-8') as f:
117+
f.write(pyAMReX_cmake_content)
118+
119+
120+
# Epilogue ####################################################################
121+
122+
print("""Done. Please check your source, e.g. via
123+
git diff
124+
now and commit the changes if no errors occurred.""")

cmake/dependencies/AMReX.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ set(WarpX_amrex_src ""
269269
set(WarpX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
270270
CACHE STRING
271271
"Repository URI to pull and build AMReX from if(WarpX_amrex_internal)")
272-
set(WarpX_amrex_branch "da79aff8053058371a78d4bf85488384242368ee"
272+
set(WarpX_amrex_branch "be6c6415467d09da6109d27cfa218868abc1f9db"
273273
CACHE STRING
274274
"Repository branch for WarpX_amrex_repo if(WarpX_amrex_internal)")
275275

cmake/dependencies/pyAMReX.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ option(WarpX_pyamrex_internal "Download & build pyAMReX" ON)
7979
set(WarpX_pyamrex_repo "https://github.com/AMReX-Codes/pyamrex.git"
8080
CACHE STRING
8181
"Repository URI to pull and build pyamrex from if(WarpX_pyamrex_internal)")
82-
set(WarpX_pyamrex_branch "23.10"
82+
set(WarpX_pyamrex_branch "056d332d68fa98b9e9509d05ec3b1a3d8ef37673"
8383
CACHE STRING
8484
"Repository branch for WarpX_pyamrex_repo if(WarpX_pyamrex_internal)")
8585

run_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ python3 -m pip install --upgrade -r warpx/Regression/requirements.txt
7171

7272
# Clone AMReX and warpx-data
7373
git clone https://github.com/AMReX-Codes/amrex.git
74-
cd amrex && git checkout --detach da79aff8053058371a78d4bf85488384242368ee && cd -
74+
cd amrex && git checkout --detach be6c6415467d09da6109d27cfa218868abc1f9db && cd -
7575
# warpx-data contains various required data sets
7676
git clone --depth 1 https://github.com/ECP-WarpX/warpx-data.git
7777
# openPMD-example-datasets contains various required data sets

0 commit comments

Comments
 (0)