-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_code.sh
More file actions
32 lines (28 loc) · 909 Bytes
/
run_code.sh
File metadata and controls
32 lines (28 loc) · 909 Bytes
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
#!/bin/bash
# 定义参数数组
params=(0 0.4 0.8 1.2 1.6 2.0)
# kappa_list=(0.06283 0.2618 0.46077 0.65973 0.8587 1.05767 1.25664)
qubit_num=(2 3 4 5 6)
action_sigma=(0 0.004 0.008 0.012 0.016 0.02)
# 设置最大并行进程数
# max_parallel=5
# 文件名
fname=("PPO MultiQubitGHZ.py")
# 遍历参数数组中的每个值
for f in "${fname[@]}"; do
for p in "${action_sigma[@]}"; do
echo "Running $f with --action_sigma $p --noise 0.1"
python "$f" --action_sigma "$p" --noise 0.2 --qubit_num 2&
# echo "Running $f with --noise $p"
# python "$f" --noise "$p" &
# sleep 20
# # 如果当前后台进程数达到上限,等待任一进程结束
# while (( $(jobs -p | wc -l) >= max_parallel )); do
# sleep 1
# done
done
# 等待所有后台进程结束
wait
done
# 等待所有后台进程结束
# wait