LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2010, 11:25 AM   #1
cliffyao
LQ Newbie
 
Registered: Oct 2009
Posts: 27

Rep: Reputation: 15
How to set the SGE job execution order


Dear All

I am trying to write a script to set the SGE job execution order. I named each job with 'job1', 'job2' and 'job3'. I want my script to do: When 'job1' execution is complete, 'job2' is executed; when both 'job1' and 'job2' are complete, 'job3' is executed.

First, I tried this following script and it worked well:

########
qsub -N job1 run1.sh # run1.sh includes "mv file_name1 file_name2"
qsub -N job2 -hold_jid job1 run2.sh # run2.sh includes "mv file_name2
file_name3"
########

Then, I changed "run1.sh" to

#######
qsub -N job1_1 run1_1.sh
qsub -N job1_2 run1_2.sh
#######

it is just a nested qsub

I re-ran
####################################
qsub -N job1 run1.sh
qsub -N job2 -hold_jid job1 job1_1 job1_2 run2.sh
####################################
and job1 and job2 were submitted but I also got this error message:
"Unable to read script file because of error: error opening job1_1: No such file or directory"

My question is, how to deal with this kinda of nested qsub?

All your help will be greatly appreciated.
 
Old 10-16-2010, 11:46 PM   #2
mpiro
LQ Newbie
 
Registered: Oct 2010
Posts: 1

Rep: Reputation: 0
you can use a nested syntax like this:

>cat job1.sge
#$ -S /bin/sh
#$ -N command1
./doCommand1

>cat job2.sge
#$ -S /bin/sh
#$ -N command2
#$ -hold_jid command1
./doCommand2

>cat job3.sge
#$ -S /bin/sh
#$ -N command3
#$ -hold_jid command2
./doCommand3

mp
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please Help. I have to learn Linux Networking in order to get my dream Job...I danhmiller Linux - Newbie 6 07-15-2010 11:23 AM
[SOLVED] Can I set the cups output order to always print in reverse order Thane Ubuntu 2 12-06-2009 07:57 AM
guaranteed scheduled job execution Xstack Programming 4 02-15-2005 11:30 PM
How do I Set MySQL Max Query Execution Time? farmerjoe Linux - General 1 01-26-2005 02:12 PM
Set-up order ?? Justinw Linux - Networking 3 04-20-2001 03:06 AM


All times are GMT -5. The time now is 06:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration