Skip to content

Commit

Permalink
Merge branch 'vof' of github.com:IFDL-WSU/incflo-vof into vof
Browse files Browse the repository at this point in the history
  • Loading branch information
Hua Tan committed Sep 14, 2024
2 parents 1fc9cde + 2eb52b8 commit b403956
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 350 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/cleanup-cache-postpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
CleanUpCcacheCachePostPR:
name: Clean Up Ccahe Cache Post PR
name: Clean Up Ccache Cache Post PR
runs-on: ubuntu-latest
permissions:
actions: write
Expand All @@ -17,21 +17,27 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Clean up ccahe
- name: Clean up ccache
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
gh run download ${{ github.event.workflow_run.id }} -n pr_number
pr_number=`cat pr_number.txt`
# For debugging cat ${GITHUB_EVENT_PATH} to see the payload.
pr_head_sha=${{ github.event.workflow_run.head_sha }}
pr_number=$(gh pr list --state all --search $pr_head_sha --json number --jq '.[0].number')
echo "Post-PR cache cleanup for PR ${pr_number}"
BRANCH=refs/pull/${pr_number}/merge
# Setting this to not fail the workflow while deleting cache keys.
set +e
keys=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH | cut -f 1)
# $keys might contain spaces. Thus we set IFS to \n.
IFS=$'\n'
for k in $keys
do
gh actions-cache delete $k -R $REPO -B $BRANCH --confirm
gh actions-cache delete "$k" -R $REPO -B $BRANCH --confirm
done
unset IFS
25 changes: 16 additions & 9 deletions .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
CleanUpCcacheCache:
name: Clean Up Ccahe Cache for ${{ github.event.workflow_run.name }}
name: Clean Up Ccache Cache for ${{ github.event.workflow_run.name }}
runs-on: ubuntu-latest
permissions:
actions: write
Expand All @@ -17,7 +17,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Clean up ccahe
- name: Clean up ccache
run: |
gh extension install actions/gh-actions-cache
Expand All @@ -27,11 +27,14 @@ jobs:
EVENT=${{ github.event.workflow_run.event }}
# Triggering workflow run name (e.g., LinuxClang)
WORKFLOW_NAME=${{ github.event.workflow_run.name }}
WORKFLOW_NAME="${{ github.event.workflow_run.name }}"
# For debugging, cat ${GITHUB_EVENT_PATH} to see the payload.
if [[ $EVENT == "pull_request" ]]; then
gh run download ${{ github.event.workflow_run.id }} -n pr_number
pr_number=`cat pr_number.txt`
pr_head_sha=${{ github.event.workflow_run.head_sha }}
pr_number=$(gh pr list --search $pr_head_sha --json number --jq '.[0].number')
echo "Clean up cache for PR ${pr_number}"
BRANCH=refs/pull/${pr_number}/merge
else
BRANCH=refs/heads/${{ github.event.workflow_run.head_branch }}
Expand All @@ -45,16 +48,20 @@ jobs:
# The goal is to keep the last used key of each job and delete all others.
# something like ccache-LinuxClang-
keyprefix=ccache-${WORKFLOW_NAME}-
keyprefix="ccache-${WORKFLOW_NAME}-"
cached_jobs=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH --key $keyprefix | awk -F '-git-' '{print $1}' | sort | uniq)
cached_jobs=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH --key "$keyprefix" | awk -F '-git-' '{print $1}' | sort | uniq)
# cached_jobs is something like "ccache-LinuxClang-configure-1d ccache-LinuxClang-configure-2d".
# It might also contain spaces. Thus we set IFS to \n.
IFS=$'\n'
for j in $cached_jobs
do
old_keys=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH --key ${j}-git- --sort last-used | cut -f 1 | tail -n +2)
# Delete all entries except the last used one
old_keys=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH --key "${j}-git-" --sort last-used | cut -f 1 | tail -n +2)
for k in $old_keys
do
gh actions-cache delete $k -R $REPO -B $BRANCH --confirm
gh actions-cache delete "$k" -R $REPO -B $BRANCH --confirm
done
done
unset IFS
15 changes: 0 additions & 15 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,3 @@ jobs:
ccache -s
du -hs ~/.cache/ccache
save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
15 changes: 0 additions & 15 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,3 @@ jobs:
export OMP_NUM_THREADS=2
cd ${{ github.workspace }}/incflo
build/incflo.ex test_no_eb_2d/benchmark.bouss_bubble_god max_step=10 incflo.verbose=1 mac_proj.verbose=1 nodal_proj.verbose=1
save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
15 changes: 0 additions & 15 deletions .github/workflows/hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,3 @@ jobs:
ccache -s
du -hs ~/.cache/ccache
save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
18 changes: 7 additions & 11 deletions .github/workflows/post-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ on:
types:
- closed

