TABLE OF CONTENTS


::pwtk::queue::setProfile_

SYNOPSIS

proc ::pwtk::queue::setProfile_ {queueSystem args} {

PURPOSE

This proc sets the profile-part of the batch-queuing script, i.e., the top part of the batch shell script containing #QUEUE directives, where QUEUE = SBATCH, BSUB...

USAGE

   setProfile_ queueSystem ?PROFILE? ?OPTIONS?

ARGUMENTS

SOURCE

    variable profile
    variable queue

    if { [regexp ^- $args] } {
        # profile was not specified, use default
        set args [concat default $args]
    }
    set profileName [lindex $args 0]
    if { ! [info exists profile($queueSystem,$profileName)] } {
        ::pwtk::error "the $queueSystem profile '$profileName' does not exist." 1
    }

    if { [info procs ::pwtk::${queueSystem}::parseOptions_] ne {} } {
        # implementation of this queue system has its parseOptions_ proc
        
        ::pwtk::${queueSystem}::parseOptions_ {*}$args        
    } else {
        # Use the generic recipe, i.e., treat the QUEUE command-line
        # options as the command-line options of the $queue($queueSystem,submitCmd) command

        set queue($queueSystem,profile) [::pwtk::trimIndent $profile($queueSystem,$profileName)]\n
        set queue($queueSystem,submitOpts) [lrange $args 1 end]
    }
}