Skip to content
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
9 changes: 7 additions & 2 deletions .github/workflows/idefix-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ on:
workflow_dispatch:
push:
branches:
- main
- master
pull_request:

env:
TEST_OPTIONS: -DKokkos_ENABLE_CUDA=ON

jobs:
Linter:
# Don't do this in forks
Expand All @@ -17,7 +20,9 @@ jobs:
with:
lfs: false
- run: pre-commit install
- run: pre-commit run --all-files
- name: Run linter
id: linter
run: pre-commit run --all-files

Hydrodynamics:
needs: Linter
Expand Down
34 changes: 18 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,77 @@ workflow:
- if: $CI_PIPELINE_SOURCE == 'web' # execute jobs when created by using Run pipeline button in the GitLab UI, from the project’s CI/CD > Pipelines section.

stages:
- checks
- deploy
- linter
- base_checks
- advanced_checks
- documentation

lint:
stage: checks
stage: linter
image: lesurg/idefix:latest
script:
- pre-commit install
- pre-commit run --all-files

HD tests:
stage: checks
stage: base_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_hydro.sh $TEST_OPTIONS

MHD tests:
stage: checks
stage: base_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_mhd.sh $TEST_OPTIONS

Vector potential tests:
stage: checks
MPI tests:
stage: base_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_vector_potential.sh $TEST_OPTIONS
- ./checks_mpi.sh $TEST_OPTIONS

MPI tests:
stage: checks
Vector potential tests:
stage: base_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_mpi.sh $TEST_OPTIONS
- ./checks_vector_potential.sh $TEST_OPTIONS

HighOrder tests:
stage: checks
stage: advanced_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_highorder.sh $TEST_OPTIONS

SinglePrecision tests:
stage: checks
stage: advanced_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_singleprecision.sh $TEST_OPTIONS

Examples tests:
stage: checks
stage: advanced_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_examples.sh $TEST_OPTIONS

Utils tests:
stage: checks
stage: advanced_checks
image: lesurg/idefix:latest
script:
- cd test
- ./checks_utils.sh $TEST_OPTIONS

pages:
image: lesurg/idefix-documentation:latest
stage: deploy
stage: documentation
script:
- dir="public"
- rm -rf $dir
Expand Down
2 changes: 1 addition & 1 deletion test/MHD/ResistiveAlfvenWave/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void Analysis(DataBlock & data) {
}, Kokkos::Sum<double>(etot));

