From a4076f82e41abd5a5230b84fa52a5deaf0f86c82 Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Mon, 19 May 2025 11:59:31 +0800 Subject: [PATCH 1/6] CI: Change actions to self-hosted runner. - The action-runner is running in a docker container hosted on a Win11 computer. It has 12xCPUs and 1x4060Ti GPU card. - To reduce the ci time, all the prerequisites are installed in the container. This actions script only performs the compiling and testing procedures. --- .../workflows/CPU_inferencce_validation.yml | 35 ++----------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/.github/workflows/CPU_inferencce_validation.yml b/.github/workflows/CPU_inferencce_validation.yml index 86326de6..c9b23fa9 100644 --- a/.github/workflows/CPU_inferencce_validation.yml +++ b/.github/workflows/CPU_inferencce_validation.yml @@ -8,50 +8,21 @@ on: - master jobs: build_validation: - runs-on: [self-hosted, linux, x64] + runs-on: [self-hosted, linux, x64, 4060Ti] if: github.repository_owner == 'deepmodeling' - container: - image: ubuntu:20.04 - options: --shm-size=5g # shared memory size = 5GB steps: - name: Checkout uses: actions/checkout@v3 - - name: install dependencies - env: - DEBIAN_FRONTEND: noninteractive - run: | - apt-get update - apt-get install -y sudo wget unzip git software-properties-common make cmake g++ mpich openmpi-bin libopenmpi-dev libscalapack-mpi-dev vim git-core - sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -" - sudo add-apt-repository http://dl.openfoam.org/ubuntu - sudo apt-get update - export DEBIAN_FRONTEND=noninteractive - apt-get -y install openfoam7 - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - bash Miniconda3-latest-Linux-x86_64.sh -b - . ~/miniconda3/etc/profile.d/conda.sh - conda create -n libcantera python=3.8 - conda activate libcantera - conda install -c cantera libcantera-devel=2.6 - conda install -c cantera cantera - conda install pytorch pybind11 - conda install pkg-config - conda install --channel https://conda.anaconda.org/zhaofeng-shu33 easydict - git clone https://github.com/deepmodeling/deepflame-dev.git - cd deepflame-dev - - name: build and validation with CPU inference env: OMPI_ALLOW_RUN_AS_ROOT: 1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 OMPI_MCA_btl_vader_single_copy_mechanism: none run: - /bin/bash -c " echo $PWD && ls $PWD - && wget --content-disposition https://aisquare.oss-us-east-1.aliyuncs.com/data/datasets/14b50df5-dbe9-4f1c-bf58-032b8bc40a20 - && unzip flare_CH4_SandiaD_4D.zip + /bin/bash -c " echo $PWD && ls $PWD - && cp -r flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM + && cp -r ../data/flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc && . configure.sh --use_pytorch&& source ./bashrc && . install.sh && cd test && ./Allrun && conda deactivate " From 27d123c59c2d7d78118c970fed4cc1fa623306fd Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Mon, 19 May 2025 12:11:44 +0800 Subject: [PATCH 2/6] CI: Fix file tpath error. --- .github/workflows/CPU_inferencce_validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CPU_inferencce_validation.yml b/.github/workflows/CPU_inferencce_validation.yml index c9b23fa9..81dc9088 100644 --- a/.github/workflows/CPU_inferencce_validation.yml +++ b/.github/workflows/CPU_inferencce_validation.yml @@ -22,7 +22,7 @@ jobs: run: /bin/bash -c " echo $PWD && ls $PWD - && cp -r ../data/flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM + && cp -r /root/actions-runner-dev/data/flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc && . configure.sh --use_pytorch&& source ./bashrc && . install.sh && cd test && ./Allrun && conda deactivate " From 46e5c6e8d8da653c3112baaf69c39238dee4105a Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Mon, 19 May 2025 12:14:09 +0800 Subject: [PATCH 3/6] CI: Fix path error in the openfoam environment. --- .github/workflows/CPU_inferencce_validation.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CPU_inferencce_validation.yml b/.github/workflows/CPU_inferencce_validation.yml index 81dc9088..fe2381e3 100644 --- a/.github/workflows/CPU_inferencce_validation.yml +++ b/.github/workflows/CPU_inferencce_validation.yml @@ -23,9 +23,15 @@ jobs: /bin/bash -c " echo $PWD && ls $PWD && cp -r /root/actions-runner-dev/data/flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM - && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc - && . configure.sh --use_pytorch&& source ./bashrc && . install.sh - && cd test && ./Allrun && conda deactivate " + && source ~/miniconda3/etc/profile.d/conda.sh + && conda activate libcantera + && source /opt/OpenFOAM/OpenFOAM-7/etc/bashrc + && . configure.sh --use_pytorch + && source ./bashrc + && . install.sh + && cd test + && ./Allrun + && conda deactivate " - name: test run: | From e7232de31cff2618383e7bfc6e6a9f203f1d7e6e Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Mon, 19 May 2025 14:45:57 +0800 Subject: [PATCH 4/6] CI: Correct the path of the precompiled openfoam-7. --- .github/workflows/CPU_inferencce_validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CPU_inferencce_validation.yml b/.github/workflows/CPU_inferencce_validation.yml index fe2381e3..c41d2cd0 100644 --- a/.github/workflows/CPU_inferencce_validation.yml +++ b/.github/workflows/CPU_inferencce_validation.yml @@ -25,7 +25,7 @@ jobs: && cp -r /root/actions-runner-dev/data/flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera - && source /opt/OpenFOAM/OpenFOAM-7/etc/bashrc + && source /opt/openfoam7/etc/bashrc && . configure.sh --use_pytorch && source ./bashrc && . install.sh From d41d641740b1e84065f6ebe259aa9d10563aa74c Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Mon, 19 May 2025 14:49:47 +0800 Subject: [PATCH 5/6] CI: Fix path error for the tbl file. --- .github/workflows/CPU_inferencce_validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CPU_inferencce_validation.yml b/.github/workflows/CPU_inferencce_validation.yml index c41d2cd0..9b5834b8 100644 --- a/.github/workflows/CPU_inferencce_validation.yml +++ b/.github/workflows/CPU_inferencce_validation.yml @@ -22,7 +22,7 @@ jobs: run: /bin/bash -c " echo $PWD && ls $PWD - && cp -r /root/actions-runner-dev/data/flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM + && cp -r /root/actions-runner/data/flare_CH4_SandiaD_4D.tbl examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc From 464fc76fa72d6eaf077480a0efe6c14d0bc9fa27 Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Mon, 19 May 2025 18:29:21 +0800 Subject: [PATCH 6/6] CI: Use 12 cpus to run the test. - Fix shell script grammar error in SandiaD_flareFGM case. Now the tbl file won't be downloaded if there is a table file in the folder. --- examples/dfHighSpeedFoam/oneD_detonationH2/Allrun | 2 +- .../dfHighSpeedFoam/oneD_detonationH2/system/decomposeParDict | 2 +- examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM/Allrun | 2 +- test/Tu500K-Phi1/Allrun | 2 +- test/Tu500K-Phi1/system/decomposeParDict | 2 +- test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/Allrun | 2 +- .../twoD_reactingTGV/H2/cvodeSolver/system/decomposeParDict | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/dfHighSpeedFoam/oneD_detonationH2/Allrun b/examples/dfHighSpeedFoam/oneD_detonationH2/Allrun index 425a2e74..7a260c1f 100755 --- a/examples/dfHighSpeedFoam/oneD_detonationH2/Allrun +++ b/examples/dfHighSpeedFoam/oneD_detonationH2/Allrun @@ -10,4 +10,4 @@ cp -r 0_orig/ 0/ runApplication blockMesh runApplication setFields runApplication decomposePar -runApplication mpirun --oversubscribe -np 8 --allow-run-as-root $application -parallel +runApplication mpirun --oversubscribe -np 12 --allow-run-as-root $application -parallel diff --git a/examples/dfHighSpeedFoam/oneD_detonationH2/system/decomposeParDict b/examples/dfHighSpeedFoam/oneD_detonationH2/system/decomposeParDict index e183b65d..d36b16ef 100755 --- a/examples/dfHighSpeedFoam/oneD_detonationH2/system/decomposeParDict +++ b/examples/dfHighSpeedFoam/oneD_detonationH2/system/decomposeParDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 8; +numberOfSubdomains 12; method scotch; diff --git a/examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM/Allrun b/examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM/Allrun index 34d91d2a..f88fb7a9 100755 --- a/examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM/Allrun +++ b/examples/dfLowMachFoam/fgm/twoD_SandiaD_flareFGM/Allrun @@ -1,7 +1,7 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -if [ -e flare_CH4_SandiaD_4D.tbl] +if [ -e flare_CH4_SandiaD_4D.tbl ] then echo "flare_CH4_SandiaD_4D.tbl exists. Make sure correct table has been used!" else diff --git a/test/Tu500K-Phi1/Allrun b/test/Tu500K-Phi1/Allrun index a10c7d66..398559b0 100755 --- a/test/Tu500K-Phi1/Allrun +++ b/test/Tu500K-Phi1/Allrun @@ -8,7 +8,7 @@ application=dfLowMachFoam runApplication blockMesh runApplication decomposePar -runApplication mpirun -np 4 --allow-run-as-root $application -parallel +runApplication mpirun -np 12 --allow-run-as-root $application -parallel reconstructPar flameSpeed > log.fs sed -n 's/.*flameSpeed = \([0-9]*\(\.[0-9]*\)\?\).*/\1/p' log.fs > fs diff --git a/test/Tu500K-Phi1/system/decomposeParDict b/test/Tu500K-Phi1/system/decomposeParDict index 45c7f859..8ff550da 100755 --- a/test/Tu500K-Phi1/system/decomposeParDict +++ b/test/Tu500K-Phi1/system/decomposeParDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 4; +numberOfSubdomains 12; method scotch; diff --git a/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/Allrun b/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/Allrun index 2c015c2f..08d2d8d3 100755 --- a/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/Allrun +++ b/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/Allrun @@ -8,7 +8,7 @@ application=dfLowMachFoam runApplication blockMesh runApplication decomposePar -runApplication mpirun -np 4 $application -parallel +runApplication mpirun -np 12 $application -parallel runApplication reconstructPar runApplication postProcess -func sample diff --git a/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/system/decomposeParDict b/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/system/decomposeParDict index 45c7f859..8ff550da 100644 --- a/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/system/decomposeParDict +++ b/test/dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/system/decomposeParDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 4; +numberOfSubdomains 12; method scotch;