Using modification scripts

Use workload snapshot modification scripts to easily modify your workload snapshots for different simulations.

Create a workload snapshot modification script in the lsf_cognitive_v1/work/scripts directory. Refer to the default workload snapshot modification script (wconvert_script_sample.sh) as an example for writing a script. You can then select your workload script from the LSF Simulator console when running a simulation. The bsim wconvert -s command calls this script for each snapshot record to modify the job submission parameters in the workload snapshot file.

There is a set of LSF environment variables that are mapped from the bsub command options. These are passed from the bsim command into the script. Another set of environment variables for the scripts are passed from LSF Simulator for the GUI filters. The script matches the current record using these two sets of environment variables, then writes these environment variables back to the bsim command.

The script is called by the bsim command for every snapshot record to mark which field to change, and what is the new value.

The workload snapshot modification scripts use these parameters that are mapped to the following bsub command options.


Option bsub or bmod option Data type Description
LSB_SUB_BEGIN_TIME -b integer Begin time, in seconds since 00:00:00 GMT, 1 January 1970.
LSB_SUB_CHKPNT_DIR -k string Checkpoint directory

The file path of the checkpoint directory can contain up to 4000 characters for UNIX and Linux, or up to 255 characters for Windows, including the directory and file name.

LSB_SUB_COMMAND_LINE bsub job command argument string The LSB_SUB_COMMANDNAME parameter must be set in the lsf.conf parameter to enable esub to use this variable.
LSB_SUB_CHKPNT_PERIOD -k string Checkpoint period in seconds
LSB_SUB_DEPEND_COND -w string Dependency condition
LSB_SUB_ERR_FILE -e, -eo string Standard error file name
LSB_SUB_EXCLUSIVE -x boolean Exclusive execution, which is specified by Y.
LSB_SUB_HOLD -H boolean Hold job.
LSB_SUB_HOST_SPEC -c or -w string Host specifier, limits the CPU time or RUN time.
LSB_SUB_HOSTS -m string List of requested execution host names
LSB_SUB_IN_FILE -i, -io string Standard input file name
LSB_SUB_INTERACTIVE -I boolean Interactive job, which is specified by Y.
LSB_SUB_LOGIN_SHELL -L string Login shell
LSB_SUB_JOB_NAME -J string Job name
LSB_SUB_JOB_WARNING

_ACTION

-wa string Job warning action
LSB_SUB_JOB_ACTION

_WARNING_TIME

-wt integer Job warning time period
LSB_SUB_MAIL_USER -u string Email address to which LSF sends job-related messages.
LSB_SUB_MAX_NUM

_PROCESSORS

-n integer Maximum number of processors requested
LSB_SUB_NOTIFY_BEGIN -B boolean LSF sends an email notification when the job begins, specified by Y.
LSB_SUB_NOTIFY_END -N boolean LSF sends an email notification when the job ends, which are specified by Y.
LSB_SUB_NUM_PROCESSORS -n integer Minimum number of processors requested.
LSB_SUB_OTHER_FILES bmod -f integer Indicates the number of files to be transferred. The value is SUB_RESET if bmod is being used to reset the number of files to be transferred.

The file path of the directory can contain up to 4094 characters for UNIX and Linux, or up to 255 characters for Windows, including the director and file name.

LSB_SUB_OTHER_FILES

_number

bsub -f integer The number indicates the particular file transfer value in the specified file transfer expression.

For example, for bsub -f "a > b" -f "c < d", the following parameters are defined:

LSB_SUB_OTHER_FILES=2

LSB_SUB_OTHER_FILES_0="a > b"

LSB_SUB_OTHER_FILES_1="c < d"

LSB_SUB_OUT_FILE -o, -oo string Standard output file name.
LSB_SUB_PRE_EXEC -E string Pre-execution command.

The file path of the directory can contain up to 4094 characters for UNIX and Linux, or up to 255 characters for Windows, including the directory and file name.

LSB_SUB_PROJECT_NAME -P string Project name.
LSB_SUB_PTY -Ip boolean An interactive job with PTY support, which is specified by "Y"
LSB_SUB_PTY_SHELL -Is boolean An interactive job with PTY shell support, which is specified by "Y"
LSB_SUB_QUEUE -q string Submission queue name
LSB_SUB_RERUNNABLE -r boolean Y specifies a rerunnable job.

N specifies a non-rerunnable job (specified with bsub -rn). The job is not rerunnable even it was submitted to a rerunnable queue or application profile.

For bmod -rn, the value is SUB_RESET.

LSB_SUB_RES_REQ -R string Resource requirement string—does not support multiple resource requirement strings.
LSB_SUB_RESTART brestart boolean Y indicates to esub that the job options are associated with a restarted job.
LSB_SUB_RESTART_FORCE brestart -f boolean Y indicates to esub that the job options are associated with a forced restarted job.
LSB_SUB_RLIMIT_CORE -C integer Core file size limit
LSB_SUB_RLIMIT_CPU -c integer CPU limit
LSB_SUB_RLIMIT_DATA -D integer Data size limit

For AIX, if the XPG_SUS_ENV=ON environment variable is set in the user's environment before the process is executed and a process attempts to set the limit lower than current usage, the operation fails with errno set to EINVAL. If the XPG_SUS_ENV environment variable is not set, the operation fails with errno set to EFAULT.