#ifdef WITH_MPI
MPI_Reduce(MPI_IN_LACE, &etot, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
MPI_Reduce(MPI_IN_PLACE, &etot, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);
#endif

if(idfx::prank == 0) {
Expand Down
27 changes: 20 additions & 7 deletions test/checks_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,45 @@ echo $IDEFIX_DIR
set -e
options=$@

# HD tests

TMP_DIR="$(mktemp -d)"
function finish ()
{
echo $1
echo "Cleaning directory $TMP_DIR"
cd $TEST_DIR
rm -rf $TMP_DIR
exit 1
}

for rep in $rep_example_list; do
TMP_DIR="$(mktemp -d)"

cp -R $TEST_DIR/$rep/* $TMP_DIR
cd $TMP_DIR
echo "***********************************************"
echo "Configuring $rep"
echo "Using $TMP_DIR as working directory"
echo "***********************************************"
rm -f CMakeCache.txt

cmake $IDEFIX_DIR $options || { echo "!!!! Example $rep failed during configuration"; exit 1; }
cmake $IDEFIX_DIR $options || finish "!!!! Example $rep failed during configuration"
echo "***********************************************"
echo "Making $rep"
echo "***********************************************"
make clean; make -j 10 || { echo "!!!! Example $rep failed during compilation"; exit 1; }
make -j 8 || finish "!!!! Example $rep failed during compilation"


echo "***********************************************"
echo "Running $rep"
echo "***********************************************"
./idefix -maxcycles 10 -nowrite -Werror || { echo "!!!! Example $rep failed running"; exit 1; }
./idefix -maxcycles 10 -nowrite -Werror || finish "!!!! Example $rep failed running"

echo "***********************************************"
echo "Cleaning $rep in $TMP_DIR"
echo "***********************************************"
rm -rf $TMP_DIR
rm -rf *.vtk *.dbl *.dmp *.ini python CMakeLists.txt

done

echo "Test was successfull"
cd $TEST_DIR
rm -rf $TMP_DIR
42 changes: 25 additions & 17 deletions test/checks_highorder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,88 +30,96 @@ if [ -z ${var+IDEFIX_DIR} ] & [ -d "$IDEFIX_DIR" ] ; then
fi

export IDEFIX_DIR=$target_dir
echo $IDEFIX_DIR

set -e
options=$@

TMP_DIR="$(mktemp -d)"
function finish ()
{
echo $1
echo "Cleaning directory $TMP_DIR"
cd $TEST_DIR
rm -rf $TMP_DIR
exit 1
}

# High order tests
for rep in $rep_list; do
TMP_DIR="$(mktemp -d)"
cp -R $TEST_DIR/$rep/* $TMP_DIR
cd $TMP_DIR
echo "***********************************************"
echo "Configuring $rep"
echo "Using $TMP_DIR as working directory"
echo "***********************************************"
rm -f CMakeCache.txt
for order in $order_list; do

cmake $IDEFIX_DIR $options -DIdefix_RECONSTRUCTION=$order || { echo "!!!!$rep with $order failed during configuration"; exit 1; }
cmake $IDEFIX_DIR $options -DIdefix_RECONSTRUCTION=$order || finish "!!!!$rep with $order failed during configuration"
echo "***********************************************"
echo "Making $rep with $order"
echo "***********************************************"
make clean; make -j 10 || { echo "!!!! $rep with $order failed during compilation with"; exit 1; }
make -j 8 || finish "!!!! $rep with $order failed during compilation"

ini_files=$(ls *.ini)
for ini in $ini_files; do
echo "***********************************************"
echo "Running $rep with $order and $ini"
echo "***********************************************"
./idefix -i $ini -nolog || { echo "!!!! $rep with $order failed running with $ini"; exit 1; }
./idefix -i $ini -nolog || finish "!!!! $rep with $order failed running with $ini"

cd python
echo "***********************************************"
echo "Testing $rep with $order and $ini"
echo "***********************************************"
python3 testidefix.py -noplot || { echo "!!!! $rep with $order failed validation with $ini"; exit 1; }
python3 testidefix.py -noplot || finish "!!!! $rep with $order failed validation with $ini"
cd ..
done
make clean
rm -f *.vtk *.dbl *.dmp
done
echo "***********************************************"
echo "Cleaning $rep in $TMP_DIR"
echo "***********************************************"
rm -rf $TMP_DIR
rm -rf *.vtk *.dbl *.dmp *.ini python CMakeLists.txt
done

#do it with MPI (only the default .ini files though)
# High order tests
for rep in $rep_MPI_list; do
TMP_DIR="$(mktemp -d)"
cp -R $TEST_DIR/$rep/* $TMP_DIR
cd $TMP_DIR
echo "***********************************************"
echo "Configuring $rep"
echo "Using $TMP_DIR as working directory"
echo "***********************************************"
rm -f CMakeCache.txt

for order in $order_list; do

cmake $IDEFIX_DIR $options -DIdefix_RECONSTRUCTION=$order -DIdefix_MPI=ON || { echo "!!!!$rep with $order failed during configuration"; exit 1; }
cmake $IDEFIX_DIR $options -DIdefix_RECONSTRUCTION=$order -DIdefix_MPI=ON || finish "!!!!$rep with $order failed during configuration"
echo "***********************************************"
echo "Making $rep with $order"
echo "***********************************************"
make clean; make -j 10 || { echo "!!!! $rep with $order and MPI failed during compilation with"; exit 1; }
make -j 8 || finish "!!!! $rep with $order and MPI failed during compilation with"

echo "***********************************************"
echo "Running $rep with $order and MPI"
echo "***********************************************"
mpirun -np 4 ./idefix || { echo "!!!! $rep with $order and MPI failed running "; exit 1; }
mpirun -np 4 ./idefix || finish "!!!! $rep with $order and MPI failed running "

cd python
echo "***********************************************"
echo "Testing $rep with $order and MPI"
echo "***********************************************"
python3 testidefix.py -noplot || { echo "!!!! $rep with $order and MPI failed validation"; exit 1; }
python3 testidefix.py -noplot || finish "!!!! $rep with $order and MPI failed validation"
cd ..

make clean
rm -f *.vtk *.dbl *.dmp
done
echo "***********************************************"
echo "Cleaning $rep in $TMP_DIR"
echo "***********************************************"
rm -rf $TMP_DIR
rm -rf *.vtk *.dbl *.dmp *.ini python CMakeLists.txt
done

echo "Test was successfull"
cd $TEST_DIR
rm -rf $TMP_DIR
26 changes: 18 additions & 8 deletions test/checks_hydro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,53 @@ set -e
options=$@

# HD tests
TMP_DIR="$(mktemp -d)"
function finish ()
{
echo $1
echo "Cleaning directory $TMP_DIR"
cd $TEST_DIR
rm -rf $TMP_DIR
exit 1
}

for rep in $rep_HD_list; do
TMP_DIR="$(mktemp -d)"
cp -R $TEST_DIR/HD/$rep/* $TMP_DIR
cd $TMP_DIR
echo "***********************************************"
echo "Configuring $rep"
echo "Using $TMP_DIR as working directory"
echo "***********************************************"
rm -f CMakeCache.txt
def_files=$(ls definitions*.hpp)
for def in $def_files; do

cmake $IDEFIX_DIR $options -DIdefix_DEFS=$def|| { echo "!!!! HD $rep failed during configuration"; exit 1; }
cmake $IDEFIX_DIR $options -DIdefix_DEFS=$def|| finish "!!!! HD $rep failed during configuration"
echo "***********************************************"
echo "Making $rep with $def"
echo "***********************************************"
make clean; make -j 10 || { echo "!!!! HD $rep failed during compilation with $def"; exit 1; }
make -j 8 || finish "!!!! HD $rep failed during compilation with $def"

ini_files=$(ls *.ini)
for ini in $ini_files; do
echo "***********************************************"
echo "Running $rep with $ini"
echo "***********************************************"
./idefix -i $ini -nolog || { echo "!!!! HD $rep failed running with $def and $ini"; exit 1; }
./idefix -i $ini -nolog || finish "!!!! HD $rep failed running with $def and $ini"

cd python
echo "***********************************************"
echo "Testing $rep with $ini and $def"
echo "***********************************************"
python3 testidefix.py -noplot || { echo "!!!! HD $rep failed validation with $def and $ini"; exit 1; }
python3 testidefix.py -noplot || finish "!!!! HD $rep failed validation with $def and $ini"
cd ..
done
make clean
rm -f *.vtk *.dbl *.dmp
done
echo "***********************************************"
echo "Cleaning $rep in $TMP_DIR"
echo "***********************************************"
rm -rf $TMP_DIR
rm -rf *.vtk *.dbl *.dmp *.ini python CMakeLists.txt
done
echo "Test was successfull"
cd $TEST_DIR
rm -rf $TMP_DIR
Loading