Multiprocessing with Screen and Bash

≯℡__Kan透↙ 提交于 2019-12-05 15:00:58

With bash I imagine you're doing something like this (assuming /home is under network mount):

#!/bin/bash    

for i in {1..$NUM_NODES}
do
    ssh node$i 'python /home/ryan/my_script.py' &
done

Launching this script from behind a single screen will work fine. Starting up several sessions of screen provides no performance gains but adds in the extra complication of starting multiple screens.

Keep in mind that there are much better ways to distribute load across a cluster (e.g. if someone else is using up all of node7 you'd want a way to detect that and send your job elsewhere). Most clusters I've worked with have Torque, Maui or the qsub command installed. I suggest giving those a look.

I would think they are about the same. I would prefer screen just because I have an easier time managing it. Depending on the scripts usage, that could also have some effect on time to process.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!