array_submit: Submit an array job with a specified set of task IDs

View source: R/array_submit.R

array_submitR Documentation

Submit an array job with a specified set of task IDs

Description

Given a bash script that specifies the SGE option -t (that is, an array job), this function submits that job using qsub for a given list of task IDs. This function is useful in case some tasks for a given job failed which you can find using ⁠qstat | grep Eqw⁠ or other options.

Usage

array_submit(
  job_bash,
  task_ids,
  submit =
    file.exists("/cm/shared/apps/sge/sge-8.1.9/default/common/accounting_20191007_0300.txt"),
  restore = TRUE
)

Arguments

job_bash

A character(1) vector with the name of a bash script in the current working directory.

task_ids

A set of task ids that will get parsed by parse_task_ids.

submit

A logical(1) vector determining whether to actually submit the tasks or not using qsub.

restore

A logical(1) vector determining whether to restore the script to the original state.

Value

The path to job_bash.

Author(s)

Leonardo Collado-Torres

Examples


## Choose a script name
job_name <- paste0("array_submit_example_", Sys.Date())

## Create an array job on the temporary directory
with_wd(tempdir(), {
    ## Create an array job script to use for this example
    job_single(
        name = job_name,
        create_shell = TRUE,
        task_num = 100
    )

    ## Now we can submit the SGE job for a set of task IDs
    array_submit(
        job_bash = paste0(job_name, ".sh"),
        task_ids = "225019-225038:1,225040,225043",
        submit = FALSE
    )
})


LieberInstitute/sgejobs documentation built on May 12, 2023, 5:20 p.m.