diff --git a/Python/SlurmTests/poiseuille/PoiseuilleTestContainer.def b/Python/SlurmTests/poiseuille/PoiseuilleTestContainer.def index a3836e7906b9be66ec79f68bf53ccc079db9d9ef..a275c88a6a46bfe806fce68e87aab571b66cc077 100644 --- a/Python/SlurmTests/poiseuille/PoiseuilleTestContainer.def +++ b/Python/SlurmTests/poiseuille/PoiseuilleTestContainer.def @@ -1,11 +1,13 @@ BootStrap: docker From: ubuntu:20.04 +Stage: build %files 3rdParty 3rdParty apps apps CMake CMake Python Python + pythonbindings pythonbindings src src CMakeLists.txt CMakeLists.txt cpu.cmake cpu.cmake @@ -19,7 +21,8 @@ From: ubuntu:20.04 apt-get update && \ apt-get install -y \ build-essential \ - cmake=3.16.3-1ubuntu1 \ + ccache \ + git \ python3 \ python3-dev \ python3-pip \ @@ -27,10 +30,31 @@ From: ubuntu:20.04 libomp-dev \ libgl1 - pip3 install setuptools wheel numpy scipy pyvista + pip3 install setuptools wheel cmake numpy scipy pyvista export PYTHONPATH=Python - python3 /setup.py install + python3 /setup.py bdist_wheel build_ext --build-temp=build + pip3 install $(find dist/*.whl) + + +BootStrap: docker +From: ubuntu:20.04 +Stage: runtime + +%files from build + Python Python + dist dist + +%post + export DEBIAN_FRONTEND=noninteractive + apt-get update && \ + apt-get install -y \ + python3 \ + python3-pip \ + mpich \ + libgl1 + + pip3 install $(find dist/*.whl) %environment export PYTHONPATH=/Python diff --git a/Python/SlurmTests/poiseuille/simulation_runner.py b/Python/SlurmTests/poiseuille/simulation_runner.py index 03fb24be7ea1a6468ae25ec3aa40ab59962ef91e..d54a35e72b298562f8ccec82677089f3898eec9b 100644 --- a/Python/SlurmTests/poiseuille/simulation_runner.py +++ b/Python/SlurmTests/poiseuille/simulation_runner.py @@ -5,7 +5,7 @@ from poiseuille.simulation import run_simulation from pyfluids.cpu.writer import Writer, OutputFormat -scale_level = int(os.environ["PYFLUIDS_SCALE_LEVEL"]) +scale_level = int(os.environ.get("PYFLUIDS_SCALE_LEVEL", 1)) grid_params, physical_params, runtime_params, kernel = Scaling.configuration_for_scale_level(scale_level) writer = Writer() diff --git a/Python/SlurmTests/poiseuille/slurm.job b/Python/SlurmTests/poiseuille/slurm.job index 8115b13e11b3301c4131b1156e678ad5b1a36d1a..b4e4da271920479ade008b28d4d2e6ce6343c3d3 100644 --- a/Python/SlurmTests/poiseuille/slurm.job +++ b/Python/SlurmTests/poiseuille/slurm.job @@ -1,6 +1,6 @@ #!/bin/bash #SBATCH -J PyFluidsTest -#SBATCH -o POISEUILLE_TEST.out +#SBATCH -o poiseuille_test/POISEUILLE_TEST.out #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=20 @@ -10,6 +10,9 @@ #SBATCH --partition=standard source $HOME/.bashrc +module load singularity/3.9.9 + +cd poiseuille_test echo "PyFluids Poiseuille Test Case" echo "Number of tasks: ${SLURM_NTASKS}" diff --git a/pythonbindings/CMakeLists.txt b/pythonbindings/CMakeLists.txt index 644b308c97760d6a8243ae7782f0737a1d168100..ea6ff833aae76c4ed9964b6d280d7e5a6dec26e0 100644 --- a/pythonbindings/CMakeLists.txt +++ b/pythonbindings/CMakeLists.txt @@ -1,4 +1,11 @@ -project(VirtualFluidsPython LANGUAGES CUDA CXX) +set(PYFLUIDS_LANGUAGES CXX) + +if(BUILD_VF_GPU) + set(PYFLUIDS_LANGUAGES CUDA CXX) +endif() + +project(VirtualFluidsPython LANGUAGES ${PYFLUIDS_LANGUAGES}) + pybind11_add_module(python_bindings MODULE src/VirtualFluids.cpp) set_target_properties( python_bindings PROPERTIES diff --git a/rocket.yml b/rocket.yml new file mode 100644 index 0000000000000000000000000000000000000000..da64a48cd3f6fae69ae9f06648c7c156950a71ec --- /dev/null +++ b/rocket.yml @@ -0,0 +1,23 @@ +host: $REMOTE_HOST +user: $REMOTE_USER +private_keyfile: $PRIVATE_KEY + +copy: + - from: Python/SlurmTests/poiseuille/slurm.job + to: poiseuille_test/slurm.job + overwrite: true + + - from: Containers/PoiseuilleTestContainer.sif + to: poiseuille_test/PoiseuilleTestContainer.sif + overwrite: true + +collect: + - from: poiseuille_test/POISEUILLE_TEST.out + to: POISEUILLE_TEST.out + overwrite: true + +clean: + - poiseuille_test/* + +sbatch: poiseuille_test/slurm.job +continue_if_job_fails: true