1 / 18

Southern California Earthquake Center SCEC CVM-T Walkthrough

Southern California Earthquake Center SCEC CVM-T Walkthrough. Patrick Small Research Programmer. CVM-T in a Nutshell. Improved version of CVM-H High-performance mesh generator for CVM-H/CVM-4 Visualization tools for CVMs and meshes AWP simulation to evaluate CVM-H performance.

Télécharger la présentation

Southern California Earthquake Center SCEC CVM-T Walkthrough

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Southern California Earthquake CenterSCEC CVM-TWalkthrough Patrick Small Research Programmer

  2. CVM-T in a Nutshell • Improved version of CVM-H • High-performance mesh generator for CVM-H/CVM-4 • Visualization tools for CVMs and meshes • AWP simulation to evaluate CVM-H performance

  3. Relationship Between Components

  4. Improved CVM-H • Model extended with Hadley-Kanamori 1D and Ely’s Vs30 derived GTL, with smoothing between core model, 1d, and GTL. • Command-line query tool enhanced to allow query by depth, named vx_lite. • % vx_lite [-s] [-d] [-v] < input_points > output_mat_props • Where –s option enables SCEC 1D, -d enables query by depth, and –v enables query by elevation. Default query mode is elevation offset. • Addition of a C API to the library that programs can link in to query the model directly. • Programs link in ./lib/libvxapi.a and include the header file ./src/vx_sub.h

  5. CVM-H Architecture

  6. VX API Include File (./src/vx_sub.h) /* Model source of the data */ typedefenum { VX_SRC_NR = 0, VX_SRC_HR, …, VX_SRC_GT} vx_src_t; /* Z mode selector (depth, elevation, elevation offset */ typedefenum { VX_ZMODE_ELEV = 0, VX_ZMODE_DEPTH, VX_ZMODE_ELEVOFF } vx_zmode_t; /* Coordinate type, GEO or UTM */ typedefenum { VX_COORD_GEO = 0, VX_COORD_UTM} vx_coord_t; /* Provenance of the data */ typedefenum { VX_PROV_NONE = 0, …, VX_PROV_GTL} vx_prov_t; /* Query structure */ typedefstructvx_entry_t { double coor[3], coor_utm[3]; vx_coord_tcoor_type; float elev_cell[2], topo, mtop, base, moho; vx_src_tdata_src; float vel_cell[3], provenance, vp, vs; double rho; } vx_entry_t; /* Initializer */ intvx_setup(char* data_dir); /* Get version number */ void vx_version(char *ver); /* Set Z mode to either elevation, depth, or elev offset */ void vx_setzmode(vx_zmode_t m); /* Retrieve data point in LatLon or UTM */ void vx_getcoord(vx_entry_t *entry); /* Register user-defined background model handler */ void vx_register_bkg( int (*backgrnd)(vx_entry_t *entry, vx_request_treq_type) ); /* Register SCEC bkg/topo handlers */ void vx_register_scec();

  7. vx_lite application (./src/vx_lite.c) /* Parse options */ while ((opt = getopt(argc, argv, "sdvh")) != -1) { switch (opt) { … } } if ((use_emulation) && (use_depth)) { printf("Cannot have vx emulation and depth mode both enabled!\n"); exit(1); } /* Perform setup */ if (vx_setup(".") != 0) { printf("Failed to init vx\n"); exit(1); } /* Register SCEC 1D background model */ if (use_scec) { vx_register_scec(); } if (use_emulation) vx_setzmode(VX_ZMODE_ELEV); else if (use_depth) vx_setzmode(VX_ZMODE_DEPTH); else vx_setzmode(VX_ZMODE_ELEVOFF); /* Query each point from stdin */ while (!feof(stdin)) { if (fscanf(stdin,"%lf %lf %lf", &entry.coor[0],&entry.coor[1],&entry.coor[2]) == 3) { … /* Set coordinate type */ if ((entry.coor[0]<360.) && (fabs(entry.coor[1])<90)) entry.coor_type = VX_COORD_GEO; else entry.coor_type = VX_COORD_UTM; /* Query the point */ vx_getcoord(&entry); … (Print the output to stdout) … } }

  8. Generating Meshes with cvm2mesh • MPI program that has been tested up to 2125 cores • % mpirun [mpi options] mesh-create-MPI [-icvm_source_dir] [-o final_output_mesh] –f config_file.conf • Important C source modules: • mesh-create-MPI.c: main program • proj.c: projection module that generates 2D grid in CMU/UTM • cvm.c: abstract interface for querying CVM-H/CVM-4 • mesh_writer.c: writes meshes using MPI I/O interface • xy2ll.c: GEO-CMU conversion routines • utm2geo.f90: Fortran module for GEO-UTM conversion

  9. Visualization Tools • Viz-cvm module provides scripts to produce plots from either CVM-H/CVM-4 or existing meshes: • Plots of Vp, Vs, Rho at user defined depths • Plots of Vp, Vs, Rho for vertical slices between two arbitrary lon/lat points • Plots of Vs30, Z2500 • Comparison plots showing CVM-H and CVM4 side-by-side • Difference plots showing CVM-H minus CVM4 for the property of interest

  10. Viz Tools – Slice Tool Examples • Horizontal slice, Vp at depth 0.0m • ./Slice.py hor hor_0_vp.png 0.0 Vp Both • Vertical Profile Slice for Vp between two points • ./Slice.py prof profile1_vp.png -119.292 34.431 -118.966 34.098 Vp Both

  11. Testing • CVM-H distribution has unit tests and a simple acceptance test • Automated Test Framework (cvmtest) used for earthquake scenario GoF testing. Requires components to be installed on a local machine and NICS Kraken. • Unit tests and GoF testing can be run under CruiseControl or manually on command-line

  12. Running Unit Tests Manually • CVM-H unit tests and acceptance test located in ./cvmh/trunk/test • Unit tests run with command : % ./unittest [logdir] • Acceptance tests run with command: % ./accepttest [logdir] • Test results placed in [logdir] in XML format • Many of these tests will fail when model changes are made

  13. Running GoF Tests Manually • This is a laborious process and requires knowledge of the ATF workflow outlined below. • Requires successive job submissions with qsub on NICS Kraken and the user manually monitoring their progress in the queue.

  14. Running Tests as a Workflow • Requires software to be installed on a local machine and NICS Kraken. • Local machine: Checkout of svn/cvmh and svn/cvmtest, a valid grid proxy, a basic Python install, and optionally CruiseControl • NICS Kraken: Checkout of svn/cvmtest, svn/cvm2mesh and svn/broadband, and an installation of AWP-ODC, Python with numpy, pyproj, matplotlib, basemap. • All unit tests and the ATF Chino Hills simulation can be executed from the local machine with the command: • % ./cruise/remote/AcceptTest.py • Results saved to ./cruise/web_results.tar • Example setup is configured in cvmtest@aftershock

  15. Running Workflow under CruiseControl <property name="projectbase" value="/home/scec-01/cvmtest/cruise"/> <property name="cvmhdir" value="${projectbase}/cvmh/trunk"/> <property name="testdir" value="${cvmhdir}/test/logs"/> <property name="remotedir" value="${projectbase}/remote"/> <property name="logdir" value="${cruise.home}/logs/CVM/${project.name}"/> <project name="CVMH-weekly" buildafterfailed="false" requiremodification="false"> <schedule> <!-- This test runs weekly --> <exec time="1040“ day=“Thursday” workingdir="${remotedir}" command="/usr/bin/python" args="AcceptTest.py"/> </schedule> <!-- shouldn't need since requiremodification=false, but CC bug requires it --> <modificationsetquietperiod="60"> <svnLocalWorkingCopy="${cvmhdir}"/> </modificationset> <listeners> <currentbuildstatuslistener file="${logdir}/status.txt"/> </listeners> <log dir="${logdir}"> <merge dir="${testdir}" /> <delete every="1" unit="WEEK"/> </log> <publishers> <currentbuildstatuspublisher file="${logdir}/status.txt" /> <htmlemailmailhost="localhost" returnaddress="${returnaddress}" reportsuccess="always" subjectprefix="[CruiseControl]" skipusers="true" css="/usr/local/cruise/reporting/jsp/webcontent/css/cruisecontrol.css" xsldir="/usr/local/cruise/reporting/jsp/webcontent/xsl" logdir="${logdir}"> <always address="patrices@usc.edu,sandarsh@usc.edu" /> </htmlemail> </publishers> </project>

  16. Improvements/Issues • Standardize GEO-UTM conversion codes across all CVM-T codes. Currently, CVM-H uses gctpc package, cvm2mesh uses a Fortran module, and viz tools use a Python projection package based on PROJ4. • Develop standard Unified CVM API for querying CVM-4/CVM-H programmatically. • Improve cvm2mesh scalability by partitioning meshing region in 3D (currently uses 1D partitioning), and using a programmatic interface to CVM-4 instead of forking a sub-process. • Current implementation of plotting in the testing framework will not scale to large numbers of simulations since it is run on the NICS Kraken login node. Plot generation may need to be moved to compute nodes (static Python) or to a local machine.

  17. For More Information • CVM-H model source (cvmh) https://source.usc.edu/svn/cvmh • Mesh generator source (cvm2mesh) https://source.usc.edu/svn/cvm2mesh • Automated Test Framework (cvmtest) https://source.usc.edu/svn/cvmtest • Viz tools (viz-cvm) https://source.usc.edu/svn/viz-cvm • CVM-T Documentation http://scec.usc.edu/scecpedia/CVM_Toolkit • CVM-T User Guide http://scec.usc.edu/scecpedia/CVM-T_User_Guide

  18. End

More Related