BBP Batch Scripts

From SCECpedia
Revision as of 19:56, 12 May 2012 by Maechlin (talk | contribs)
Jump to navigationJump to search

Batch Scripts

BBP_2G Batch Automation Tools v1.2, 2011-08-19

This release includes two Python scripts for batch automation of Broadband Platform simulations.

build_xml.py:

Script to generate XML files formatted for BBP_2G. The XML files are created based on user provided run description files. This script takes a path to the folder containing run description files as input and generates a set of XML files. These XML files can be used as inputs to automate the run of Broadband simulations.

Usage example: build_xml.py -i "/home/user/run_descs" -x "/home/user/run_descs"

This will parse the run description files in "/home/user/run_descs" and generate XML files with BBP and save them in "/home/user/run_descs" folder.

This script expects run description text files with the following format: RUN_TAG = 10010100 VALIDATION_RUN = n SOURCE_DESCRIPTION_FILE = /home/NgaW2/FwHw/FaultInfo/Inputs/m6.00_d20_r90_z0.src STATION_LIST_FILE = /home/NgaW2/FwHw/StatInfo/rv01-m6.00_stats.stl RUPTURE_GENERATOR = URS LOW_FREQUENCY_MODULE = URS HIGH_FREQUENCY_MODULE = URS SITE_RESPONSE_MODULE = URS PLOT_VEL = y PLOT_ACC = y RUN_GOF = n

Note: RUN_TAG is equivalent to simulation ID

batch_run_bbp.py:

Script to run a set of Broadband simulation based on input XML files. This script takes a path to a folder containing BBP formated XML files and runs simulations with BBP for each of the XML files in the specified folder. The script has a build in resume feature which allows the script to track and skip XML files which were previously processed. An output directory can be specified to collate simulation directories (indata, outdata tmpdata and logs) in one location.

Usage example: batch_run_bbp.py -i "./run_xml" -o "./sim_out_dir" -r -f

This will run the Broadband Platform with each of the XML files in "./run_xml" folder. The -o option will cause the script to move simulation directories (indata/<simID>, outdata/<simID>, tmpdata/simID, logs/simID) to "./sim_out_dir" folder. The -r option will allow the script to skip all the XML files that were previously processed. The -f option will allow the script to force overwrite any BBP folders indata/<simID>, outdata/<simID>, tmpdata/<simID>, logs/<simID>. The script will also overwrite simulation folders with same simulation ID in "./sim_out_dir", if present from a previous run. This would allow the user to re-run a simulation with a previously used simulation ID.