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
15 changes: 15 additions & 0 deletions .github/workflows/actions/pre-install-py-packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Install python packages

description: "Action installing the Idefix python packages before running the tests."

inputs: {}

runs:
using: "composite"
steps:
- name: Create venv
shell: bash
run: |
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r ./test/python_requirements.txt
26 changes: 26 additions & 0 deletions .github/workflows/idefix-ci-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Sod test
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/sod -all $TESTME_OPTIONS
- name: Isothermal Sod test
Expand All @@ -46,6 +48,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Viscous flow past cylinder
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/ViscousFlowPastCylinder -all $TESTME_OPTIONS
- name: Viscous disk
Expand All @@ -60,6 +64,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: MHD Sod test
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/sod -all $TESTME_OPTIONS
- name: MHD Isothermal Sod test
Expand All @@ -80,6 +86,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Ambipolar C Shock
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/AmbipolarCshock -all $TESTME_OPTIONS
- name: Ambipolar C Shock 3D
Expand All @@ -99,6 +107,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Fargo + planet
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/FargoPlanet -all $TESTME_OPTIONS
- name: Fargo MHD spherical
Expand All @@ -112,6 +122,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Hydro shearing box
run: scripts/ci/run-tests $IDEFIX_DIR/test/HD/ShearingBox -all $TESTME_OPTIONS
- name: MHD shearing box
Expand All @@ -125,6 +137,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Jeans Instability
run: scripts/ci/run-tests $IDEFIX_DIR/test/SelfGravity/JeansInstability -all $TESTME_OPTIONS
- name: Random sphere spherical
Expand All @@ -144,6 +158,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: 3 body
run: scripts/ci/run-tests $IDEFIX_DIR/test/Planet/Planet3Body -all $TESTME_OPTIONS
- name: migration
Expand All @@ -165,6 +181,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Energy conservation
run: scripts/ci/run-tests $IDEFIX_DIR/test/Dust/DustEnergy -all $TESTME_OPTIONS
- name: Dusty wave
Expand All @@ -178,6 +196,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: MTI
run: scripts/ci/run-tests $IDEFIX_DIR/test/MHD/MTI -all $TESTME_OPTIONS
- name: Spherical anisotropic diffusion
Expand All @@ -195,6 +215,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Run examples test
run: cd test && ./checks_examples.sh $TEST_OPTIONS

Expand All @@ -206,6 +228,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Lookup table
run: scripts/ci/run-tests $IDEFIX_DIR/test/utils/lookupTable -all $TESTME_OPTIONS
- name: Dump Image
Expand All @@ -221,6 +245,8 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prep python
uses: ./.github/workflows/actions/pre-install-py-packages
- name: Restart dumps
run: scripts/ci/run-tests $IDEFIX_DIR/test/IO/dump -all $TESTME_OPTIONS
- name: Pydefix
Expand Down
13 changes: 13 additions & 0 deletions scripts/ci/run-tests
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
#!/usr/bin/env bash

# load ICC compiler env
if [ "$IDEFIX_COMPILER" == icc ]; then
source /opt/intel/oneapi/setvars.sh
fi

# enable bash features
set -ue

# load python venv if present
if [ -d .venv ]; then
source .venv/bin/activate
fi

# jump in test directory
cd "$1"

# run the test
./testme.py "${@:2}"
2 changes: 1 addition & 1 deletion src/dataBlock/planetarySystem/planetStructs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct Force {
real f_ex_inner[3];
real f_outer[3];
real f_ex_outer[3];
KOKKOS_FUNCTION void operator+=(Force const volatile& f) volatile {
KOKKOS_FUNCTION void operator+=(const Force & f) {
for (int i = 0; i < 3; ++i) {
f_inner[i] += f.f_inner[i];
f_ex_inner[i] += f.f_ex_inner[i];
Expand Down
2 changes: 1 addition & 1 deletion test/MHD/AmbipolarWind/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void ComputeUserVars(DataBlock & data, UserDefVariablesContainer &variables) {
IdefixHostArray1D<real> x1=d.x[IDIR];
IdefixHostArray1D<real> x2=d.x[JDIR];
IdefixHostArray4D<real> Vc=d.Vc;
IdefixArray3D<real>::HostMirror scrhHost = Kokkos::create_mirror_view(scrh);
IdefixArray3D<real>::host_mirror_type scrhHost = Kokkos::create_mirror_view(scrh);
Kokkos::deep_copy(scrhHost,scrh);

for(int k = d.beg[KDIR]; k < d.end[KDIR] ; k++) {
Expand Down
3 changes: 3 additions & 0 deletions test/python_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ scipy>=1.2.3

# note that no version of inifix supports Python older than 3.6
inifix>=0.11.2

# It supports Python 3.8 as minimum.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This comment makes the one I added to inifix redundant.

While this is being looked at, could we specify a minimal requirement for Python itself, even if it's just a comment ?

3.11 is widely distributed and likely sufficient nowadays, if I may add a suggestion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm assuming you're refereing to #381 ? I don't see how this comment make yours redundant,nor why we should require python 3.11 (this is only 4 years old)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

no I'm talking about the comment on line 9 of the same file. It doesn't matter any more that inifix requires 3.6+ if another dependency requires an even newer version.

(this is only 4 years old)

Python versions stop receiving security fixes after 5 years, and 3.10 is about to go EOL. That's why I don't recommend older versions. But of course you do you.
https://devguide.python.org/versions/

pybind11 >= 3.0.4
2 changes: 1 addition & 1 deletion test/skeleton/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void testReduction() {

// Init an array on device, and image on host
IdefixArray3D<real> rho = IdefixArray3D<real>("rho",nx3,nx2,nx1);
IdefixArray3D<real>::HostMirror rhoHost = Kokkos::create_mirror_view(rho);
IdefixArray3D<real>::host_mirror_type rhoHost = Kokkos::create_mirror_view(rho);

// Fill the host array, and compute the theoretical results
real theoreticalResult = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/utils/columnDensity/setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void Analysis(DataBlock & data) {
columnX3Right->ComputeColumn(rho);

IdefixArray3D<real> columnDensityLeft, columnDensityRight;
IdefixArray3D<real>::HostMirror columnDensityLeftHost, columnDensityRightHost;
IdefixArray3D<real>::host_mirror_type columnDensityLeftHost, columnDensityRightHost;
// IDIR
columnDensityLeft = columnX1Left->GetColumn();
columnDensityRight = columnX1Right->GetColumn();
Expand Down
2 changes: 1 addition & 1 deletion test/utils/lookupTable/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main( int argc, char* argv[] )
idfx::cout << "--------------------------------------" << std::endl;
idfx::cout << "Testing 2D CSV file on device." << std::endl;
IdefixArray1D<real> arr = IdefixArray1D<real>("Test",1);
IdefixArray1D<real>::HostMirror arrHost = Kokkos::create_mirror_view(arr);
IdefixArray1D<real>::host_mirror_type arrHost = Kokkos::create_mirror_view(arr);

LookupTable<2> csv("toto.csv",',');

Expand Down
Loading