22 lines
958 B
Bash
22 lines
958 B
Bash
#!/bin/bash
|
|
# parallel_batch.sh — 并发批量12维重评(分片+key池偏移+统一flush)
|
|
# 用法: bash parallel_batch.sh [N] [type]
|
|
# N=worker数(默认4) type=holding|watchlist|all(默认all)
|
|
N=${1:-6} # 2026-08-24 4→6: OCG router 6 key 用满(concurrent=True round-robin防撞)
|
|
TYPE=${2:-all}
|
|
cd /home/hmo/MoFin/deploy/profile-scripts
|
|
echo "[parallel] launching $N workers (type=$TYPE) at $(date '+%F %T')"
|
|
pids=()
|
|
for ((k=0; k<N; k++)); do
|
|
SKIP_FLUSH=1 LLM_KEY_OFFSET=$k python3 batch_reassess.py --type "$TYPE" --shard "$k/$N" \
|
|
> "/tmp/reassess_parallel_w$k.log" 2>&1 &
|
|
pids+=($!)
|
|
echo "[parallel] worker $k pid=${pids[$k]}"
|
|
done
|
|
for p in "${pids[@]}"; do wait "$p"; done
|
|
echo "[parallel] all workers done at $(date '+%F %T')"
|
|
# 统一推荐摘要(防各worker半成品)
|
|
python3 -c "from mofin_db import flush_rec_digest; flush_rec_digest()"
|
|
echo "[parallel] digest flushed"
|
|
grep -h "^完成:" /tmp/reassess_parallel_w*.log
|