Skip to content

Commit 63c7939

Browse files
author
Archith Iyer
committed
fix changes to CI
1 parent 90198df commit 63c7939

File tree

6 files changed

+128
-139
lines changed

6 files changed

+128
-139
lines changed

.github/workflows/bench.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
steps:
1212
- name: Clone
1313
uses: actions/checkout@v4
14-
1514
- name: Detect Changes
1615
uses: dorny/paths-filter@v3
1716
id: changes
@@ -26,7 +25,7 @@ jobs:
2625
matrix:
2726
device: ['cpu', 'gpu']
2827
runs-on:
29-
group: phoenix
28+
group: phoenix
3029
labels: gt
3130
timeout-minutes: 1400
3231
env:
@@ -37,36 +36,35 @@ jobs:
3736
uses: actions/checkout@v4
3837
with:
3938
path: pr
40-
4139
- name: Clone - Master
4240
uses: actions/checkout@v4
4341
with:
4442
repository: MFlowCode/MFC
4543
ref: master
4644
path: master
4745

48-
- name: Bench (Master v. PR)
46+
- name: Bench (Master vs PR)
4947
run: |
50-
(cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
51-
(cd master && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }}) &
48+
(cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }} double) &
49+
(cd master && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }} double) &
5250
wait %1 && wait %2
5351
54-
(cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }} --single) &
55-
(cd master && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }} --single) &
56-
wait %3 && wait %4
52+
(cd pr && bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/bench.sh ${{ matrix.device }} single) &
53+
wait %3
5754
58-
- name: Generate & Post Comment
55+
- name: Check PR Single vs Double Precision
5956
run: |
60-
(cd pr && . ./mfc.sh load -c p -m g)
61-
(cd pr && ./mfc.sh bench_diff ../master/bench-${{ matrix.device }}.yaml ../pr/bench-${{ matrix.device }}.yaml)
62-
(cd pr && ./mfc.sh bench_diff ../master/bench-${{ matrix.device }}-single.yaml ../pr/bench-${{ matrix.device }}-single.yaml)
57+
# Compare single and double precision within the PR
58+
cd pr
59+
. ./mfc.sh load -c p -m ${{ matrix.device }}
60+
./mfc.sh bench_diff bench-${{ matrix.device }}-double.yaml bench-${{ matrix.device }}-single.yaml
61+
6362
- name: Archive Logs
6463
uses: actions/upload-artifact@v4
65-
if: always()
64+
if: always()
6665
with:
6766
name: logs-${{ matrix.device }}
6867
path: |
6968
pr/bench-${{ matrix.device }}.*
70-
pr/build/benchmarks/*
7169
master/bench-${{ matrix.device }}.*
72-
master/build/benchmarks/*
70+

.github/workflows/phoenix/bench.sh

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
11
#!/bin/bash
22

3+
job_device="${1}"
4+
job_precision="${2}"
5+
6+
if [ -z "$job_device" ] || [ -z "$job_precision" ]; then
7+
echo "Usage: $0 [cpu|gpu] [single|double]"
8+
exit 1
9+
fi
10+
311
n_ranks=12
12+
precision_flag=""
13+
14+
if [ "$job_precision" == "single" ]; then
15+
precision_flag="--single"
16+
fi
417

518
if [ "$job_device" == "gpu" ]; then
6-
n_ranks=$(nvidia-smi -L | wc -l) # number of GPUs on node
7-
gpu_ids=$(seq -s ' ' 0 $(($n_ranks-1))) # 0,1,2,...,gpu_count-1
19+
n_ranks=$(nvidia-smi -L | wc -l)
20+
gpu_ids=$(seq -s ' ' 0 $(($n_ranks-1)))
821
device_opts="--gpu -g $gpu_ids"
22+
else
23+
device_opts=""
924
fi
1025

11-
12-
if ["$job_device" == "gpu"]; then
13-
./mfc.sh bench --mem 12 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks $single_flag
14-
else
15-
./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks $single_flag
26+
mem_value=1
27+
if [ "$job_device" == "gpu" ]; then
28+
mem_value=12
1629
fi
30+
31+
./mfc.sh bench --mem $mem_value -j $(nproc) -o "bench-${job_device}-${job_precision}.yaml" -- $precision_flag -c phoenix $device_opts -n $n_ranks
32+
Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,59 @@
11
#!/bin/bash
22

3-
set -e
4-
3+
set -es
54
usage() {
6-
echo "Usage: $0 [script.sh] [cpu|gpu] [--single (optional)]"
5+
echo "Usage: $0 [script.sh] [cpu|gpu] [single|double]"
76
}
87

98
if [ ! -z "$1" ]; then
10-
sbatch_script_contents=`cat $1`
9+
script_path="$1"
1110
else
1211
usage
1312
exit 1
1413
fi
1514

16-
sbatch_cpu_opts="\
17-
#SBATCH -p cpu-small # partition
18-
#SBATCH --ntasks-per-node=24 # Number of cores per node required
19-
#SBATCH --mem-per-cpu=2G # Memory per core\
20-
"
21-
22-
sbatch_gpu_opts="\
23-
#SBATCH -C V100-16GB
24-
#SBATCH -G2\
25-
"
26-
2715
if [ "$2" == "cpu" ]; then
28-
sbatch_device_opts="$sbatch_cpu_opts"
16+
sbatch_device_opts="#SBATCH -p cpu-small
17+
#SBATCH --ntasks-per-node=24
18+
#SBATCH --mem-per-cpu=2G"
2919
elif [ "$2" == "gpu" ]; then
30-
sbatch_device_opts="$sbatch_gpu_opts"
20+
sbatch_device_opts="#SBATCH -C V100-16GB
21+
#SBATCH -G2"
3122
else
3223
usage
3324
exit 1
3425
fi
3526

36-
single_flag=""
37-
if [ "$3" == "--single" ]; then
38-
single_flag="--single"
27+
if [ "$3" != "single" ] && [ "$3" != "double" ]; then
28+
usage
29+
exit 1
3930
fi
4031

41-
job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2"
42-
43-
if [ "$single_flag" == "--single" ]; then
44-
job_slug="${job_slug}-single"
45-
fi
32+
job_device="$2"
33+
job_precision="$3"
34+
job_slug="$(basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g')-$job_device-$job_precision"
4635

4736
sbatch <<EOT
4837
#!/bin/bash
4938
#SBATCH -Jshb-$job_slug # Job name
5039
#SBATCH --account=gts-sbryngelson3 # Charge account
5140
#SBATCH -N1 # Number of nodes required
5241
$sbatch_device_opts
53-
#SBATCH -t 02:00:00 # Duration of the job (Ex: 15 mins)
42+
#SBATCH -t 02:00:00 # Duration of the job
5443
#SBATCH -q embers # QOS Name
55-
#SBATCH -o $job_slug.out # Output file
56-
#SBATCH -W # Wait for the job to finish
44+
#SBATCH -o $job_slug-$job_precision.out # Include precision in the log file
45+
#SBATCH -W # Do not exit until the submitted job terminates.
5746
5847
set -e
5948
set -x
6049
6150
cd "\$SLURM_SUBMIT_DIR"
6251
echo "Running in \$(pwd):"
6352
64-
job_slug="$job_slug"
65-
job_device="$2"
66-
single_flag="$single_flag"
67-
68-
. ./mfc.sh load -c p -m $2
69-
70-
$sbatch_script_contents
53+
# Load necessary modules
54+
. ./mfc.sh load -c p -m \$job_device
7155
56+
# Execute the script with arguments
57+
bash $script_path "\$job_device" "\$job_precision"
7258
EOT
59+

src/common/m_derived_types.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module m_derived_types
8686
real(wp), dimension(num_fluids_max) :: alpha_rho_in, alpha_in
8787
logical :: grcbc_in, grcbc_out, grcbc_vel_out
8888

89-
end type int_bounds_info
89+
end type int_bounds_info
9090

9191
!> Derived type adding beginning (beg) and end bounds info as attributes
9292
type bounds_info

0 commit comments

Comments
 (0)