-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDenoising.sh
More file actions
executable file
·44 lines (39 loc) · 1.19 KB
/
Denoising.sh
File metadata and controls
executable file
·44 lines (39 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Create an array to hold process ids (PIDs)
PIDS=()
# Capture the SIGINT signal and define the handler
trap 'handle_interrupt' INT
handle_interrupt() {
echo "Interrupt signal received. Terminating all subprocesses..."
for pid in "${PIDS[@]}"; do
kill -9 $pid 2>/dev/null
done
exit 1
}
CASES=(1 2 3 4 5)
GPUS=(0 1 2 3 0)
# 循环遍历 cases 和 gpus 数组
for i in "${!CASES[@]}"; do
export CUDA_VISIBLE_DEVICES=${GPUS[$i]}
# python FNorm4DCmallDenoising.py --save --case="${CASES[$i]}" &
# python FNorm4PaviaUDenoising.py --case="${CASES[$i]}" &
python FNorm4CAVEDenoising.py --save --case="${CASES[$i]}" &
# 复现
# python Demos/LRTFR/LRTFR_Denoising.py --save --case="${CASES[$i]}" &
# ablation
# python ablation/Denoising.py --case="${CASES[$i]}" &
# python ablation/Denoising4kappa.py --case="${CASES[$i]}" &
# 保存进程ID
PIDS+=($!)
done
# Wait for all background tasks to complete and check for any failed tasks
FAIL=0
for pid in "${PIDS[@]}"; do
wait $pid || let "FAIL+=1"
done
# Check for failed tasks
if [ "$FAIL" -gt 0 ]; then
echo "Some tasks failed."
exit 1
else
echo "All tasks completed successfully."
fi