Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression Testing: Use Mainline & CMake #2556

Merged
merged 5 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
BLASPP_HOME: '/usr/local'
CEI_SUDO: 'sudo'
CEI_TMP: '/tmp/cei'
CMAKE_GENERATOR: 'Ninja'
FFTW_HOME: '/usr'
LAPACKPP_HOME: '/usr/local'
OMP_NUM_THREADS: 1
Expand Down Expand Up @@ -75,7 +76,8 @@ jobs:
set -eu -o pipefail
cat /proc/cpuinfo | grep "model name" | sort -u
df -h
sudo apt install -y ccache curl gcc gfortran git g++ openmpi-bin libopenmpi-dev \
sudo apt install -y ccache curl gcc gfortran git g++ ninja-build \
openmpi-bin libopenmpi-dev \
libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
python3 python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
ccache --set-config=max_size=10.0G
Expand Down
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,25 @@ endif()
#)


# CI Helper ###################################################################
#

# calling `python -m pip wheel .` and install re-using the build directory
# note: this is mainly for our CI Python regression scripts, users and package
# managers should just use `python -m pip wheel .` and `... install *whl`
# directly
set(PYINSTALLOPTIONS "" CACHE STRING "Additional parameters to pass to `pip install`")
add_custom_target(install_pip
${CMAKE_COMMAND} -E env PYWARPX_LIB_DIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} python3 -m pip wheel -v --use-feature=in-tree-build ${WarpX_SOURCE_DIR}
COMMAND
python3 -m pip install --force-reinstall -v ${PYINSTALLOPTIONS} ${CMAKE_BINARY_DIR}/*whl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm: so we don't need a --user here, correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. Since #2653 we run out tests (incl. GNUmake before the current PR) in a virtual environment.

--user was only needed when modifying the user-local Python environment. That was a bit unexpected/had side-effects and is solved now.

WORKING_DIRECTORY
${CMAKE_BINARY_DIR}
DEPENDS
shared
)


# Tests #######################################################################
#

Expand Down
11 changes: 9 additions & 2 deletions Docs/source/developers/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ There are three steps to follow to add a new automated test (illustrated here fo
runtime_params = warpx.do_dynamic_scheduling=0 algo.maxwell_solver=yee
dim = 2
addToCompileString =
cmakeSetupOpts = -DWarpX_DIMS=2
restartTest = 0
useMPI = 1
numprocs = 2
useOMP = 1
numthreads = 2
numthreads = 1
compileTest = 0
doVis = 0
analysisRoutine = Examples/Tests/PML/analysis_pml_yee.py
Expand All @@ -104,8 +105,14 @@ If you re-use an existing input file, you can add arguments to ``runtime_params`

If you added ``analysisRoutine = Examples/analysis_default_regression.py``, then run the new test case locally and add the :ref:`checksum <developers-checksum>` file for the expected output.

.. note::

We run those tests on our continuous integration services, which at the moment only have 2 virtual CPU cores.
Thus, make sure that the product of ``numprocs`` and ``numthreads`` for a test is ``<=2``.


Useful tool for plotfile comparison: ``fcompare``
--------------------------------------------------
-------------------------------------------------

AMReX provides ``fcompare``, an executable that takes two ``plotfiles`` as input and returns the absolute and relative difference for each field between these two plotfiles. For some changes in the code, it is very convenient to run the same input file with an old and your current version, and ``fcompare`` the plotfiles at the same iteration. To use it:

Expand Down
2 changes: 1 addition & 1 deletion Examples/Modules/laser_injection_from_file/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def launch_analysis(executable):


def main() :
executables = glob.glob("main2d*")
executables = glob.glob("*.ex")
if len(executables) == 1 :
launch_analysis(executables[0])
else :
Expand Down
4 changes: 4 additions & 0 deletions Regression/WarpX-GPU-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ purge_output = 1
MAKE = make
numMakeJobs = 8

# We build by default a few tools for output comparison.
# The build time for those can be skipped if they are not needed.
ftools =

# Control the build of the particle_compare tool.
# Needed for test particle_tolerance option.
use_ctools = 0
Expand Down
Loading