计算化学公社
标题:
多核机器如何一次性同时提交多个单核任务?
[打印本页]
作者Author:
让你变成回忆
时间:
2020-8-15 10:58
标题:
多核机器如何一次性同时提交多个单核任务?
请教大家,现在有上千个任务需要提交,每个采用单个core计算,计算机总共有28个core,应该怎么写脚本让每次只算28个?
作者Author:
puzhongji
时间:
2020-8-15 11:08
http://bbs.keinsci.com/thread-1433-1-1.html
作者Author:
snljty
时间:
2020-8-15 12:43
本帖最后由 snljty 于 2021-12-13 20:29 编辑
#! /bin/bash
ntasks=1000
ncores=28
itask=0
icore=0
while [[ $itask -ne $ntasks ]]
do
cd mytask_$itask
myprog myargv1 myargv2 &
cd ..
sleep 1
icore=$((icore+1))
if [[ $icore -eq $ncores ]]
then
icore=0
wait
sleep 2
fi
itask=$((itask+1))
done
wait
复制代码
刚发现这个贴,把上次的示例贴上来吧,不一定是很好的方法,但是能用。
作者Author:
abin
时间:
2020-8-15 22:02
用调度系统。
欢迎光临 计算化学公社 (http://bbs.keinsci.com/)
Powered by Discuz! X3.3