Sponsored Content
Top Forums Shell Programming and Scripting Qsub + job array + while read; do; done Post 303014288 by Chubler_XL on Thursday 8th of March 2018 03:05:44 PM
Old 03-08-2018
It's not entirely clear what you are after here. Can you show us a worked example if list file contained 3 lines like this

Code:
harry
bob
mary

For example you may want -t value incremented for each line something like this:

Code:
   echo "harry" | qsub -N loop -t 1
   echo "bob"   | qsub -N loop -t 2 
   echo "mary"  | qsub -N loop -t 3


Last edited by Chubler_XL; 03-08-2018 at 04:11 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read input file for batch job

hi all, I am a newbie in unix shell script. May I know how to write a bacth job to read a list of files afrom the inout file and do the chmod ? Thanks. i.e. inside input.txt ==== a.txt b.txt c.txt and I want to write a batch job to read the input .txt and do the chmod 755 for all 3... (14 Replies)
Discussion started by: kinmak
14 Replies

2. Shell Programming and Scripting

how to read a var value into array

Hi I need to read a value of the variable into array so each character/digit will become an array element,for example: A=147921231432545436547568678679870 The resulting array should hold each digit as an element. Thanks a lot for any help -A (7 Replies)
Discussion started by: aoussenko
7 Replies

3. Shell Programming and Scripting

Read array from a file

Hi I've a config file like: file1 #comment k_array: 1 2 3 4 5 n_array: 7 8 9 0 11 I'd like to write a script that read it and store k_array and n_array in 2 arrays. I mean the script should be able to use both as array. I've tried to use awk as (only for one array): ... (5 Replies)
Discussion started by: Dedalus
5 Replies

4. Shell Programming and Scripting

cron job issue..i hav read the basic threads already...

hi friends well m facing a different sort of issue in my cron. i hav set job like this 30 09 * * 1 /bin/backup14M 01 14 * * 1 /bin/backup14N 20 18 * * 1 /bin/backup14E that is for every Monday at three different times. but, first job executes well, later ones do not. I checked my... (13 Replies)
Discussion started by: oracle.test2
13 Replies

5. Shell Programming and Scripting

qsub

