
ループを作成しfor
て並列化し、&
タスクを一度に実行できるようにしきい値を制限しました。3
以下は私のスクリプトです。私は命令で保存し32 cores
て256 GB
覚えていますBSUB
。sample_pipe
ループ内で実行するにはコアとメモリが必要です。for
32
256 GB
一部の操作でメモリエラーエラーが発生します。32
コアのみを保持し、タスクを一度だけ実行しよ256 GB
うとしているようですが、これによって一部のタスクではメモリエラーエラーが発生する可能性があります。3
3
私の質問は、すべてのタスクが同じ数のコアとメモリを使用するように並列化する方法です。
コマンドを使用して送信します。bsub < example.sh
#!/bin/bash
#BSUB -J cnt_job # LSF job name
#BSUB -o cnt_job.%J.out # Name of the job output file
#BSUB -e cnt_job.%J.error # Name of the job error file
#BSUB -n 32 # 32 cores
#BSUB -M 262144 # 256 GB
#BSUB -R "span[hosts=1] rusage [mem=262144]"
n=0
maxjobs=3
for sample in $main ; do
for run in $nested ; do
sample_pipe count --id="$run_name" \
--localcores=32 \
--localmem=256 &
done
cd ..
# limit jobs
if (( $(($((++n)) % $maxjobs)) == 0 )) ; then
wait # wait until all have finished
echo $n wait
fi
done