批量提交作业的shell脚本

编程入门 行业动态 更新时间:2024-10-10 07:31:58

批量提交<a href=https://www.elefans.com/category/jswz/34/1771149.html style=作业的shell脚本"/>

批量提交作业的shell脚本

目的:将多个作业提交到不同的计算节点上。

#首先确定好哪些节点可用,然后更改下面的代码

#Define the number-1 of the first visit folder(framenum)
framenum=24
for nodeid in `seq 1 5` 8 10 11 `seq 14 18` `seq 23 29` `seq 31 34` 12 19 42 43
#for nodeid in 41 13 9 7 12
do
    #let num+=1
    framenum=`expr $framenum + 1`
    if [ -d /home3/maoruichao/dynamics/1nkz/revision/temp_diff/sec_330k/image_1000ns/spectrum_last100ns_100frames/3_g16_coup/330k_$framenum/bcl_addh_gjf ]
    then
        #Define the number of the last visit folder
        if [ $framenum -le 100 ]
        then
            process=`unode | grep "n$nodeid " | awk '{printf $2 "\n"}'`
            echo "The process number of node $nodeid is $process"
            if [ $process == 0 ]
            then
                ssh n$nodeid "cd /home3/maoruichao/dynamics/1nkz/revision/temp_diff/sec_330k/image_1000ns/spectrum_last100ns_100frames/3_g16_coup/330k_$framenum/bcl_addh_gjf;nohup sh rung16.sh > rung16.out 2>&1 &"
                echo "Job $framenum has running on node $nodeid..."
            else
                echo "node$nodeid is not empty! continue to next one"
                framenum=`expr $framenum - 1`
                continue
            fi
        else
            echo "$framenum is equal to 101! break now"
            break
        fi
    else
        echo ""/home3/maoruichao/dynamics/1nkz/revision/temp_diff/sec_330k/image_1000ns/spectrum_last100ns_100frames/3_g16_coup/330k_$framenum/bcl_addh_gjf" is not exsist! break now"
        break
    fi
done
 

更多推荐

批量提交作业的shell脚本

本文发布于:2024-02-12 00:24:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1684577.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:作业   批量   脚本   shell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!