Skip to content

Commit 6c93d9f

Browse files
ax3lroelof-groenewalddpgroteRemiLehepre-commit-ci[bot]
authored
Transition to pyAMReX (#3474)
* pyAMReX: Build System * CI Updates (Changed Options) * Callback modernization (#4) * refactor callbacks.py * added binding code in `pyWarpX.cpp` to add or remove keys from the callback dictionary * minor PR cleanups Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Added Python level reference to fetch the multifabs (#3) * pyAMReX: Build System * Added Python level reference to Ex_aux * Now uses the multifab map * Fix typo Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Add initialization and finalize routines (#5) A basic PICMI input file will now run to completion. * Regression Tests: WarpX_PYTHON=ON * Update Imports to nD pyAMReX * IPO/LTO Control Although pybind11 relies heavily on IPO/LTO to create low-latency, small-binary bindings, some compilers will have troubles with that. Thus, we add a compile-time option to optionally disable it when needed. * Fix: Link Legacy WarpXWrappers.cpp * Wrap WarpX instance and start multi particle container * Fix test Python_pass_mpi_comm * Start wrapper for multiparticle container * Add return policy Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Update fields to use MultiFabs directly Remove EOL white space Removed old routines accessing MultiFabs Update to use "node_centered" * Fix compilation with Python * Update fields.py to use modified MultiFab tag names * Remove incorrect, unused code * Add function to extract the WarpX MultiParticleContainer * Complete class WarpXParticleContainer * Wrap functions getNprocs / getMyProc * restore `install___` callback API - could remove later if we want but should maintain backward compatibility for now * add `gett_new` and `getistep` functions wrappers; fix typos in `callbacks.py`; avoid error in getting `rho` from `fields.py` * Update callback call and `getNproc`/`getMyProc` function * Replace function add_n_particles * Fix setitem in fields.py for 1d and 2d * also update `gett_new()` in `_libwarpx.py` in case we want to keep that API * added binding for `WarpXParIter` - needed to port `libwarpx.depositChargeDensity()` which is an ongoing effort * Wrap function num_real_comp * added binding for `TotalNumberOfParticles` and continue progress on enabling 1d MCC test to run * add `SyncRho()` binding and create helper function in `libwarpx.depositChargeDensity` to manage scope of the particle iter * Clean up issues in fields.py * update bindings for `get_particle_structs` * Fix setitem in fields.py * switch order of initialization for particle container and particle iterator * switch deposit_charge loop to C++ code; bind `ApplyInverseVolumeScalingToChargeDensity` * move `WarpXParticleContainer.cpp` and `MultiParticleContainer.cpp` to new Particles folder * added binding for `ParticleBoundaryBuffer` * More fixes for fields.py * Fix: Backtraces from Python Add the Python executable name with an absolute path, so backtraces in AMReX work. See linked AMReX issue for details. * Cleaning * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix: Backtraces from Python Part II Do not add Python script name - it confuses the AMReX ParmParser to build its table. * Fix: CMake Dependencies for Wheel This fixes a racecondition during `pip_install`: it was possible that not all dimensions where yet build from pybind before we start packing them in the wheel for pip install. * MCC Test: Install Callbacks before Run Otherwise hangs in aquiring the gil during shutdown. * addition of `Python/pywarpx/particle_containers.py` and various associated bindings * Fix: CMake Superbuild w/ Shared AMReX We MUST build AMReX as a shared (so/dll/dylib) library, otherwise all the global state in it will cause split-brain situations, where our Python modules operate on different stacks. * add `clear_all()` to callbacks in order to remove all callbacks at finalize * add `-DWarpX_PYTHON=ON` to CI tests that failed to build * add `get_comp_index` and continue to port particle data bindings * Add AMReX Module as `libwarpx_so.amr` Attribute to pass through the already loaded AMReX module with the matching dimensionality to the simulation. * Fix for fields accounting for guard cells * Fix handling of ghost cells in fields * Update & Test: Particle Boundary Scraping * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * CI: Python Updates - modernize Python setups - drop CUDA 11.0 for good and go 11.3+ as documented already ``` Error #3246: Internal Compiler Error (codegen): "there was an error in verifying the lgenfe output!" ``` * CI: Python Updates (chmod) * Add support for cupy in fields.py * Add MultiFab reduction routines * CI: CUDA 11.3 is <= Ubuntu 20.04 * changed `AddNParticles` to take `amrex::Vector` arguments * setup.py: WarpX_PYTHON=ON * update various 2d and rz tests with new APIs * add `-DWarpX_PYTHON_IPO=OFF` to compile string for 2d and 3d Python CI tests to speed up linking * CI: -DpyAMReX_IPO=OFF * CI: -DpyAMReX_IPO=OFF actually adding `=OFF` * CI: Intel Python * CI: macOS Python Executable Ensure we always use the same `python3` executable, as specified by the `PATH` priority. * CMake: Python Multi-Config Build Add support for multi-config generators, especially on Windows. * __init__.py: Windows DLL Support Python 3.8+ on Windows: DLL search paths for dependent shared libraries Refs.: - python/cpython#80266 - https://docs.python.org/3.8/library/os.html#os.add_dll_directory * CI: pywarpx Update our setup.py cannot install pyamrex yet as a dependency. * ABLASTR: `ablastr/export.H` Add a new header to export public globals that are not covered by `WINDOWS_EXPORT_ALL_SYMBOLS`. https://stackoverflow.com/questions/54560832/cmake-windows-export-all-symbols-does-not-cover-global-variables/54568678#54568678 * WarpX: EXPORT Globals in `.dll` files WarpX still uses a lot of globals: - `static` member variables - `extern` global variables These globals cannot be auto-exported with CMake's `WINDOWS_EXPORT_ALL_SYMBOLS` helper and thus we need to mark them manually for DLL export (and import) via the new ABLASTR `ablastr/export.H` helper macros. This starts to export symbols in the: - WarpX and particle container classes - callback hook database map - ES solver * CI: pywarpx Clang CXXFLAGS Down Move CXXFLAGS (`-Werror ...`) down until deps are installed. * GNUmake: Generate `ablastr/export.H` * CMake: More Symbol Exports for Windows * `WarpX-tests.ini`: Simplify Python no-IPO Also avoids subtle differences in compilation that increase compile time. * Update PICMI_inputs_EB_API.py for embedded_boundary_python_API CI test * Fix Python_magnetostatic_eb_3d * Update: Python_restart_runtime_components New Python APIs * Windows: no dllimport for now * CI: Skip `PYINSTALLOPTIONS` For Now * CMake: Dependency Bump Min-Versions for external packages picked up by `find_package`. * Fix F and G_fp names in fields.py * Tests: Disable `Python_pass_mpi_comm` * Wrappers: Cleanup * pyWarpX: Include Cleaning * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fields.py: Fix F and G Wrappers Correct MultiFab names (w/o components). * Remove unused in fields.py * Windows: New Export Headers - ABLASTR: `ablastr/export.H` - WarpX: `Utils/export.H` * removed `WarpInterface.py` since that functionality is now in `particle_containers.py`; removed parts of `WarpXWrappers.cpp` that have been ported to pyamrex * CMake: Link OBJECT Target PRIVATE * CMake: Remove OBJECT Target Simplify and make `app` link `lib` (default: static). Remove OBJECT target. * Fix in fields.py for the components index * Update get_particle_id/cpu As implemented in pyAMReX with AMReX-Codes/pyamrex#165 * WarpX: Update for Private Constructor * Import AMReX Before pyd DLL Call Importing AMReX will add the `add_dll_directory` to a potentially shared amrex DLL on Windows. * Windows CI: Set PATH to amrex_Nd.dll * CMake: AMReX_INSTALL After Python In superbuild, Python can modify `AMReX_BUILD_SHARED_LIBS`. * Clang Win CI: Manually Install requirements Sporadic error is: ``` ... Installing collected packages: pyparsing, numpy, scipy, periodictable, picmistandard ERROR: Could not install packages due to an OSError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\hostedtoolcache\\windows\\Python\\3.11.4\\x64\\Lib\\site-packages\\numpy\\polynomial\\__init__.py' Consider using the `--user` option or check the permissions. ``` * Hopefully final fixes to fields.py * Update getProbLo/getProbHi * Set plasma length strength Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * Fix fields method to remove CodeQL notice * Update Comments & Some Finalize * Move: set_plasma_lens_strength to MPC --------- Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> Co-authored-by: David Grote <dpgrote@lbl.gov> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Dave Grote <grote1@llnl.gov> Co-authored-by: Roelof Groenewald <regroenewald@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f6760c8 commit 6c93d9f

File tree

100 files changed

+3139
-5375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+3139
-5375
lines changed

.github/workflows/cuda.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
# https://github.com/ComputationalRadiationPhysics/picongpu/blob/0.5.0/share/picongpu/dockerfiles/ubuntu-1604/Dockerfile
1313
# https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/
1414
build_nvcc:
15-
name: NVCC 11.0.3 SP
15+
name: NVCC 11.3 SP
1616
runs-on: ubuntu-20.04
1717
if: github.event.pull_request.draft == false
1818
env:
@@ -30,7 +30,7 @@ jobs:
3030
python-version: '3.x'
3131
- name: install dependencies
3232
run: |
33-
.github/workflows/dependencies/nvcc11-0.sh
33+
.github/workflows/dependencies/nvcc11-3.sh
3434
- name: CCache Cache
3535
uses: actions/cache@v3
3636
# - once stored under a key, they become immutable (even if local cache path content changes)
@@ -65,7 +65,7 @@ jobs:
6565
-DCMAKE_VERBOSE_MAKEFILE=ON \
6666
-DWarpX_COMPUTE=CUDA \
6767
-DWarpX_EB=ON \
68-
-DWarpX_LIB=ON \
68+
-DWarpX_PYTHON=ON \
6969
-DAMReX_CUDA_ARCH=6.0 \
7070
-DWarpX_OPENPMD=ON \
7171
-DWarpX_openpmd_internal=OFF \
@@ -77,7 +77,8 @@ jobs:
7777
7878
python3 -m pip install --upgrade pip setuptools wheel
7979
export WARPX_MPI=ON
80-
PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel .
80+
export PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/
81+
python3 -m pip wheel .
8182
python3 -m pip install *.whl
8283
8384
# make sure legacy build system continues to build, i.e., that we don't forget
@@ -161,7 +162,7 @@ jobs:
161162
-DCMAKE_VERBOSE_MAKEFILE=ON \
162163
-DWarpX_COMPUTE=CUDA \
163164
-DWarpX_EB=ON \
164-
-DWarpX_LIB=ON \
165+
-DWarpX_PYTHON=ON \
165166
-DAMReX_CUDA_ARCH=8.0 \
166167
-DWarpX_OPENPMD=ON \
167168
-DWarpX_PSATD=ON \
@@ -176,5 +177,6 @@ jobs:
176177
177178
python3 -m pip install --upgrade pip setuptools wheel
178179
export WARPX_MPI=ON
179-
PYWARPX_LIB_DIR=$PWD/build/lib python3 -m pip wheel .
180+
export PYWARPX_LIB_DIR=$PWD/build/lib/site-packages/pywarpx/
181+
python3 -m pip wheel .
180182
python3 -m pip install *.whl

.github/workflows/dependencies/nvcc11-0.sh .github/workflows/dependencies/nvcc11-3.sh

+16-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright 2020-2022 The WarpX Community
3+
# Copyright 2020-2023 The WarpX Community
44
#
55
# License: BSD-3-Clause-LBNL
66
# Authors: Axel Huebl
@@ -26,30 +26,27 @@ sudo apt-get install -y \
2626
pkg-config \
2727
wget
2828

29-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
30-
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
31-
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
32-
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" \
33-
| sudo tee /etc/apt/sources.list.d/cuda.list
29+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
30+
sudo dpkg -i cuda-keyring_1.0-1_all.deb
3431

3532
sudo apt-get update
3633
sudo apt-get install -y \
37-
cuda-command-line-tools-11-0 \
38-
cuda-compiler-11-0 \
39-
cuda-cupti-dev-11-0 \
40-
cuda-minimal-build-11-0 \
41-
cuda-nvml-dev-11-0 \
42-
cuda-nvtx-11-0 \
43-
libcufft-dev-11-0 \
44-
libcurand-dev-11-0
45-
sudo ln -s cuda-11.0 /usr/local/cuda
34+
cuda-command-line-tools-11-3 \
35+
cuda-compiler-11-3 \
36+
cuda-cupti-dev-11-3 \
37+
cuda-minimal-build-11-3 \
38+
cuda-nvml-dev-11-3 \
39+
cuda-nvtx-11-3 \
40+
libcufft-dev-11-3 \
41+
libcurand-dev-11-3
42+
sudo ln -s cuda-11.3 /usr/local/cuda
4643

4744
# if we run out of temporary storage in CI:
48-
#du -sh /usr/local/cuda-11.0
45+
#du -sh /usr/local/cuda-11.3
4946
#echo "+++ REDUCING CUDA Toolkit install size +++"
50-
#sudo rm -rf /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcu{fft,pti,rand}_static.a
51-
#sudo rm -rf /usr/local/cuda-11.0/targets/x86_64-linux/lib/libnvperf_host_static.a
52-
#du -sh /usr/local/cuda-11.0/
47+
#sudo rm -rf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcu{fft,pti,rand}_static.a
48+
#sudo rm -rf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libnvperf_host_static.a
49+
#du -sh /usr/local/cuda-11.3/
5350
#df -h
5451

5552
# cmake-easyinstall

.github/workflows/hip.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ jobs:
5151
-DAMReX_AMD_ARCH=gfx900 \
5252
-DWarpX_COMPUTE=HIP \
5353
-DWarpX_EB=ON \
54-
-DWarpX_LIB=ON \
54+
-DWarpX_PYTHON=ON \
5555
-DWarpX_MPI=ON \
5656
-DWarpX_OPENPMD=ON \
5757
-DWarpX_PRECISION=SINGLE \
5858
-DWarpX_PSATD=ON
5959
cmake --build build_sp -j 2
6060
6161
export WARPX_MPI=OFF
62-
PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel .
62+
export PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/
63+
python3 -m pip wheel .
6364
python3 -m pip install *.whl
6465
6566
build_hip_2d_dp:
@@ -107,13 +108,14 @@ jobs:
107108
-DWarpX_DIMS=2 \
108109
-DWarpX_COMPUTE=HIP \
109110
-DWarpX_EB=ON \
110-
-DWarpX_LIB=ON \
111+
-DWarpX_PYTHON=ON \
111112
-DWarpX_MPI=ON \
112113
-DWarpX_OPENPMD=ON \
113114
-DWarpX_PRECISION=DOUBLE \
114115
-DWarpX_PSATD=ON
115116
cmake --build build_2d -j 2
116117
117118
export WARPX_MPI=OFF
118-
PYWARPX_LIB_DIR=$PWD/build_2d/lib python3 -m pip wheel .
119+
export PYWARPX_LIB_DIR=$PWD/build_2d/lib/site-packages/pywarpx/
120+
python3 -m pip wheel .
119121
python3 -m pip install *.whl

.github/workflows/intel.yml

+16-13
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,29 @@ jobs:
4141
export CXX=$(which icpc)
4242
export CC=$(which icc)
4343
44+
python3 -m pip install --upgrade pip setuptools wheel
45+
4446
cmake -S . -B build_dp \
4547
-DCMAKE_VERBOSE_MAKEFILE=ON \
46-
-DWarpX_LIB=ON \
48+
-DpyAMReX_IPO=OFF \
49+
-DWarpX_PYTHON=ON \
50+
-DWarpX_PYTHON_IPO=OFF \
4751
-DWarpX_MPI=OFF \
4852
-DWarpX_OPENPMD=ON \
4953
-DWarpX_openpmd_internal=OFF
5054
cmake --build build_dp -j 2
5155
5256
cmake -S . -B build_sp \
5357
-DCMAKE_VERBOSE_MAKEFILE=ON \
54-
-DWarpX_LIB=ON \
58+
-DpyAMReX_IPO=OFF \
59+
-DWarpX_PYTHON=ON \
60+
-DWarpX_PYTHON_IPO=OFF \
5561
-DWarpX_MPI=OFF \
5662
-DWarpX_OPENPMD=ON \
5763
-DWarpX_openpmd_internal=OFF \
5864
-DWarpX_PRECISION=SINGLE
5965
cmake --build build_sp -j 2
60-
61-
python3 -m pip install --upgrade pip setuptools wheel
62-
PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip install -v .
66+
cmake --build build_sp --target pip_install
6367
6468
build_icpx:
6569
name: oneAPI ICX SP
@@ -99,20 +103,19 @@ jobs:
99103
export CXX=$(which icpx)
100104
export CC=$(which icx)
101105
106+
python3 -m pip install --upgrade pip
107+
python3 -m pip install --upgrade setuptools wheel
108+
102109
cmake -S . -B build_sp \
103110
-DCMAKE_CXX_FLAGS_RELEASE="-O1 -DNDEBUG" \
104111
-DCMAKE_VERBOSE_MAKEFILE=ON \
105112
-DWarpX_EB=ON \
106-
-DWarpX_LIB=ON \
113+
-DWarpX_PYTHON=ON \
107114
-DWarpX_MPI=OFF \
108115
-DWarpX_OPENPMD=ON \
109116
-DWarpX_PRECISION=SINGLE
110117
cmake --build build_sp -j 2
111-
112-
python3 -m pip install --upgrade pip
113-
python3 -m pip install --upgrade setuptools wheel
114-
PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel -v .
115-
python3 -m pip install *.whl
118+
cmake --build build_sp --target pip_install
116119
117120
- name: run pywarpx
118121
run: |
@@ -167,7 +170,7 @@ jobs:
167170
-DCMAKE_VERBOSE_MAKEFILE=ON \
168171
-DWarpX_COMPUTE=SYCL \
169172
-DWarpX_EB=ON \
170-
-DWarpX_LIB=ON \
173+
-DWarpX_PYTHON=ON \
171174
-DWarpX_MPI=OFF \
172175
-DWarpX_OPENPMD=ON \
173176
-DWarpX_PRECISION=SINGLE
@@ -176,5 +179,5 @@ jobs:
176179
# Skip this as it will copy the binary artifacts and we are tight on disk space
177180
# python3 -m pip install --upgrade pip
178181
# python3 -m pip install --upgrade setuptools wheel
179-
# PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel .
182+
# PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/ python3 -m pip wheel .
180183
# python3 -m pip install *.whl

.github/workflows/macos.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
ccache-macos-appleclang-
6464
- name: build WarpX
6565
run: |
66+
python3 -m pip install --upgrade pip
67+
python3 -m pip install --upgrade pip setuptools wheel
68+
6669
cmake -S . -B build_dp \
6770
-DCMAKE_VERBOSE_MAKEFILE=ON \
6871
-DWarpX_EB=ON \
@@ -72,17 +75,14 @@ jobs:
7275
7376
cmake -S . -B build_sp \
7477
-DCMAKE_VERBOSE_MAKEFILE=ON \
78+
-DPython_EXECUTABLE=$(which python3) \
7579
-DWarpX_EB=ON \
76-
-DWarpX_LIB=ON \
80+
-DWarpX_PYTHON=ON \
7781
-DWarpX_OPENPMD=ON \
7882
-DWarpX_openpmd_internal=OFF \
7983
-DWarpX_PRECISION=SINGLE
8084
cmake --build build_sp -j 3
81-
82-
python3 -m pip install --upgrade pip setuptools wheel
83-
export WARPX_MPI=ON
84-
PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel .
85-
python3 -m pip install *.whl
85+
cmake --build build_sp --target pip_install
8686
8787
- name: run pywarpx
8888
run: |

.github/workflows/ubuntu.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ jobs:
163163
runs-on: ubuntu-20.04
164164
if: github.event.pull_request.draft == false
165165
env:
166+
CC: clang
167+
CXX: clang++
166168
# On CI for this test, Ninja is slower than the default:
167169
#CMAKE_GENERATOR: Ninja
168170
# setuptools/mp4py work-around, see
@@ -189,14 +191,16 @@ jobs:
189191
- name: build WarpX
190192
run: |
191193
python3 -m pip install --upgrade pip setuptools wheel
192-
export WARPX_MPI=ON
193-
export WARPX_OPENPMD=ON
194-
export WARPX_PSATD=ON
195-
export WARPX_QED_TABLE_GEN=ON
196-
export CC=$(which clang)
197-
export CXX=$(which clang++)
194+
198195
export CXXFLAGS="-Werror -Wno-error=pass-failed"
199-
python3 -m pip install -v .
196+
197+
cmake -S . -B build \
198+
-DCMAKE_VERBOSE_MAKEFILE=ON \
199+
-DWarpX_APP=OFF \
200+
-DWarpX_PSATD=ON \
201+
-DWarpX_PYTHON=ON \
202+
-DWarpX_QED_TABLE_GEN=ON
203+
cmake --build build -j 2 --target pip_install
200204
201205
- name: run pywarpx
202206
run: |

.github/workflows/windows.yml

+27-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
if: github.event.pull_request.draft == false
1414
steps:
1515
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
1619
- name: CCache Cache
1720
uses: actions/cache@v3
1821
# - once stored under a key, they become immutable (even if local cache path content changes)
@@ -33,16 +36,22 @@ jobs:
3336
-DWarpX_COMPUTE=NOACC `
3437
-DWarpX_OPENPMD=ON `
3538
-DWarpX_MPI=OFF `
36-
-DWarpX_LIB=ON
39+
-DWarpX_PYTHON=ON
3740
if(!$?) { Exit $LASTEXITCODE }
3841
cmake --build build --config Debug --parallel 2
3942
if(!$?) { Exit $LASTEXITCODE }
4043
4144
python3 -m pip install --upgrade pip setuptools wheel
4245
if(!$?) { Exit $LASTEXITCODE }
46+
cmake --build build --config Debug --target install
47+
if(!$?) { Exit $LASTEXITCODE }
4348
cmake --build build --config Debug --target pip_install
4449
if(!$?) { Exit $LASTEXITCODE }
4550
51+
- name: Test
52+
run: |
53+
$env:PATH += ';C:/Program Files (x86)/WarpX/bin/'
54+
4655
python3 Examples\Tests\gaussian_beam\PICMI_inputs_gaussian_beam.py
4756
# JSON writes are currently very slow (50min) with MSVC
4857
# --diagformat=openpmd
@@ -53,6 +62,10 @@ jobs:
5362
if: github.event.pull_request.draft == false
5463
steps:
5564
- uses: actions/checkout@v3
65+
- uses: actions/setup-python@v4
66+
with:
67+
python-version: '3.x'
68+
- uses: seanmiddleditch/gha-setup-ninja@master
5669
- name: CCache Cache
5770
uses: actions/cache@v3
5871
# - once stored under a key, they become immutable (even if local cache path content changes)
@@ -65,7 +78,6 @@ jobs:
6578
restore-keys: |
6679
ccache-windows-winclang-${{ hashFiles('.github/workflows/windows.yml') }}-
6780
ccache-windows-winclang-
68-
- uses: seanmiddleditch/gha-setup-ninja@master
6981
- name: Build & Install
7082
shell: cmd
7183
run: |
@@ -78,17 +90,29 @@ jobs:
7890
-DCMAKE_VERBOSE_MAKEFILE=ON ^
7991
-DWarpX_COMPUTE=OMP ^
8092
-DWarpX_EB=ON ^
81-
-DWarpX_LIB=ON ^
93+
-DWarpX_PYTHON=ON ^
8294
-DWarpX_MPI=OFF ^
8395
-DWarpX_OPENPMD=ON
8496
if errorlevel 1 exit 1
8597
cmake --build build --config Release --parallel 2
8698
if errorlevel 1 exit 1
8799
100+
cmake --build build --config Release --target install
101+
if errorlevel 1 exit 1
102+
88103
python3 -m pip install --upgrade pip setuptools wheel
89104
if errorlevel 1 exit 1
105+
python3 -m pip install --upgrade -r requirements.txt
106+
if errorlevel 1 exit 1
107+
90108
cmake --build build --config Release --target pip_install
91109
if errorlevel 1 exit 1
92110
111+
- name: Test
112+
shell: cmd
113+
run: |
114+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
115+
set "PATH=C:/Program Files (x86)/WarpX/bin/;%PATH%"
116+
93117
python3 Examples\Tests\gaussian_beam\PICMI_inputs_gaussian_beam.py --diagformat=openpmd
94118
if errorlevel 1 exit 1

0 commit comments

Comments
 (0)