Hey all, I have a binary file, named "exe1" that receives a parameter. (I don't have its source code). Executing "exe1" results in creating 3 output files. I have a bash script that runs "exe1". I want to enter "exe1" to cluster queue (using subq command) But i want to do it more than... (1 Reply)
Discussion started by: elad2109
1 Replies

6. UNIX for Advanced & Expert Users

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... (0 Replies)
Discussion started by: cliffyiu
0 Replies

7. UNIX for Dummies Questions & Answers

Qsub and printf

Hello, I have some issue with qsub and the standard output : I launch a script that "echoes" the string "abc" and then executes a C program in which I print informations with the printf function ; the .o file contains "abc" but not the information displayed by printf. I also tried... (0 Replies)
Discussion started by: Shaderw
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. Shell Programming and Scripting

PERL : Read an array and write to another array with intial string pattern checks

I have an array and two variables as below, I need to check if $datevar is present in $filename. If so, i need to replace $filename with the values in the array. I need the output inside an ARRAY How can this be done. Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
2 Replies

10. Programming

C++ how would you read this file into an array.

here is the pesudo file. REREREEEEEERRRREER SOMEStrinG1234 RERRRR EEERRRREER SOMEStrinG1224 REREREEEREERRR REE SOMEStrinG1214 REREREREREREREEEER SOMEStrinG1204 RERE EEEEEERRRRRRR SOMEStrinG1294 REREEREEE ERRRREER SOMEStrinG1284 REREREEEEEERR REER here is my attempted code #include... (3 Replies)
Discussion started by: briandanielz
3 Replies
drmaa_submit(3) 					       Sun Grid Engine DRMAA						   drmaa_submit(3)

NAME
drmaa_run_job, drmaa_run_bulk_jobs, drmaa_get_next_job_id, drmaa_get_num_job_ids, drmaa_release_job_ids - Job submission SYNOPSIS
#include "drmaa.h" int drmaa_run_job( char *job_id, size_t job_id_len, drmaa_job_template_t *jt, char *error_diagnosis, size_t error_diag_len ); int drmaa_run_bulk_jobs( drmaa_job_ids_t **jobids, drmaa_job_template_t *jt, int start, int end, int incr, char *error_diagnosis, size_t error_diag_len ); int drmaa_get_next_job_id( drmaa_job_ids_t* values, char *value, int value_len ); int drmaa_get_num_job_ids( drmaa_job_ids_t* values, int *size ); void drmaa_release_job_ids( drmaa_job_ids_t* values ); DESCRIPTION
drmaa_run_job() submits an Sun Grid Engine job with attributes defined in the DRMAA job template, jt. On success up to job_id_len bytes of the job identifier are returned into the buffer, job_id. drmaa_run_bulk_jobs() The drmaa_run_bulk_jobs() submits a Sun Grid Engine array job very much as if the qsub(1) option `-t start-end:incr' had been used along with the additional attributes defined in the DRMAA job template, jt. The same constraints regarding value ranges are also in effect for the parameters start, end, and incr as for qsub(5) -t. On success a DRMAA job id string vector containing job identifiers for each array job task is returned into jobids. The job identifiers in the job id string vector can be extracted using drmaa_get_next_job_id(3). The number of identifiers in the job id string vector can be determined using drmaa_get_num_job_ids(3). Note that this function is only avail- able in the 1.0 implementation. The caller is responsible for releasing the job id string vector returned into jobids using drmaa_release_job_ids(3). drmaa_get_next_job_id() Each time drmaa_get_next_job_id() is called it returns into the buffer, value, up to value_len bytes of the next entry stored in the DRMAA job id string vector, values. Once the job ids list has been exhausted, DRMAA_ERRNO_NO_MORE_ELEMENTS is returned. drmaa_get_num_job_ids() The drmaa_get_num_job_ids() returns into size the number of entries in the DRMAA job ids string vector. This function is only available in the 1.0 implementation. drmaa_release_job_ids() The drmaa_release_attr_job_id() function releases all resources associated with the DRMAA job id string vector, values. This operation has no effect on the actual Sun Grid Engine array job tasks. ENVIRONMENTAL VARIABLES
SGE_ROOT Specifies the location of the Sun Grid Engine standard configuration files. SGE_CELL If set, specifies the default Sun Grid Engine cell to be used. To address a Sun Grid Engine cell Sun Grid Engine uses (in the order of precedence): The name of the cell specified in the environment variable SGE_CELL, if it is set. The name of the default cell, i.e. default. SGE_DEBUG_LEVEL If set, specifies that debug information should be written to stderr. In addition the level of detail in which debug infor- mation is generated is defined. SGE_QMASTER_PORT If set, specifies the tcp port on which sge_qmaster(8) is expected to listen for communication requests. Most installations will use a services map entry instead to define that port. RETURN VALUES
Upon successful completion, drmaa_run_job(), drmaa_run_bulk_jobs(), and drmaa_get_next_job_id() return DRMAA_ERRNO_SUCCESS. Other values indicate an error. Up to error_diag_len characters of error related diagnosis information is then provided in the buffer error_diagnosis. ERRORS
The drmaa_run_job(), drmaa_run_bulk_jobs(), and drmaa_get_next_job_id() will fail if: DRMAA_ERRNO_INTERNAL_ERROR Unexpected or internal DRMAA error, like system call failure, etc. DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE Could not contact DRM system for this request. DRMAA_ERRNO_AUTH_FAILURE The specified request is not processed successfully due to authorization failure. DRMAA_ERRNO_INVALID_ARGUMENT The input value for an argument is invalid. DRMAA_ERRNO_NO_ACTIVE_SESSION Failed because there is no active session. DRMAA_ERRNO_NO_MEMORY Failed allocating memory. The drmaa_run_job() and drmaa_run_bulk_jobs() functions will fail if: DRMAA_ERRNO_TRY_LATER The DRM system indicated that it is too busy to accept the job. A retry may succeed, however. DRMAA_ERRNO_DENIED_BY_DRM The DRM system rejected the job. The job will never be accepted due to DRM configuration or job template settings. The drmaa_get_next_job_id() will fail if: DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE When there are no more entries in the vector. SEE ALSO
drmaa_attributes(3), drmaa_jobtemplate(3). SGE 6.2u5 $Date$ drmaa_submit(3)
All times are GMT -4. The time now is 12:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy