This function takes either a character vector or a numeric one as input. It can be used with the list of jobs that failed from qstat (like those in Eqw status) to find which tasks IDs need to be re-submitted for a given array job.

parse_task_ids(task_ids)

parse_task_ids_builder(task_ids_char)

Arguments

task_ids

Either a character vector taken from the qstat output or with a numeric input.

task_ids_char

A character vector of task IDs that is not SGE-ready yet.

Value

A character vector with SGE-ready task ids to submit using array_submit.

Author

Leonardo Collado-Torres

Examples


## This is an example true output from "qstat | grep Eqw"
## 7770638 0.50105 compute_we lcollado     Eqw   08/16/2019 14:57:25                                    1 225001-225007:1,225009-225017:2,225019-225038:1,225040,225043,225047,225049
## parse_task_ids() can then take as input the list of task ids that failed
parse_task_ids("225001-225007:1,225009-225017:2,225019-225038:1,225040,225043,225047,225049")
#> [1] "225001-225007:1" "225009-225017:2" "225019-225038:1" "225040-225040"  
#> [5] "225043-225043"   "225047-225047"   "225049-225049"  

## Or it could be split across two, though the result will be identical
parse_task_ids(c("225001-225007:1,225009-225017:2", "225019-225038:1,225040,225043,225047,225049"))
#> [1] "225001-225007:1" "225009-225017:2" "225019-225038:1" "225040-225040"  
#> [5] "225043-225043"   "225047-225047"   "225049-225049"  

## While this works
parse_task_ids(1:10)
#>  [1] "1-1"   "2-2"   "3-3"   "4-4"   "5-5"   "6-6"   "7-7"   "8-8"   "9-9"  
#> [10] "10-10"

## it's better for SGE if you specify the range
parse_task_ids("1-10")
#> [1] "1-10"


## Adds the dash (-) to specify a start and end for the array job
## for those elements that are missing it
parse_task_ids_builder(c("1", "2-10:2"))
#> [1] "1-1"    "2-10:2"