how to qsub jobs to the cluster from the parent directory for the subdirectories

余生长醉 提交于 2020-01-06 20:14:11

问题


I have difficulties in submitting my jobs from the parent directory in Linux. Assume that in my parent directory, I do have 1000 sub directories named 1,2,3 ...., 1000 in all of which there is a submission script submit.sh. Rather than going to each subdirectory and qsub individually which of course takes a huge time of mine, I need to qsub all scripts from the parent directory such that all calculations and outputs will be dumped out in the corresponding subdirectoy. is there any way to do so?

I do appreciate your help.


回答1:


How about a shell script?

If you just need to run each submit.sh, then this should do what you're asking in bash:

for i in {1..1000}; do
  cd "$i"
  ./submit.sh
  cd ..
done

Or if you need to pass them as an argument to something, e.g. qsub, then just add whatever you need, for example:

for i in {1..1000}; do
  cd "$i"
  qsub submit.sh
  cd ..
done


来源:https://stackoverflow.com/questions/35839749/how-to-qsub-jobs-to-the-cluster-from-the-parent-directory-for-the-subdirectories

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