How to set the SGE job execution order for nested qsub?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to set the SGE job execution order for nested qsub?
# 1  
Old 06-22-2010
How to set the SGE job execution order for nested qsub?

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:
Code:
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
Code:
qsub -N job1_1 run1_1.sh
qsub -N job1_2 run1_2.sh

it is just a nested qsub

I re-ran
Code:
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:
Code:
"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.

Last edited by Yogesh Sawant; 06-23-2010 at 07:08 AM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Submit a qsub script SGE

Hello, I'm working on a SGE cluster and trying to echo the variables passed to the qsub command. My script is as follows #!/bin/bash #$ -V #$ -cwd #$ -pe make 10 if ; then echo "Variable is not set" else echo "Variable says: $StatedUserName" fi and I run the... (1 Reply)
Discussion started by: nans
1 Replies

2. Shell Programming and Scripting

Qsub + job array + while read; do; done

Linux Server Hi! just some help... I'm using a "Sun Grid Engine" with "qsub" In one hand I have this code while read -r H; do echo ${H}; done < list The number of the lines in the list file is 100. On the other hand I want to create a job array with the option -t echo... (3 Replies)
Discussion started by: echo manolis
3 Replies

3. Shell Programming and Scripting

Order of execution of instructions in a script shell

Hi all, Here is a portion of my script test.sh: #!/bin/bash tar -cf $name.tar $name && pbzip2 $name.tar 2-Sending .tar.bz2 to destination node Please, i have a question. The execution of the second instruction is done, but i do not see the result of pbzip2 I have to send this... (2 Replies)
Discussion started by: chercheur111
2 Replies

4. Shell Programming and Scripting

Script Execution Order

Hi, I have two scripts which are mentioned in execute.sh more execute.sh ./script1.sh //line 1 should not return error ./script2.sh //line 2 may return error ./script2.sh //line 3 should not return error Condition: I want script1.sh to complete before starting script2.sh... (1 Reply)
Discussion started by: mohtashims
1 Replies

5. UNIX for Advanced & Expert Users

Order of execution seem to be reversed with pipe

Hello I am seeing a weird behavior during the execution of the shell program. The shell programs loops through a file which has a list of files. for each file the programs cats the file, pipes the output to sed command and then on to an awk program. But while execution, the order of... (3 Replies)
Discussion started by: vamxdir
3 Replies

6. Shell Programming and Scripting

Multiple Interval cron issue with order of execution

55,0 5,6 * * * myScript This cron task will execute on 5:00AM, 5:55AM, 6:00AM and 6:55AM. Is there any possibility to make it run only in the order specified such as 5:55AM and 6:00AM (basically only on the 2 intervals) ? (1 Reply)
Discussion started by: vikram3.r
1 Replies

7. Shell Programming and Scripting

Perl- Nested 'for' order change

Hello, I'm quite new to perl so my question is rather basic and I know there is probably a simple way around it but I can't seem to find it. I have a medium-length code and there is a part that works with a nested for loop: foreach my $j(@primpiddelta){ for (my $k=1;... (0 Replies)
Discussion started by: acsg
0 Replies

8. UNIX for Advanced & Expert Users

Collecting job id from qsub command

Hello. Hopefully this is the right forum, did a search and found some similar questions here. I'm trying to find out if there is a way to get the job id while submitting a job using qsub. I want to monitor the list of active jobs using qstat and when my jobid is no longer on the active list, I... (3 Replies)
Discussion started by: aeoleon88
3 Replies

9. Solaris

Program execution order like FIFO queue

Hi all: I have a problem with a C++ service runing on solaris 10. This service only set a signal on oracle table. When the service detect a cut off on the line (tcp/ip), trigger a cobol program for set the signal OFF. When the line is on again, the service trigger the same cobol program for set... (0 Replies)
Discussion started by: hcastellani
0 Replies

10. HP-UX

ServiceGuard mounting nested file systems in wrong order

Hi all. I am having an issue and I'm not sure if anyone here would know the answer but I thought I'd ask anyway. The problem is with ServiceGuard where the control file lists the file systems to mount in a sequential order but ServiceGuard is mounting them as it feels like it. This is especially... (3 Replies)
Discussion started by: keelba
3 Replies
Login or Register to Ask a Question