Modifying the FW Config¶
Many parameters used by FireWorks can be changed to suit your needs. Some examples include:
specifying the default locations of your configuration files. This will save you a lot of typing when running FireWorks scripts, e.g.
lpad -l my_launchpad.yaml get_fwsbecomes
lpad get_fwsonce you’ve set your default LaunchPad location.
enabling Firetasks for which the code is located outside of the FireWorks package
smaller adjustments, e.g. whether to print a
FW.jsonfile in your run directory
performance tweaks (not recommended!)
How to modify the FW Config¶
A sample FW_config file (that does not change any settings) is located in the FireWorks tutorial directory:
- To activate the config file, you can do any one of the following:
put it in the current directory where you run FireWorks commands
put it in your root
<INSTALL_DIR>(do not change it’s name!). Recall that your
<INSTALL_DIR>can be found by typing
put the config file in
<HOME>is your home directory (don’t forget the
put the config file anywhere, but set the FW_CONFIG_FILE as an environment variable in your OS. The
FW_CONFIG_FILEenvironment variable should be set to the full path (no relative links!) of your config file, including the filename.
The config file in the current directory will always take precedence.
To test whether your config file is activated, run any LaunchPad command:
You should see text printed to the Terminal saying
successfully loaded your custom FW_config.yaml!. You can remove this text by deleting the
ECHO_TEST parameter from your
Specifying default locations for the config files¶
It can be annoying to manually type in the
-q parameters in FireWorks scripts (corresponding to the locations of the LaunchPad, FireWorker, and QueueAdapter files, respectively). You can set these parameters once and for all by specifying the following variables in your FWConfig:
be sure to use full paths, not relative paths or BASH shortcuts!
Specifying default locations for the config files (alternate)¶
An alternate strategy is to set a single parameter in FWConfig called
CONFIG_FILE_DIR. This should be the full path to a directory containing files named
my_qadapter.yaml. FireWorks looks for these files in the
CONFIG_FILE_DIR if it cannot find them elsewhere. If unset in the FWConfig, the
CONFIG_FILE_DIR is automatically set to the directory you are running your FW script in.
Parameters you might want to change¶
A few basic parameters that can be tweaked are:
SORT_FWS: ''- set to
FIFOif you want older FireWorks to be run first,
FILOif you want recent FireWorks run first. Note that higher priority FireWorks are always run first.
PRINT_FW_JSON: True- whether to print the
FW.jsonfile in your run directory
PRINT_FW_YAML: False- whether to print the
FW.yamlfile in your run directory
SUBMIT_SCRIPT_NAME: FW_submit.script- the name to give the script for submitting PBS/SLURM/etc. queue jobs
FW_LOGGING_FORMAT: %(asctime)s %(levelname)s %(message)s- format for loggers (this String will be passed to
ALWAYS_CREATE_NEW_BLOCK: False- set True if you want the Queue Launcher to always create a new block directory every time it is called, False if you want to re-use previous blocks
TEMPLATE_DIR- where to store templates if you are using the TemplateWriterTask.
REMOVE_USELESS_DIRS: False- tries to delete empty launch directories created when setting the
_launch_dirin the spec of your Firework.
EXCEPT_DETAILS_ON_RERUN: False- if True, when rerunning a FIZZLED Firework, the serialized exception details are added to the spec.
WEBSERVER_HOST: 127.0.0.1- the default host on which to run the web server
WEBSERVER_PORT: 5000- the default port on which to run the web server
QUEUE_JOBNAME_MAXLEN: 20- the max length of the job name to send to the queuing system (some queuing systems limit the size of job names)
Parameters that you probably shouldn’t change¶
Some parameters that you can change, but probably shouldn’t, are:
QUEUE_RETRY_ATTEMPTS: 10- number of attempts to re-try communicating with queue server when communication fails
QUEUE_UPDATE_INTERVAL: 5- max interval (seconds) needed for queue to update after submitting a job
WFLOCK_EXPIRATION_SECS: 300- wait this long (in seconds) for a WFLock before expiring. Must set much higher than DB update time for a WF.
WFLOCK_EXPIRATION_KILL False- If True, kill WFLock on expiration. If False, raise Error instead.
PING_TIME_SECS: 3600- means that the Rocket will ping the LaunchPad that it’s alive every 3600 seconds. See the failures tutorial.
RUN_EXPIRATION_SECS: 14400- means that the LaunchPad will mark a Rocket FIZZLED if it hasn’t received a ping in 14400 seconds. See the failures tutorial.
RESERVATION_EXPIRATION_SECS: 1209600- means that the LaunchPad will cancel the reservation of a Firework that’s been in the queue for 1209600 seconds (14 days). See the queue reservation tutorial.
FW_BLOCK_FORMAT: %Y-%m-%d-%H-%M-%S-%f- the
block_directories written by the Rocket and Queue Launchers add a date stamp to the directory. You can change this if desired.
QSTAT_FREQUENCY: 50- number of jobs submitted to queue before re-executing a qstat. 1 means always do qstat, higher avoids unnecessarily loading the qstat server. Set this low if you have multiple processes submitting jobs to the same queue.
PW_CHECK_NUM: 10- how many FireWorks/Workflows can be changed with a single LaunchPad command (like
rerun_fws) before a password is required.
For a full list of parameters that can be changed, you can browse the
fw_config.py file in the FireWorks source.