LSB_SUB_RLIMIT_FSIZE -F integer File size limit
LSB_SUB_RLIMIT_PROCESS -p integer Process limit
LSB_SUB_RLIMIT_RSS -M integer Resident size limit
LSB_SUB_RLIMIT_RUN -W integer Wall-clock run limit in seconds. (Note this value is not in minutes, unlike the run limit specified by bsub -W).
LSB_SUB_RLIMIT_STACK -S integer Stack size limit
LSB_SUB_RLIMIT_THREAD -T integer Thread limit
LSB_SUB_TERM_TIME -t integer Termination time, in seconds, since 00:00:00 GMT, Jan. 1, 1970
LSB_SUB_TIME_EVENT -wt integer Time event expression.

LSB_SUB_USER_GROUP

-G

string

User group name

LSB_SUB_WINDOW_SIG

-s

integer

Window signal number

LSB_SUB2_JOB_GROUP

-g

string

Submits a job to a job group

LSB_SUB2_LICENSE

_PROJECT

-Lp

string

License Scheduler project name

LSB_SUB2_IN

_FILE_SPOOL

(read-only)

-is

string

Spooled input file name. This value cannot be modified

LSB_SUB2_JOB

_CMD_SPOOL

(read-only)

-Zs

string

Spooled job command file name. This value cannot be modified.

LSB_SUB2_JOB

_PRIORITY

-sp

integer

Job priority

For bmod -spn, the value is SUB_RESET.

LSB_SUB2_SLA

-sla

string

SLA scheduling options

LSB_SUB2_USE_RSV

-U

string

Advance reservation ID

LSB_SUB3_AUTO

_RESIZABLE

-ar

boolean

Job autoresizable attribute. LSB_SUB3_AUTO_RESIZABLE=Y if bsub -ar -app or bmod -ar is specified.

LSB_SUB3_AUTO_RESIABLE=

SUB_RESET if bmod -arn is used.

LSB_SUB3_APP

-app

string

Application profile name

For bmod -appn, the value is SUB_RESET.

LSB_SUB3_CWD

-cwd

string

Current working directory

LSB_SUB3_ INIT_CHKPNT_PERIOD

-k init

integer

Initial checkpoint period

LSB_SUB_INTERACTIVE

LSB_SUB3_INTERACTIVE_SSH

bsub -IS

boolean

The session of the interactive job is encrypted with SSH.

LSB_SUB_INTERACTIVE

LSB_SUB_PTY

LSB_SUB3_INTERACTIVE_SSH

bsub -ISp

boolean

If LSB_SUB_INTERACTIVE is specified by "Y", LSB_SUB_PTY is specified by "Y", and LSB_SUB3_INTERACTIVE_SSH is specified by "Y", the session of interactive job with PTY support is encrypted by SSH.

LSB_SUB_INTERACTIVE

LSB_SUB_PTY

LSB_SUB_PTY_SHELL

LSB_SUB3_INTERACTIVE_SSH

bsub -ISs

boolean

If LSB_SUB_INTERACTIVE is specified by "Y", LSB_SUB_PTY is specified by "Y", LSB_SUB_PTY_SHELL is specified by "Y", and LSB_SUB3_INTERACTIVE_SSH is specified by "Y", the session of interactive job with PTY shell support is encrypted by SSH.

LSB_SUB3_JOB_REQUEUE -Q string String format parameter that contains the job requeue exit values

For bmod -Qn, the value is SUB_RESET.

LSB_SUB3_MIG -mig

-mign

integer Migration threshold
LSB_SUB3_POST_EXEC -Ep string Run the specified post-execution command on the execution host after the job finishes (you must specify the first execution host).

The file path of the directory can contain up to 4094 characters for UNIX and Linux, or up to 255 characters for Windows, including the directory and file name.

LSB_SUB3_RESIZE_NOTIFY_CMD -rnc string Job resize notification command.

LSB_SUB3_RESIZE_NOTIFY_CMD=<cmd> if bsub -rnc or bmod -rnc is specified.

LSB_SUB3_RESIZE_NOTIFY_CMD

=SUB_RESET

if bmod -rnc is used.

LSB_SUB3_RUNTIME_ESTIMATION -We integer Runtime estimate in seconds. (Note this runtime is not in minutes, unlike the runtime estimate specified by bsub -We).
LSB_SUB3_RUNTIME_ESTIMATION_ACC -We+ integer Runtime estimate that is the accumulated run time plus the runtime estimate.
LSB_SUB3_RUNTIME_ESTIMATION_PERC -Wep integer Runtime estimate in percentage of completion
LSB_SUB3_USER_SHELL_LIMITS -ul boolean Pass user shell limits to execution host.
LSB_SUB_INTERACTIVELSB_SUB3_XJOB_SSH bsub -IX boolean If both are set to "Y", the session between the X-client and X-server as well as the session between the execution host and submission host are encrypted with SSH.
LSB_SIM_CPUFACTOR -sim cputime

-sim runtime

float Job running host's CPU factor.
LSB_SIM_CPUTIME -sim cputime integer Job CPU time.
LSB_SIM_EXIT_STATUS -sim exitstatus integer Job exit status.
LSB_SIM_JOBID

(read-only)

    Job ID. This value cannot be modified.
LSB_SIM_JOBIDX

(read-only)

    Job index. This value cannot be modified.
LSB_SIM_MAXMEM -sim maxmem integer Maximum memory usage.
LSB_SIM_NSLOTS     Number of allocated slots.
LSB_SIM_RUNTIME -sim runtime integer Normalized job run time.
LSB_SIM_SUB_TIME

(read-only)

    Job submission time. This value cannot be modified.
LSB_SIM_TRACE_TYPE

(read-only)

    The type of snapshot (trace) record. This is JOB_NEW and cannot be modified.
LSB_SIM_SUB_USER   string The job submission user name.