From GridLAB-D Wiki
Jump to: navigation, search

 Proposed for review  Hassayampa (Version 3.0)

job - Command line option to run a batch job

Synopsis

host% gridlabd job-options --job run-options

Description

The job command line option initiates a group of GridLAB-D runs in the working folder. The process functions as follows:

  1. Obtain a list of all the GLM files in the working folder
  2. Sort the list in ASCII character order (i.e., punctuation, 0-9, A-Z, a-z, etc.)
  3. For each GLM in the sorted list
    1. Run gridlabd on the GLM file using the run-options

The job-options are applied to main job control instance of GridLAB-D, while the run-options are applied to each run instance of GridLAB-D. For example,

host% gridlabd --threadcount 2 --job

will run two single-threaded instances simultaneously, while

host% gridlabd --job --threadcount 2

will run one two-threaded instance at a time.

Windows 
If the file clean.bat is found, the file is executed in a DOS shell before the first GLM file is processed.
Linux/Mac 
If the file clean is found and it is executable, the file is executed in a bash shell before the first GLM file is processed.

Output

By default all output is redirected to the default output stream (see redirect). You can send all output to the console using the --redirect none command option.

Mailing Reports

Linux/Mac only 
When a job run is completed, a message can be emailed using the mailto global variable. For example
host% gridlabd -D mailto user@localhost --job
Will email the job report in to user on the local machine.
Note
Your local mail server must be configured properly to deliver email to remote hosts and your mail client must be configured properly to read mail on the local mail server. GridLAB-D cannot detect either mail server or mail client configuration errors. Thus problems with either of these can cause mailed report delivery errors to occur without an error being reported in GridLAB-D.

Caveats

Multithreaded operation can cause intermingled output, particularly when used in conjunction with --redirect none. This is due to the lack of locking in the output message streams when running multiple jobs on a single console.

Some output from gridlabd runs cannot be redirected and will always be displayed on the console. Known problems include output from compilers, linked applications, and scripts.

Bugs

Unhandled exceptions in Windows can cause modal dialogs to pop up that block the process. This behavior appears to be impossible to suppress. See http://sourceforge.net/p/gridlab-d/tickets/606 for details.

See also