TABLE OF CONTENTS


::pwtk::container

SYNOPSIS

proc ::pwtk::container {args} {

PURPOSE

Set or query the "container exec" command. Without a container, a program is run as:

     $prefix program.x $postfix ...

But when a container image is used, the program is run as:

     $container $prefix program.x $postfix ...

Example:

     singularity exec /path/to/image.sif mpirun -n 8 program.x -npool 2

In this case:

     container == singularity exec /path/to/image.sif
     prefix    == mpirun -n 8
     postfix   == -npool 2

USAGE

   Set mode:

     ::pwtk::container arg1 arg2 ...

   Query mode:

     ::pwtk::container

   To clear the value of the "container", set it to an empty string, i.e.:

     ::pwtk::container {}

RETURN VALUE

The value of the container exec command (e.g. "singularity exec /path/to/image.sif").

SOURCE

    variable RUNopt

    if { [llength $args] == 0 } {
        return [varvalue RUNopt(CONTAINER_EXEC)]
    } elseif { [llength $args] == 1 } {
        set RUNopt(CONTAINER_EXEC) {*}$args
    } else {
        set RUNopt(CONTAINER_EXEC) $args
    }
    return $RUNopt(CONTAINER_EXEC)
}