# This workflow does not have the permission to clean up cache for PRs
# originated from a fork. The purpose here is to trigger a workflow_run
# cleanup-cache-postpr.yml that has the right permission.

jobs:
cleanup:
noop:
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
- name: No OP
run: echo "This workflow is going to trigger CleanUpCachePostPR."
15 changes: 0 additions & 15 deletions .github/workflows/sycl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,3 @@ jobs:
ccache -s
du -hs ~/.cache/ccache
save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
32 changes: 18 additions & 14 deletions src/boundary_conditions/README.org
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
* fillpatch

| | pi | po | mi | nsw | sw | dir_dep |
|--------+----------+----------+----------+-------------+---------------------------------------|-----------------------
| v_n | foextrap | foextrap | ext_dir | ext_dir (0) | ext_dir (0) | ext_dir if inflowing |
| v_t | foextrap | foextrap | ext_dir | ext_dir (0) | hoextrap | ext_dir if inflowing |
| rho | foextrap | foextrap | ext_dir | foextrap | if (advection_type == "BDS") foextrap | ext_dir if inflowing |
| | | | | | else hoextrap | ext_dir if inflowing |
| scalar | foextrap | foextrap | ext_dir | foextrap | if (advection_type == "BDS") foextrap | ext_dir if inflowing |
| | | | | | else hoextrap | ext_dir if inflowing |
| force | foextrap | foextrap | foextrap | foextrap | foextrap | foextrap |
| | pi | po | mi | nsw | sw | dir_dep |
|--------+----------+----------+----------+----------------------+---------------------------------------|-----------------------
| v_n | foextrap | foextrap | ext_dir | ext_dir (0) | ext_dir (0) | ext_dir if inflowing |
| | | | | | | foextrap otherwise |
| v_t | foextrap | foextrap | ext_dir | ext_dir (0) | hoextrap | ext_dir if inflowing |
| | | | | | | foextrap otherwise |
| rho | foextrap | foextrap | ext_dir | foextrap | if (advection_type == "BDS") foextrap | ext_dir if inflowing |
| | | | | | else hoextrap | foextrap otherwise |
| tracer | foextrap | foextrap | ext_dir | ext_dir if specified | ext_dir if specified, otherwise | ext_dir if inflowing |
| | | | | foextrap otherwise | if (advection_type == "BDS") foextrap | foextrap otherwise |
| | | | | | else hoextrap | |
| force | foextrap | foextrap | foextrap | foextrap | foextrap | foextrap |

* projection

Expand All @@ -25,8 +28,9 @@

* scalar diffusion

| pi | po | mi | nsw | sw | dir_dep |
|---------+---------+-----------+---------+---------|------------
| Neumann | Neumann | Dirichlet | Neumann | Neumann | Dirichlet |
| Neumann | Neumann | Dirichlet | Neumann | Neumann | Dirichlet |

| | pi | po | mi | nsw | sw | dir_dep |
|---------+---------+---------+-----------+------------------------+------------------------|------------
| v_n | Neumann | Neumann | Dirichlet | Dirichlet | Dirichlet | Dirichlet |
| v_t | Neumann | Neumann | Dirichlet | Dirichlet | Neumann | Dirichlet |
| tracer | Neumann | Neumann | Dirichlet | Dirchelet if specified | Dirichlet if specified | Dirichlet |
| | | | | Neumann otherwise | Neumann otherwise | |
Loading

0 comments on commit b403956

Please sign in to comment.