Broadband User Guide v13.9.0
Version 13.9.0
If you find errors in this document or sections to be unclear, please contact software@scec.org. If possible, please send a description of how to reproduce the problem. This will help SCEC developers more quickly identify and resolve the problem you have identified.
Contents
Installing the Broadband Platform
Installing the Broadband Platform involves obtaining a copy of the code and building the required executables. You can either download the platform from the Broadband web site (http://www.scec.org/research/broadband) or check the code out of SCEC's Subversion repository. Most users should download the platform.
System Dependencies
The current version of the Broadband Platform is designed to run on standard 64-bit Linux machines. Testing has been performed on SCEC's development servers running Fedora Core 10 (kernel version 2.6.27.41-170.2.117.fc10.x86_64). In this guide we outline how to install the platform into your own account on a Linux computer using the simplest approach.
Software Dependencies
The Broadband Platform has certain software dependencies.
Required:
- Python v2.6+ with
- Matplotlib 1.0.1
- Numpy 1.4.1
- Scipy 0.7.2
- Pyproj 1.8.9
- Intel compilers (64-bit) v12.0.4
- GNU compilers (gcc, gfortran) v4.5.1
- GNU Fortran 77 v3.4.6
Setting Up Your Account
For simplicity of installation, we recommend users use a bash shell for the Broadband Platform account. It is possible to get the platform running using other shell's, but we will focus on a bash shell installation. The user environment is a common source of problems since certain environment variables must be defined for the platform to work correctly.
To check your account, make sure you can run basic commands like ls and cd before proceeding.
Downloading the Platform
Download the main Broadband distribution file from the Broadband website. Users should also download the Greens' Functions files for the regions where simulations will be performed. Currently the platform supports the following regions:
- LABasin (this package is required to run the Unit and Acceptance tests)
- Mojave
- LomaPrieta (for Northern California)
- Western Japan
- Central Japan
Additionally, users can optionally download validation packages for the following recorded events:
- Northridge (requires the LABasin GF package)
- Loma Prieta (requires the Loma Prieta GF package)
After downloading the needed files to your local Linux system, users can calculate their checksums and compare them to the checksums on the Broadband web site to verify that you have the correct files. If you type:
$ which md5sum
You should get something like /usr/bin/md5sum. If you see the message 'no md5sum in...', contact your Linux system administrator and ask to have md5sum added to your path.
Once you can run the md5sum command, run:
$ md5sum downloaded_file.tar.gz
where "downloaded_file.tar.gz" is the file downloaded from the Broadband website. Users should do this once for each of the downloaded files to make sure they have successfully downloaded the files.
If multiple users are planning to use the platform on the same system, you only need one copy of the data files per machine. Each user will still need his or her own copy of the code files.
Alternatively, if you would like access to the latest version of the platform and get frequent but less thoroughly tested improvements, you can check out the platform from SCEC's Subversion repository. Only advanced users should take this approach, outlined in detail in the Advanced Users section.
User Account Setup
* PYTHONPATH
After you've obtained a copy of the project, you'll need to make sure the comps directory is on Python's path so Python can find all the project modules. If you're running a Bash shell, add the following line to your .bash_profile with your favorite text editor:
export PYTHONPATH=<path to comps directory>:$PYTHONPATH
If you're running a C-shell, add the following line to your .cshrc with your favorite text editor:
setenv PYTHONPATH <path to comps directory>:$PYTHONPATH
* PATH
In order to successfully compile the project, you'll need to make sure the required compilers directories are in your PATH variable. Broadband requires Intel 64-bit compilers, icc and ifort and GNU Compilers, gcc, g77 and f77 to compile the scientific code.
If you are planning to run Broadband on SCEC Development servers, make sure you have the following directories in your PATH:
For Bash Shell (in .bash_profile)
export PATH=/usr/scec/intel/cce/9.0/bin:/usr/scec/intel/fce/9.0/bin:$PATH
For C-shell (in .cshrc)
setenv PATH /usr/scec/intel/cce/9.0/bin:/usr/scec/intel/fce/9.0/bin:$PATH
When running elements of the platform over ssh, be sure to enable ssh forwarding (with the -X or -Y options).
After modifying your login script above, log out and log back into the machine so the changes are reflected in your environment.
Edit Install_cfg.py with Installation Directory Paths
You need to tell the platform where it's installed by editing a single python file called "install_cfg.py". Edit the file bbp_2g/comps/install_cfg.py with your favorite text editor, and edit the lines:
self.A_INSTALL_ROOT = <bbp_2g directory> self.A_GF_DIR = <bbp_2g_gf directory>
with the paths on your system to the bbp_2g directory (the source) and the bbp_2g_gf directory (the data) that you unzipped. For example, it could be /home/scottcal/broadband_platform/bbp_2g and /home/scottcal/broadband_platform/bbp_2g_gf.
Here is some information about these two directories that may be useful as you decide how, and where, to install these two parts of the Broadband Platform on your computer disk system. The data files, and therefore the <bbp_2g_gf directory> are nearly 3GB, but they are static and will not be modified and will not grow in size during use of the platform. The source directory is small to begin. However, this directory will increase as the platform is used, since the results produced by the platform will be stored here.
Directory Structure
The platform consists of two top-level directories, bbp_2g and bbp_2g_gf. bbp_2g contains the source code, executables, scripts, tests, input, working, and output directories. bbp_2g_gf contains the Green's Functions, input files for the validation events, and other required input files for the various code bases. Note that indata, logs, outdata, tmpdata, and xml are created when the platform is first run, so they will be missing when you first install the platform.
bbp_2g has the following directories:
- checksums: Contains checksums for bbp_2g_gf files
- comps: The Python scripts to run the platform
- docs: Documentation for the platform
- etc: Miscellaneous utility scripts
- examples: Contains example input files
- indata: An internal directory, used to stage input files
- logs: Contains logs from BBP runs
- outdata: Contains output files from a run
- ref_data: Contains reference files for BBP tests
- start: Put input files for an interactive run here
- src: Source code for BBP modules
- tests: Contains unit and acceptance tests
- tmpdata: An internal directory, used during a run
- xml: Contains XML files which describe simulations and can be used as input
bbp_2g_gf has the following directories:
- compare: Contains observed seismograms for validation events
- plot: Data files for GMT plots
- sdsu, ucsb, urs: Contains Green's functions, velocity files, and other required inputs for the codebases.
In general, you will be interacting with the start directory for input files, comps to run the platform, tests to test the platform, and outdata to examine data products.
Adding aliases
You may find it helpful to add aliases, so you can quickly and easily move to different broadband directories with a single command. We recommend creating aliases for the comps, start, and outdata directories.
If you are using the Bash shell, you can create aliases by adding the following lines to ~/.bash_profile:
alias comps='cd <path to bbp_2g directory>/comps' alias start='cd <path to bbp_2g directory>/start' alias outd='cd <path to bbp_2g directory>/outdata'
If you're using a C shell, edit your ~/.cshrc and add:
alias comps cd <path to bbp_2g directory>/comps alias start cd <path to bbp_2g directory>/start alias outd cd <path to bbp_2g directory>/outdata
Log out and log back in. You'll notice that now you can type the alias command as a shortcut to change directories:
$> pwd /home/scec-00/scottcal $> comps $> pwd /home/scec-00/scottcal/bband/bbp_2g/comps
This can be a useful way to navigate around the broadband platform directories.
Building the Platform
Once you have checked out the code, you need to build it. By default, every executable is compiled using the compiler recommended by the code developer. However, if you have limited compiler options or are building the codes on an untested system, you may need to specify non-standard alternative compilers, as described below.
Before you can build the platform, you need to make sure that the Intel compilers are in your path. This is done automatically on intensity.usc.edu, but on other systems you can check by typing:
$>which icc
If you get the message "no icc in ...", then you'll need to add the Intel compilers to your path. Once the Intel compilers are in your path, you can make the code by cd-ing to the bbp_2g/src directory and typing make:
$> cd src $> make
It takes a minute or two to build the code. You may encounter build warnings; these are fine. However, if you get any build errors, this is a problem and should be investigated.
By default, every executable is compiled using the compiler recommended by the code developer. Depending on the system, some compilers may not be available to you. You can override the C and Fortran compilers used by editing
src/makefile
Uncomment USER_C and set FC and CC to the compilers you wish. For example:
Before:
#USER_C=1 FC=f77 CC=gcc
After (an example, you may choose different compilers):
USER_C=1 FC=gfortran CC=gcc
Note that not all compiler combinations have been thoroughly tested. You may encounter build errors with untested compiler combinations. If you encounter any errors while building the platform, consult the Troubleshooting section at the end of this user guide for know issues and their solutions.
Once the platform has been successfully built, you can move on to running the tests to verify that all components are working correctly.
Advanced Users
Alternatively, if you would like access to the latest version of the platform, to get frequent but less thoroughly tested improvements, you can check out the platform from SCEC's Subversion version control repository on intensity.usc.edu. Only advanced users should follow this approach. If you are unsure, you should download the code as outlined in Downloading the Platform and skip this section.
You may need to request access from the SCEC system administrator, John Yu (johnyu@usc.edu). Make sure you have subversion in your path before beginning.
Once you have access, you'll need to decide if you want a stable tagged version, or the latest version in the repository. For a stable version, open a terminal window on the system of your choice and type:
$> svn checkout https://source.usc.edu/svn/broadband/tags/<stable version> bbp_2g
For the latest version, type:
$> svn checkout https://source.usc.edu/svn/broadband/trunk bbp_2g
This will check out the project to your local machine. It contains the source code, tests, and some example files. You also need to obtain a copy of the Broadband Platform data files, containing the Green's tensors. They are too large to be stored in version control. You can obtain a copy from the [on intensity. If you are working on intensity as well, you can just create a symbolic link:
$> ln -s /home/scec-00/scottcal/bband/bbp_2g_gf <path to your gf directory>
If you are not working on intensity, or don't have an intensity username, you can get a .tgz file of the Green's functions from the same download site you obtained this guide.
Periodically you should check for updates to the code. To do so, go to your bbp_2g directory and type
$> svn update
This will pull down any code updates that have been made in the repository. After you update, make the code again (detailed in Building the Platform) so that any code changes are captured in the executables.
Oracle VirtualBox Image
We have developed a virtual machine version of the Broadband Platform. Modern virtual machine technology, the basis for cloud computing like Amazon EC2, is designed to solve the problem of heterogeneous computing environments. In the past, it has been difficult to move a complicated program from one computer to another because any little change in software can cause an incompatibility and things fail.
The way we use virtual machine technology is to collect the entire broadband platform software environment in a Linux computer. This includes compilers, libraries, broadband source code, broadband executables, and data. Then, we zip this all up into an image. VirtualBox clients emulate a Linux computer. VirtualBox clients are software programs that you can download and run on most types of computers including windows, and Mac computers. Any computer that can run a VirtualBox client can run any VirtualBox image.
The way this system works is we build the Broadband Platform on a specific virtual computer. We include all the source code, the executable, the data files, in that image. Then, if you install a VirtualBox client on your computer, it is certain that our virtual image will run on your computer. The VirtualBox technology helps to remove the differences between computer environments.
We have developed a distribution of the Broadband platform as a VirtualBox image. The user does not have to compile the software on their own computer. We have compiled it on our computers. Use of this distribution has advantages and disadvantages.
Advantages include no need for the user to install and use compilers, including the Intel compilers. Intel compilers are commercial software that must be purchased for commercial use. The current Broadband platform has dependencies on the Intel compilers. If you do have access to Intel compilers, but you still want to run the Broadband Platform, you can use this VirtualBox distribution of Broadband. Another advantage, for advanced or large-scale use, is this version can be run on commercial cloud computers such as Amazon EC2.
Disadvantages include the need to install and configure the Oracle VirtualBox client on your computer before you run the broadband platform. If you are in a commercial environment, this will probably need to be done by a system administrator.
The Broadband virtual machine image is based on a Fedora 14, 64-bit operating system. The image is provided with the Broadband platform fully configured, with all necessary supporting software. This image can be deployed on any 64-bit operating system for which a VirtualBox client is available. The image file (.vdi) is about 16 GB in size when extracted from the archive and can grow up to 50 GB in size with usage.
- Download and install VirtualBox client from: http://www.virtualbox.org/
- Download the following 2 files from Broadband download site:
- Linux and MAC:
- bbp_vb_<version>.tgz
- bbp_vb_<version>.tgz.md5
- Windows:
- bbp_vb_<version>.zip
- bbp_vb_<version>.zip.md5
- Verify the checksum of the archive file:
- md5sum -c bbp_vb_<version>.tgz.md5
- Extract the image file bbp_<version>.vdi from the archive file bbp_vb_<version>.tgz(or bbp_vb_<version>.zip) to a local folder. Note: The extracted image file is ~16 GB in size and some utilities like tar and unzip might have issues extracting the image. The following utilities are recommended for extracting:
- Windows - WinZip, WinRAR
- Linux - tar v1.22 (or higher)
- MAC - Archive utility or the Unarchiver v 2.7+
- Launch VirtualBox client
- Click on Machine menu, select New
- Follow the New Virtual Machine Wizard to create a Fedora 14 Linux VM with the following settings
- Name : BBand
- OS : Linux
- Version : Fedora (64 bit)
- Memory : 2048 MB (or 50% of available RAM, whichever is less)
- Virtual Hard Disk :
- - Select Boot Hard Disk
- - Select Use Existing Hard Disk
- - Browse to locate, and select bbp_<version>.vdi file.
- Verify a new virtual machine BBand is created in the virtual machine list.
- Select BBand from the list of virtual machine and click on Start icon.
- Acknowledge any dialog boxes about keyboard capture and mouse integration to launch the virtual machine.
- Verify the Fedora 14 virtual machine boots and you are presented with a login prompt.
- Login in with following credentials:
- User name: bband
- Password: scec
Running the Tests
The broadband platform contains three kinds of tests. The checksum tests verify that the data files were copied correctly and you have all the files that are expected. Unit tests run each module using a set of input files, and compare the results against known outputs. They verify that each module has been built and is working correctly. Acceptance tests verify that the modules are working correctly together. They test the platform end-to-end using different combinations with known inputs and compare the results. All the possible module combinations for both user-defined and validation events are tested as checks against integration errors.
If Brodband Platform was installed locally on a Linux machine, begin with the checksum tests. Once they pass, run the unit tests and finally the acceptance tests. If Broadband Platform will be run on the VirtualBox image, it is recommended to run checksum tests to verify integrity of files on the extracted image. Once the checksum test pass, running unit tests and acceptance tests is optional.
Running Checksum Tests
To run the checksum tests, change to the checksums directory and run md5sum_check.py.
$> cd checksums $> ./md5sum_check.py
It takes about 5 minutes to compute the checksums. If a checksum disagrees, that means that the contents of the datafile were not what was expected. Try reinstalling the data files and try again. If you continue to get a checksum error, contact support.
Once the checksums agree, move on to the unit tests.
Running Unit Tests
To run the unit tests, change to the tests directory and run UnitTests.py.
$> cd tests $> ./UnitTests.py
The unit tests take up to 45 minutes to run. When they're complete, the console will either print "OK" or how many tests failed. If a test has failed, first check that you have built the executables.You can rerun just the specific test that failed (test_<module>.py). If the test is still failing, also verify that you have the ref_data directory, since it contains the input and reference files. If you're looking for more information about the failure, you can consult the Unit Tests log file in bbp_2g/logs/unit_test.log . If you can't determine the reason for the failure, contact support.
Once the unit tests all pass, proceed to the acceptance tests. If there are any failure or errors while running the unit tests, consult the Troubleshooting section at the end of this user guide for know issues and their solutions.
Running Acceptance Tests
Make sure the unit tests pass before moving on to the acceptance tests. To run the acceptance tests, change to the tests directory (if you're not there already) and run AcceptTests.py. The acceptance tests take a long time to run, around 20 hours
$> cd tests $> nohup ./AcceptTests.py
Since they take so long to run, you may want to background them instead and redirect their output:
$> nohup ./AcceptTests.py &> accept.out &
When they're complete, the console will either print "OK" or how many tests failed. Acceptance test failures indicate that the modules are not integrated correctly. Like with the unit tests, verify that you have the ref_data directory. If a certain acceptance test fails, you can get more information by consulting the acceptance test logs in bbp_2g/logs/acceptance_tests_logs/<test that failed>.log . If you can't determine the reason for the failure, contact support.
Since the acceptance tests can take a long time to run, you may wish to resume where you left off. This feature is supported automatically. If you do not wish to resume, delete the resume file in logs/resume.txt. If there are any failure or errors while running the acceptance tests, consult the Troubleshooting section at the end of this user guide for known issues and their solutions.
Performing Simulations
The platform supports two kinds of simulations, validation events and user-defined events. Validation simulations are performed using a historical event, and are directly compared to observed seismograms using goodness-of-fit. User-defined events are run using a rupture description provided by the user which may not necessarily be a historical earthquake.
When you run a simulation, the platform assigns an ID to it. This ID can be used to track the simulation and locate the output data products.
To supply input files to the platform, put them in the start directory. Extensions are important - the platform recognizes station lists (.stl), SRF files (.srf), and simple source descriptions (.src). If there are multiple files of a type, the platform will prompt the user to select one.
To perform a simulation, a user selects between different required and optional modules. Below we present a summary of the various modules.
Modules
The broadband platform consists of a series of modules. There are two main types of modules, science modules and utility modules. Science modules are those for which the platform has multiple implementations, provided by different coding research groups. Utility modules only have 1 implementation. A schematic of the available modules and their flow relationships is shown below:
Science Modules
All simulations must include a low-frequency, high-frequency, and site response science module. Simulations may include an optional rupture generation science module. Users may select between the following different implementations of each of these modules:
Rupture generation:URS, UCSB
Low-frequency:URS, UCSB
High-frequency:URS, UCSB, SDSU
Site response:URS, UCSB, SDSU, GATECH
NOTE: This version of Broadband has limited support for GATECH site response module - Site1d. This module requires site-specific soil profile data to produce valid results. Soil profile
data is provided for only one station, OBRE, in Northridge validation region. Due to this limitation, GATECH module is only selectable for Validation - Northridge case in this release of Broadband.
Utility Modules
A spectral response utility module is automatically run after the site response module. Additionally, users may select an optional goodness-of-fit utility module to run at the conclusion of the simulation. In the case of a user-defined event, users select a historical event or previously run simulation to use as the comparison for goodness-of-fit.
Validation Simulations
To run a validation simulation, go to the comps directory and run run_bbp_2G.py. The platform will ask you a series of questions. Answer 'y' to "Do you want to perform a validation run?"
$> cd comps $> ./run_bbp_2G.py Welcome to the SCEC Broadband Platform. Please select the modules you want to run. Do you want to perform a validation run (y/n)? y Do you want to validate with: Northridge (1) Loma Prieta (2) Landers (3) ? ...
No input files are required by the user. However, you may wish to run with a reduced station list to speed up the computations. You can put your own station list into the start directory (the format is described in section 5.3). Note that any stations which do not have observed seismograms will not be included in the automatically generated goodness-of-fit comparison.
In addition to the low-frequency modules which compute seismograms using 1D Green's Tensors, validation events can also be run using precomputed 3D seismograms to supply the low-frequency.
User-defined Simulations
To run a user-defined simulation, two input files are required, a rupture description and a station list. The rupture description can either be in SRF format or a simplified source description (the format is described in section 5.1). To run a user-defined simulation, run run_bbp_2G.py.
$> cd comps $> ./run_bbp_2G.py Welcome to the SCEC Broadband Platform. Please select the modules you want to run. Do you want to perform a validation run (y/n)? y Do you want to run a rupture generator (y/n)? ...
You may then choose if you want to run a rupture generator. This is necessary if you're supplying a simple rupture description. If you're supplying an SRF file, you can skip this. Next you can select from different module implementations. Finally, you have the option to run goodness-of-fit against either observed seismograms or another simulation.
... Do you want to run goodness of fit (y/n)? y What reference files would you like to compare to? Enter a simulation ID or a scenario name: <comparison> Enter a label to use for the comparison seismograms: <label>
The label will be used in GoF plots to distinguish one set of results from the other.
The user-defined events must be within one of the regions supported by the platform - Southern California, Northern California, or the Mojave. The platform will automatically select a region based on the event hypocenter. If the event falls outside of these regions, you'll get an error.
Logging
During the run, log files will be produced in logs/<simulation ID>/<simulation ID>.<module name>.log. If the platform fails, this is a good place to look to determine the error. Additionally, any fatal errors will be recorded in fatal_error.log.
Metadata capturing all the executable calls is located in tmpdata/<simulation ID>/metadata.txt for careful tracing of exactly what was called. Both the log files and metadata can be useful if troubleshooting an issue.
Data Products
The platform produces a variety of data products. All data products are located in outdata/<simulation ID>. The ouput folder has a index.html file with a listing of all the data products in the output folder. Image files can be displayed by clicking on the link to the file in the index.html page. The .bbp and .list files will be displayed as text files in the browser. On most Linux systems, you can show images using display:
$> display <PNG file>
Make sure you have X11 forwarding enabled.
Station map
To help visualize the stations in relationship to the fault, the platform produces a PNG file displaying station locations with red circles and the fault plane with a black line, on an image of California. You can find this file in outdata/<simulation ID>/station_map.png.
Seismograms
When running the platform, you have the option to output velocity and acceleration seismograms, for each station. Plots of these files can be found in outdata/<simulation ID>/<simulation ID>.<station>_<velocity or acceleration>_seis.png.
The raw seismogram data is available in outdata/<simulation ID>/<simulation ID>.<station>.vel.bbp (velocity) and outdata/<simulation ID>.<station>.acc.bbp (acceleration). Its format is described in section 5.4.
To compare seismogram data, you can run comps/plotit.py with two seismograms. It will plot them both for comparison. From the comps directory, run:
$> ./plotit.py <path to seismogram 1> <path to seismogram 2>
Response spectra
The respect code, run at the end of each simulation, calculates the response spectra for each station. The raw respect data is located at
outdata/<simulation ID>/<simulation ID>.<station>.rsp
in the format described in section 5.5.
Goodness-of-fit
If you run goodness-of-fit, several additional data products are produced. Starting with version 11.7.0, two goodness-of-fit modules are available in Broadband.
- URS Goodness-of-fit:
The goodness-of-fit comparison is performed by comparing the response spectra of a set of calculated seismograms to seismograms from another simulation or observed seismograms. For each station involved in the comparison, a plot comparing the response spectra can be found at outdata/<simulation ID>/<comparison label>_<simulation ID>_<station>_rsp.png. A plot showing the seismograms on top and bottom can be found at outdata/<comparison label>_<simulation ID>_<station>_overlay.png. The goodness-of-fit plot can be found at gof-<comparison label>-<simulation ID>_r0-<cutoff distance>.png.
Note that at least 3 stations must be run for goodness-of-fit to be valid. If fewer than 3 stations are run, no goodness of fit calculation will be performed.
- SDSU Goodness-of-fit:
The SDSU goodness-of-fit module can compute several GoF measures. A detailed list of these GoF measure is listed here: SDSU MO-Gof. The goodness-of-fit comparison is performed by comparing the synthetic seismogram to the observed seismogram for each of the sites. For each GoF measure computed, a summary file labeled GOF_<measure>.list is generated with the GoF values for each of the sites. A weighted sum of GoF measures called site-fit is available in gof_summaray.txt file. If the simulation was run with three or more sites in the station list, GoF map plots will be available in the output directory as <simulation ID>_<Gof measure>_map.png. If PGA or PGV GoF values are computed a set of overlay plots showing the observed and synthetic seismograms on top and bottom will be available as outdata/gof_plots/<simulation ID>_<station>_match_<format>_overlay.png files.
Rupture files
When a user-defined event is simulated, the user has the option to run a rupture generator. This generator produces an SRF file, found in outdata/<simulation ID>/*.srf. This file can be put in the start directory and used in future runs. Additionally, the platform produces a plot of the cumulative slip on the fault surface, outdata/<simulation ID>/<SRF prefix>.png.
Platform Modes
The platform can be run in multiple modes. The default is interactive mode, in which the user is prompted to answer a series of questions. Once all the information has been gathered, the run begins.
For a large number of runs, or if the user is repeating a specific run, this can be tedious. The platform provides two other ways to describe a run, with an option file or an XML description.
An option file provides responses to all the questions that the platform poses. The format is described in section 5.6, but it's basically a text file, 1 entry per line, with support for comments. It can be fed to the platform using the -o option.
The platform will also accept XML files containing a full description of a run. The schema for these files is given in section 5.7. These files are also produced by the platform after every simulation, and placed in xml/<simulation ID>.xml. So if you want to rerun a simulation, you can point the platform to the XML file from that simulation using the -x option. Note that a new simulation ID will be assigned to the run, so there is no risk of overwriting previous simulation results.
Available Options
To get a list of the current available options, run run_bbp_2G.py with the -h flag.
$> ./run_bbp_2G.py -h Usage: run_bbp_2G.py [options] Options: -h, --help show this help message and exit -x XML_FILE, --xml-file=XML_FILE Run using XML description of workflow -s SIM_ID, --simID=SIM_ID Force a simID -o OPTFILE, --option-file=OPTFILE File containing responses to interactive platform prompts -v, --version Broadband platform version -g, --generate-xml Generates the XML description but does not run the platform -l LOG_FILE, --log=LOG_FILE Store all output in a file -x: The platform will run a simulation from the XML description. -s: Force the platform to run with a given simID (a nonnegative integer) -o: Use an option file providing answers to the platform prompts -v: Prints the version of the platform and exits. -g: The platform will generate an XML description but not actually run the workflow. Useful if you want to create simulation descriptions and run them later.
Cleanup
After a while, you may find that your indata, tmpdata, outdata, and logs directories are getting cluttered with files from past runs. If you wish to delete these old files, you can use the clean_directories.sh script in the etc directory.
$> cd etc $> ./clean_directories <days>
Any simulation ID directories in the indata, tmpdata, outdata, and logs directories which were last accessed <days> days or longer ago will be deleted. If you have a few directories you want to keep, either copy them somewhere else, or copy them to a directory name that's not all digits and they won't be deleted.
Examples
Below are some examples that you can try using the sample files in the examples directory. Make sure all the tests pass before you try this. You should be in the comps directory when you start these examples:
$> cd comps
Sample Validation Run
You don't need to move any files for this. Notice that 3D seismograms are a low-frequency option, since you're running a validation event.
$> ./run_bbp_2G.py Welcome to the SCEC Broadband Platform. Please select the modules you want to run. Do you want to perform a validation run (y/n)? y Do you want to validate with: Northridge (1) Loma Prieta (2) Landers (3) ?1 Do you want to run all validation stations (1) select a station list (2) ?1 Choose a source of low frequency seismograms: URS module (1) URS 3D seismograms (2) UCSB module (3) SDSU module (4) SDSU 3D seismograms (5) ?2 Choose a high frequency module: URS (1) UCSB (2) SDSU (3) ?1 Choose a site response module: URS (1) UCSB (2) SDSU (3) GATECH (4) ?1 Do you want to plot velocity seismograms (y/n)? y Do you want to plot acceleration seismograms (y/n)? y Choose a Goodness of Fit (GOF) Module: URS (1) SDSU (2) Both (3) ?3 Do you want to calculate all MO-GOF metrics (y/n)? y
This simulation takes about 10 hours. Once it's complete, the platform will tell you:
You can find results in <path to bbp_2g install>/outdata/<simulation ID> .
In that directory you will find:
- HTML Directory Listing(index.html)
- Velocity seismograms (<simulation ID>.<station>.bbp)
- Acceleration seismograms (<simulation ID>.<station>.acc.bbp)
- Plots of velocity seismograms (<simulation ID>.<station>_velocity_seis.png)
- Plots of acceleration seismograms (<simulation ID>.<station>_acceleration_seis.png)
- Response spectra files (<simulation ID>.<station>.rsp)
- Plots comparing simulated and observed seismograms (Northridge_<simulation ID>_<station>_overlay.png)
- Plots comparing simulated and observed response spectra (Northridge_<simulation ID>_<station>_rsp.png)
- Overall goodness-of-fit plots (gof-Northridge-<simulation ID>_r0-25.png)
- SDSU GoF file (GOF_<measure>.list and gof_summary.txt)
- SDSU GoF map plots (<simulation ID>_<Gof measure>_map.png)
- SDSU GoF overlay plots (gof_plots/<simulation ID>_<station>_match_<format>_overlay.png)
Sample Validation run, custom stations
If the validation runs aren't performed with 3D low-frequency, it can take a long time, up to 10 minutes per station. Sometimes you might want to run with a reduced station list so the simulation will run faster.
Copy the files in example/valid_custom_stations into the start directory. Take a look at the format of the station file:
$> more valid_test_stat.stl #Required: lon, lat, station name, distance to fault plane, Vs30 #Optional: low freq corner, high freq corner #Unused: station information #lon lat stationdist Vs30 LF corner HF corner station information -118.6417 34.5640 cast 20.47 450 0.120 23.0 CSMIP peer.berkeley.edu/nga -118.4180 34.0628 lacn 22.82 278 0.140 23.0 CSMIP peer.berkeley.edu/nga -118.8811 34.2886 moor 24.16 405 0.160 23.0 CSMIP peer.berkeley.edu/nga
Now, run the platform, using a station list:
$> ./run_bbp_2G.py Welcome to the SCEC Broadband Platform. Please select the modules you want to run. Do you want to perform a validation run (y/n)? y Do you want to validate with: Northridge (1) Loma Prieta (2) Landers (3) ?1 Do you want to run all validation stations (1) select a station list (2) ?2
If you have multiple station list files in your start directory, you may see the following prompt asking you to select one. If you only have one, the platform will select it automatically.
Found multiple BBP station list files in the start directory. Please select one: nr_one_stat.stl (1) valid_test_stat.stl (2) ?2 Choose a source of low frequency seismograms: URS module (1) URS 3D seismograms (2) UCSB module (3) SDSU module (4) SDSU 3D seismograms (5) ?3 Choose a high frequency module: URS (1) UCSB (2) SDSU (3) ?2 Choose a site response module: URS (1) UCSB (2) SDSU (3) GATECH (4) ?2 Do you want to plot velocity seismograms (y/n)? y Do you want to plot acceleration seismograms (y/n)? y Choose a Goodness of Fit (GOF) Module: URS (1) SDSU (2) Both (3) ?3 Do you want to calculate all MO-GOF metrics (y/n)? y
Again, when the run completes in about 15 minutes you can find results in the output directory. You'll notice far fewer files, as only 3 stations were run instead of 133. The goodness-of-fit plots won't look very good - more stations are really needed to get an accurate plot.
Sample User-defined run with source description
Next let's try running a user-defined event. Copy examples/user_rup_gen/nr_one_stat.stl and examples/user_rup_gen/user_eq.src to the start directory. user_eq.src is a simple source description. Its format is outlined in section 5.1. Since this is a user-defined event, precomputed 3D seismograms aren't a valid option.
$> ./run_bbp_2G.py Welcome to the SCEC Broadband Platform. Please select the modules you want to run. Do you want to perform a validation run (y/n)? n Do you want to run a rupture generator (y/n)? y Rupture generators: URS (1) UCSB (2) ?1 Using region: Southern California Choose a low frequency module: URS (1) UCSB (2) ?2 Found multiple BBP station list files in the start directory. Please select one: nr_one_stat.stl (1) valid_test_stat.stl (2) ?1 Choose a high frequency module: URS (1) UCSB (2) SDSU (3) ?2 Choose a site response module: URS (1) UCSB (2) SDSU (3) GATECH *Not Available* ?1 Do you want to plot velocity seismograms (y/n)? y Do you want to plot acceleration seismograms (y/n)? y Do you want to run goodness of fit (y/n)? n
Since this run only includes one station, it will run in about 5 minutes. In the output directory you'll notice there are no goodness-of-fit or files, since we didn't run goodness-of-fit. However, there is also a map file (station_map.png), showing the fault plane and the stations, and a plot of the rupture slip (user_eq.png). The SRF generated by the rupture generator is in user_eq.srf; this file could be used in future runs. The filenames of the rupture slip plot and SRF are taken from the rupture description filename.
Sample User-defined run with SRF file and goodness-of-fit
Finally, try a run with an SRF file and run goodness-of-fit on the results. Copy in examples/user_no_rup_gen/ucsb_modSRF_0.srf and examples/user_no_rup_gen/nr_three_stat.stl
$> ./run_bbp_2G.py Welcome to the SCEC Broadband Platform. Please select the modules you want to run. Do you want to perform a validation run (y/n)? n Do you want to run a rupture generator (y/n)? n Using region: Southern California Choose a low frequency module: URS (1) UCSB (2) ?1 Found multiple BBP station list files in the start directory. Please select one: nr_one_stat.stl (1) valid_test_stat.stl (2) nr_three_stat.stl (3) ?3 Choose a high frequency module: URS (1) UCSB (2) SDSU (3) ?3 Choose a site response module: URS (1) UCSB (2) SDSU (3) GATECH *Not Available* ?1 Do you want to plot velocity seismograms (y/n)? y Do you want to plot acceleration seismograms (y/n)? y Do you want to run goodness of fit (y/n)? y What reference files would you like to compare to? Enter a simulation ID or a scenario name: Northridge Enter a label to use for the comparison seismograms: nr Choose a Goodness of Fit (GOF) Module: URS (1) SDSU (2) Both (3) ?1
The reference files can either be a scenario event or a simulation ID previously run. The label is just for the figures when comparisons are plotted.
This run will take about 15 minutes, and the results can be found in the appropriate outdir. Again, the URS goodness of fit measures will look poor due to the few stations involved in the comparison. If you had fewer than 3 stations, no goodness-of-fit plots would be produced. However, response spectra comparison plots will still be generated.
File Formats
This section offers descriptions of various file formats in the broadband platform.
Simple source description
This is the format for the simple source description. It is not whitespace sensitive. The filename must end in .src for the platform to identify it as a source description.
MAGNITUDE = <magnitude> FAULT_LENGTH = <length of fault> DLEN = <DX, along length> FAULT_WIDTH = <down-dip fault width> DWID = <DY, along width> DEPTH_TO_TOP = <depth of fault below surface> STRIKE = <strike> RAKE = <rake> DIP = <dip> LAT_TOP_CENTER = <latitude of top center point in fault plane> LON_TOP_CENTER = <longitude of top center point in fault plane> HYPO_ALONG_STK = <along strike location of hypocenter (0.0 = middle)> HYPO_DOWN_DIP = <down dip location of hypocenter (0.0 = top)> DT = <dt> SEED = <random seed used in calculations> CORNER_FREQ = <corner frequency to use>
SRF rupture description
Details of the Standard Rupture Format (SRF) are given in more detail in the accompanying document. The general fault surface is represented by a distribution of point sources, and it can support one or more planes. The platform produces SRFs as output from rupture generators, but a user can also supply an SRF file as input for user-defined simulations. SRF filenames must end with the suffix .srf for the platform to correctly identify them.
Station File List
The user may specify a list of stations, matching the following format:
#optional %comment # lines <lon> <lat> <stat name> <distance to fault trace> <Vs30> <LF corner> <HF corner> <stat info> ...
The station list filename needs to end in .stl for the platform to recognize it as a station list.
BBP seismograms
All intermediate and output seismograms are produced in a 4-column text format, whether velocity or acceleration.
# optional % comment # lines <timestamp> <North/South> <East/West> <Up/Down> ...
Time is in seconds and motion is in cm/s (velocity) or cm/s/s (acceleration) unless otherwise specified in the header. Velocity filenames end in .vel.bbp; accelerations in .acc.bbp.
Response spectra
The response spectra file is in 4-column text format.
# optional % comment # lines <period (sec)> <North/South> <East/West> <Up/Down> ...
The platform samples response spectra at 112 periods, 0.01-20 sec and outputs pseudo spectral acceleration in units of g.
Option File
Option files contain responses to the prompts in the platform. You can use them with the -o option to run_bbp_2G.py. The responses have to match the prompts exactly. For example, if you craft an option file assuming there is only one station list in the start directory (and therefore the user isn't prompted to select one) but then it is run with multiple station lists in the start directory, this will cause the run to abort. Option files are recommended to perform a series of runs with different inputs or different modules. If you have a run you perform regularly, it's better practice to run the platform with the -g option and the option file to produce an XML description, which are more complete descriptions of the workflow.
#optional comments %using either symbol n #comments y % can go 1 # here ...
Use with:
$> ./run_bbp_2G.py -o <option file>
XML workflow description schema
Each time the platform is invoked, an XML file is produced describing the workflow, obeying the following schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name= "BBP_Run_Specification" minOccurs= "1" maxOccurs= "1"> <xs:attribute name="version" type = "xs:string" use = "required" /> <xs:complexType> <xs:sequence> <xs:element name= "Validation_Run" minOccurs= "0" maxOccurs = "1"> <xs:attribute name= "event" type= "xs:string" use= "required" /> <xs:attribute name= "input_station_file" type = "xs:string" /> <xs:attribute name= "subset" type = "xs:boolean" use = "required" /> </xs:element> <xs:element name= "BBP_Modules"> <xs:complexType> <xs:sequence> <xs:element name = "BBP_Module" maxOccurs = "unbounded" > <xs:complexType> <xs:sequence> <xs:element name= "name" type="xs:string" /> <xs:element name= "staged_files" > <xs:complexType> <xs:sequence> <xs:element name="file" type="xs:string" maxOccurs= "unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name= "arguments" > <xs:complexType> <xs:sequence> <xs:element name="argument" type="xs:string" maxOccurs="unbounded"> <xs:attribute name= "type" type= "xs:string" user= "required" /> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element>
These files are difficult to construct by hand, but can be generated using the -g flag when running run_bbp_2G.py.
User Support
If you run into bugs with the platform, you can open a trouble ticket at the Broadband Trac site.
Check to see if there has already been a ticket opened for the bug. If you are unable to get the platform to run, you can get direct user support by emailing software@intensity.usc.edu.
Appendix A: Troubleshooting
If you experience trouble building the platform or successfully running test and simulations, try the following solutions.
Build Errors
The instruction for installing Broadband Platform are listed in Section 1: "Installing the Second-Generation Broadband Platform" of the User guide. If after following all steps listed in this section of the user guide the build fails, check if the failure is listed in this section and try the solution to fix the issue you are facing.
Unit/Acceptance Test Failures and Errors
Unit and Acceptance tests are provided to verify the Broadband platform and it's supporting modules built by the user are functioning as designed. Under certain circumstances, some of these test might fail or print a warning message. While some of these failure might indicate serious problems that will have to be addressed before the platform can used, it is acceptable to ignore some of the failures. This section lists some failures and their solutions.