Trilinos 101: Getting Started with Trilinos November 6, 2007 8:30-9:30 a.m. Jim Willenbring Mike Heroux (Presenter)

Slides:



Advertisements
Similar presentations
Configuration management
Advertisements

Configuration management
ECE 454 Computer Systems Programming Compiler and Optimization (I) Ding Yuan ECE Dept., University of Toronto
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Inpainting Assigment – Tips and Hints Outline how to design a good test plan selection of dimensions to test along selection of values for each dimension.
Test-Driven Development and Refactoring CPSC 315 – Programming Studio.
Introduction to C Programming
Sets and Maps Chapter 9. Chapter 9: Sets and Maps2 Chapter Objectives To understand the Java Map and Set interfaces and how to use them To learn about.
Chapter 14 Generics and the ArrayList Class Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Parallelizing Compilers Presented by Yiwei Zhang.
Computer Science 1620 Programming & Problem Solving.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
Overview of Tests in Blackboard. Benefits of Blackboard Testing.
Epetra Concepts Data management using Epetra Michael A. Heroux Sandia National Laboratories Sandia is a multiprogram laboratory operated by Sandia Corporation,
MS17 A Case Study on the Vertical Integration of Trilinos Solver Algorithms with a Production Application Code Organizer: Roscoe A. Bartlett Sandia National.
SCRAM Software Configuration, Release And Management Background SCRAM has been developed to enable large, geographically dispersed and autonomous groups.
Solving Scalar Linear Systems Iterative approach Lecture 15 MA/CS 471 Fall 2003.
Introduction to Shell Script Programming
1 I-Logix Professional Services Specialist Rhapsody IDF (Interrupt Driven Framework) CPU External Code RTOS OXF Framework Rhapsody Generated.
Software Tools and Processes Training and Discussion October 16, :00-4:30 p.m. Jim Willenbring.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Trilinos 101: Getting Started with Trilinos November 7, :30-9:30 a.m. Mike Heroux Jim Willenbring.
Department of Computer Science and Engineering, HKUST 1 HKUST Summer Programming Course 2008 Recursion.
Trilinos Package Summary ObjectivePackage(s) Discretizations Meshing & Spatial DiscretizationsphdMesh, Intrepid, Pamgen Time IntegrationRythmos Methods.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
PyTrilinos: A Python Interface to Trilinos Bill Spotz Sandia National Laboratories Reproducible Research in Computational Geophysics August 31, 2006.
Page 1 Trilinos Software Engineering Technologies and Integration Numerical Algorithm Interoperability and Vertical Integration –Abstract Numerical Algorithms.
Trilinos 101 (Part II) Creating and managing linear algebra data in Trilinos: Data management using Epetra and Teuchos Michael A. Heroux Sandia National.
Amesos Sparse Direct Solver Package Ken Stanley, Rob Hoekstra, Marzio Sala, Tim Davis, Mike Heroux Trilinos Users Group Albuquerque 3 Nov 2004.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring Mike Phenow.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Pointers OVERVIEW.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
An Overview of Epetra Michael A. Heroux Sandia National Labs.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Amesos Interfaces to sparse direct solvers October 15, :30 – 9:30 a.m. Ken Stanley.
New Features in ML 2004 Trilinos Users Group Meeting November 2-4, 2004 Jonathan Hu, Ray Tuminaro, Marzio Sala, Michael Gee, Haim Waisman Sandia is a multiprogram.
1 Stratimikos Unified Wrapper to Trilinos Linear Solvers and Preconditioners Roscoe A. Bartlett Department of Optimization & Uncertainty Estimation Sandia.
Epetra Tutorial Michael A. Heroux Sandia National Laboratories
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Teuchos: Utilities for Developers & Users November 2nd, 3:30-4:30pm Roscoe Bartlett Mike Heroux Kris Kampshoff Kevin Long Paul Sexton Heidi.
Trilinos 102: Advanced Concepts November 7, :30-9:30 a.m. Mike Heroux Jim Willenbring.
Trilinos Framework Update Roscoe A. Bartlett James M. Willenbring Michael N. Phenow Trilinos User Group Monday, October 31st, : :30 am Building.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA
Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.
Processes and Virtual Memory
File Systems cs550 Operating Systems David Monismith.
Getting Started with Trilinos October 14, :30-10:30 a.m. Jim Willenbring.
1 Becoming More Effective with C++ … Day Two Stanley B. Lippman
Photos placed in horizontal position with even amount of white space between photos and header Sandia National Laboratories is a multi-program laboratory.
Combining Trilinos Packages To Solve Linear Systems Michael A. Heroux Sandia National Labs.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
Sets and Maps Chapter 9. Chapter Objectives  To understand the Java Map and Set interfaces and how to use them  To learn about hash coding and its use.
What’s New for Epetra Michael A. Heroux Sandia National Laboratories Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA Shirley Moore CPS5401 Fall 2013 svmoore.pbworks.com November 12, 2012.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Text2PTO: Modernizing Patent Application Filing A Proposal for Submitting Text Applications to the USPTO.
DOE/Office of Science/ASCR (Sandia National Laboratories)
Course Contents KIIT UNIVERSITY Sr # Major and Detailed Coverage Area
APPENDIX a WRITING SUBROUTINES IN C
Matlab Training Session 4: Control, Flow and Functions
Software Testing With Testopia
Instructor: Prasun Dewan (FB 150,
Operation System Program 4
Trilinos Software Engineering Technologies and Integration
SPL – PS1 Introduction to C++.
Presentation transcript:

Trilinos 101: Getting Started with Trilinos November 6, :30-9:30 a.m. Jim Willenbring Mike Heroux (Presenter)

Overview, Part I  Trilinos Web Page  Obtaining Trilinos  Tools for Users  Mailman  Bugzilla  Configuring  General configure options  Platform and machine specific configure options  Troubleshooting  Building and Installing  Testing  Improving Efficiency (of the build process)  Linking to Trilinos Libraries

The Trilinos Home Page  Highlights of the web page  Download page  User documentation Getting started page User guide FAQ Individual package documentation ‘runtests’ make target documentation External package capability

 Instructions for obtaining Trilinos are available in  the Trilinos User Guide  Download from the website  Obtain a copy from the CVS repository Work through existing Trilinos developer. Not available for all users Obtaining Trilinos

Tools for Users  Mailman  Users are encouraged to sign up for Users lists for Trilinos and packages of interest Announce lists for Trilinos and packages of interest  To sign up for a list, go to Replace with the name of the list, for example, trilinos-users  For general questions

Tools for Users (cont.)  Bugzilla  Issue tracking tool  Accounts for users outside of Sandia require approval  Can be used to report bugs or request new features  Please provide as much detail as possible (For example: Platform, OS, compiler versions, configure options, version of Trilinos, etc.)

Trilinos Package Summary ObjectivePackage(s) Discretizations Meshing & Spatial DiscretizationsphdMesh, Intrepid Time IntegrationRythmos Methods Automatic DifferentiationSacado Mortar MethodsMoertel Core Linear algebra objectsEpetra, Jpetra, Tpetra Abstract interfacesThyra, Stratimikos, RTOp Load BalancingZoltan, Isorropia “Skins”PyTrilinos, WebTrilinos, Star-P, ForTrilinos C++ utilities, (some) I/OTeuchos, EpetraExt, Kokkos, Triutils Solvers Iterative (Krylov) linear solversAztecOO, Belos, Komplex Direct sparse linear solversAmesos Direct dense linear solversEpetra, Teuchos, Pliris Iterative eigenvalue solversAnasazi ILU-type preconditionersAztecOO, IFPACK Multilevel preconditionersML, CLAPS Block preconditionersMeros Nonlinear system solversNOX, LOCA Optimization (SAND)MOOCHO, Aristos

Configuring Trilinos  More configuration details in the User Guide  Trilinos uses Autoconf and Automake  Don’t just try “configure, make, make install”  This will fail in almost every case  Result unlikely to be satisfactory if it works (ex MPI/serial)  Use --disable-default-packages  Enable packages (--enable- )

Configuring Trilinos (cont.)  To see all options for a package:  cd ./configure --help  Example configure invocation scripts customizations will be necessary Trilinos/sampleScripts/ For example redStorm_mpi_reddish1 Users are encouraged to submit their scripts

Configuring Trilinos (cont.)  Example invoke configure file for reddish: module load PrgEnv-pgi module load mpich../configure --enable-mpi \ CXX=mpicxx CC=mpicc F77=mpif77 \ CPPFLAGS="-tp k8-64 -lacml -lpgmp -lpgthread" \ --with-blas="-L/usr/pgi-6.0/linux86-64/6.0/lib -lacml -lpgmp -lpgthread" \ --with-lapack="-L/usr/pgi-6.0/linux86-64/6.0/lib -lacml" \ --enable-ml \ --disable-default-packages #The lines before../configure load the proper environment

Configuring Trilinos (cont.)  Platform and machine specific options module load PrgEnv-pgi module load mpich../configure --enable-mpi \ CXX=mpicxx CC=mpicc F77=mpif77 \ CPPFLAGS="-tp k8-64 -lacml -lpgmp -lpgthread" \ --with-blas="-L/usr/pgi-6.0/linux86-64/6.0/lib -lacml -lpgmp - lpgthread" \ --with-lapack="-L/usr/pgi-6.0/linux86-64/6.0/lib -lacml" \ --enable-ml \ --disable-default-packages

Configuring Trilinos (cont.)  Troubleshooting  Most errors are due to system configurations  Look for errors in the invoke-configure –Autoconf is not able to detect spelling errors. ) –Line continuation problems (ex --enable-mpi \ )  Look at the correct config.log file (created at configure time) Default error output is very, very poor – often misleading Use to the package level config.log file (not the top level config.log file). For example: configure: error: /bin/sh '../../../packages/epetra/configure' failed for packages/epetra indicates that one should look at packages/epetra/config.log

Troubleshooting using config.log  The config.log file is very long  To find what you need, search for the string “Cache” ## ## ## Cache variables. ## ## ##  The error that caused the configure failure can be found above this point, but typically not directly above

Working Through a config.log File  Here is a common configure error  error: Cannot find lapack library, specify a path using --with- ldflags=-I (ex. --with-dlflags=-I/usr/path/lib) or a specific library using --with-lapack=DIR/LIB (ex. --with- lapack=/usr/path/lib/libcxml.a)  Look for last successful configure check  In this case it would be a BLAS check  Directly beneath that check will be the failed check  Could be Missing library (undefined symbol) Incorrect path ??

Building and Installing Trilinos  To build Trilinos type make everything  To install Trilinos type make install

Testing  Tests can be run individually after compilation  ‘runtests’ make targets  To run the test suite (the tool will only attempt to run tests that were built), after "make“, type make runtests-serial  Can run tests for individual packages

Testing  ‘runtests’ make targets  For MPI use make runtests-mpi Must specify TRILINOS_MPI_GO in the environment or as an argument to make make runtests-mpi TRILINOS_MPI_GO="'mpiexec -np '"  Trilinos/commonTools/test/utilities/runtests –help  Installation Tests  Make a good “linking” test  /examples

Improving Efficiency  Also discussed in the Trilinos User Guide  Build only the packages that are needed  After Trilinos has been ported to a machine ‘make’ instead of ‘make everything’  make –j n n is the number of jobs to create Not supported by all versions of “make”  --cache-file=config.cache, or simply -C./configure -C … Be sure to blow away if errors occur Some put removal command in invoke-configure

Linking to Trilinos Libraries  Makefile.export system makes linking easy  Files created in the include directory during install  Makefile.export. files Useful macros _INCLUDES _LIBS  Makefile.export..macros files More macros including _CXXFLAGS _CXX  Use the macros in application makefiles

Linking to Trilinos Libraries  Example: TRILINOS_PREFIX=/common/Trilinos/8.0.4 include $(TRILINOS_PREFIX)/include/Makefile.export.epetra.macrosMakefile.export.epetra.macros include $(TRILINOS_PREFIX)/include/Makefile.export.epetraMakefile.export.epetra INCDIR=$(EPETRA_INCLUDES) LIBDIR=$(EPETRA_LIBS) CXXFLAGS=$(INCDIR) $(EPETRA_CXXFLAGS) $(EPETRA_DEFS) CXX= $(EPETRA_CXX)  Include one Makefile.export. file for every directly used package

Common Pitfalls  --with-gnumake  Compiler/library version mismatches  __gxx__personality  gfortran or g77  Upgrading system and not recompiling 3PL’s  Linking to BLAS/LAPACK  Typo’s in configure arguments

Where to Find Help  Getting started link  Online FAQ section  Trilinos User Guide

Where to Find Help (cont.)  Submitting a bug report or feature request  Please provide as much detail as possible  Attach the appropriate config.log if applicable  For general questions  Trilinos Home Page

Discussion  Questions, comments?

Trilinos 101 (Part II) Creating and managing linear algebra data in Trilinos: Data management using Epetra Michael A. Heroux Sandia National Laboratories Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract DE-AC04-94AL85000.

Outline  Creating Objects.  Performance Optimizations.  Tutorial: Didasko  Demo working with Epetra and Didasko.

// Header files omitted… int main(int argc, char *argv[]) { MPI_Init(&argc,&argv); // Initialize MPI, MpiComm Epetra_MpiComm Comm( MPI_COMM_WORLD ); A Simple Epetra/AztecOO Program // ***** Create x and b vectors ***** Epetra_Vector x(Map); Epetra_Vector b(Map); b.Random(); // Fill RHS with random #s // ***** Create an Epetra_Matrix tridiag(-1,2,-1) ***** Epetra_CrsMatrix A(Copy, Map, 3); double negOne = -1.0; double posTwo = 2.0; for (int i=0; i<NumMyElements; i++) { int GlobalRow = A.GRID(i); int RowLess1 = GlobalRow - 1; int RowPlus1 = GlobalRow + 1; if (RowLess1!=-1) A.InsertGlobalValues(GlobalRow, 1, &negOne, &RowLess1); if (RowPlus1!=NumGlobalElements) A.InsertGlobalValues(GlobalRow, 1, &negOne, &RowPlus1); A.InsertGlobalValues(GlobalRow, 1, &posTwo, &GlobalRow); } A.FillComplete(); // Transform from GIDs to LIDs // ***** Map puts same number of equations on each pe ***** int NumMyElements = 1000 ; Epetra_Map Map(-1, NumMyElements, 0, Comm); int NumGlobalElements = Map.NumGlobalElements(); // ***** Report results, finish *********************** cout << "Solver performed " << solver.NumIters() << " iterations." << endl << "Norm of true residual = " << solver.TrueResidual() << endl; MPI_Finalize() ; return 0; } // ***** Create/define AztecOO instance, solve ***** AztecOO solver(problem); solver.SetAztecOption(AZ_precond, AZ_Jacobi); solver.Iterate(1000, 1.0E-8); // ***** Create Linear Problem ***** Epetra_LinearProblem problem(&A, &x, &b); // Header files omitted… int main(int argc, char *argv[]) { Epetra_SerialComm Comm();

Typical Flow of Epetra Object Construction Construct Comm Construct Map Construct x Construct b Construct A Any number of Comm objects can exist. Comms can be nested (e.g., serial within MPI). Maps describe parallel layout. Maps typically associated with more than one comp object. Two maps (source and target) define an export/import object. Computational objects. Compatibility assured via common map.

Trilinos/packages/epetraext/test/inout/ (Part 1) EpetraExt::BlockMapToMatrixMarketFile("Test_map.mm", *map, "Official EpetraExt test map", "This is the official EpetraExt test map generated by the EpetraExt regression tests"); EpetraExt::RowMatrixToMatrixMarketFile("Test_A.mm", *A, "Official EpetraExt test matrix", "This is the official EpetraExt test matrix generated by the EpetraExt regression tests"); EpetraExt::VectorToMatrixMarketFile("Test_x.mm", *x, "Official EpetraExt test initial guess", "This is the official EpetraExt test initial guess generated by the EpetraExt regression tests"); EpetraExt::VectorToMatrixMarketFile("Test_xexact.mm", *xexact, "Official EpetraExt test exact solution", "This is the official EpetraExt test exact solution generated by the EpetraExt regression tests"); EpetraExt::VectorToMatrixMarketFile("Test_b.mm", *b, "Official EpetraExt test right hand side", "This is the official EpetraExt test right hand side generated by the EpetraExt regression tests");

Trilinos/packages/epetraext/test/inout/ (part 2) Epetra_Map * map1; Epetra_CrsMatrix * A1; Epetra_Vector * x1; Epetra_Vector * b1; Epetra_Vector * xexact1; EpetraExt::MatrixMarketFileToMap("Test_map.mm", comm, map1); if (map->SameAs(*map1)) if (verbose) cout << "Maps are equal. In/Out works." << endl; else if (verbose) cout << "Maps are not equal. In/Out fails." << endl; // Read Matrix: EpetraExt::MatrixMarketFileToCrsMatrix("Test_A.mm", *map1, A1); // Alternates: EpetraExt::MatrixMarketFileToCrsMatrix("Test_A.mm", comm, A1); // Only need comm EpetraExt::MatlabFileToCrsMatrix("Test_A.dat", comm, A1); // Read (row,col,val) (no MM header). // Read Vector (Equivalent MultiVector versions. EpetraExt::MatrixMarketFileToVector("Test_x.mm", *map1, x1); EpetraExt::MatrixMarketFileToVector("Test_xexact.mm", *map1, xexact1); EpetraExt::MatrixMarketFileToVector("Test_b.mm", *map1, b1);

Inout Summary  Reads from/writes to Matlab or Matrix Market compatible files.  Works for any distributed map, matrix, vector or multivector.  If map is read in on the same number of processor it was written to, the map layout will be preserved.

Epetra Performance Optimization Guide SAND  Topics:  3rd Party Libraries: BLAS and LAPACK  Epetra_MultiVector Data Layout  Epetra_CrsGraph Construction  Epetra_CrsMatrix Construction  Selecting the Right Sparse Matrix Class  Parallel Data Redistribution  General Practices  Tiered Approach to practices.

Practice Categories VSR SR R Each practice falls into one of three categories: Very Strongly Recommended - Practices necessary for Epetra to perform well. Strongly Recommended - Practices that are definitely a good thing or that have proved to be valuable. Recommended - Practices that are probably a good idea.

Epetra Computational Classes  Epetra contains base class Epetra_CompObject.  Small class, but classes that derive from it are exactly those which are the focus of guide.

Fast BLAS  Link to high-performance BLAS for Epetra_MultiVector, Epetra_VbrMatrix and Epetra_SerialDense performance  Options:  Atlas (All platforms).  GOTO BLAS (PC).  vecLib (Mac).  Native BLAS on legacy platforms. VSR

Epetra_MultiVector Layout  Create Epetra_MultiVector objects with strided storage.  Improved block vector updates, block dot products.  Improve sparse matrix multiplication/solves. VSR

Epetra_CrsGraph/Matrix Construction  Construct Epetra_CrsGraph objects first:  When constructing multiple Epetra_CrsMatrix or Epetra_VbrMatrix objects, much of the overhead in sparse matrix construction is related solely to the graph structure of the matrix.  By pre-constructing the Epetra_CrsGraph object, this expense is incurred only once and then amortized over multiple matrix constructions.  Note: Even when constructing a single matrix, it is often the case that matrix construction is done within a nonlinear iteration or a time-stepping iteration. In both of these cases, it is best to construct the Epetra_CrsGraph object one time and then reuse it.  When constructing Epetra_CrsGraph/matrix objects, carefully manage the nonzero profile and set StaticProfile to ‘true’ :  Although it is very convenient to use the flexible insertion capabilities of Epetra_CrsGraph/Matrix, the performance and memory cost can be substantial.  StaticProfile is an optional argument to the Epetra_CrsGraph/Matrix constructors that forces the constructor to pre-allocate all storage for the graph, using the argument NumIndicesPerRow as a strict upper limit on the number of indices that will be inserted.  After calling FillComplete(), call OptimizeStorage() [Now automatic]:  The OptimizeStorage() method frees memory that is used only when submitting data to the object.  Also, the storage that remains is packed for better cache memory performance due to better spatial locality.  If StaticProfile is true, the packing of data is fast and cheap, if needed at all.  If StaticProfile is false, then the graph data is not contiguously stored, so we must allocate contiguous space for all entries, copy data from the existing arrays, and then delete the old arrays. This can be a substantial overhead in memory costs and could even double the high- water memory mark. However, the performance improvement for matrix operations can be 20% to a full doubling of performance. VSR

Epetra_CrsGraph/Matrix (cont)  Use Epetra_FECrsMatrix if you have many repeated indices. Then extract the associated Epetra_CrsGraph for subsequent use:  Although there is no Epetra_FECrsGraph class (something that we may introduce in the future), it is typically best to use the Epetra_FECrsMatrix class to construct matrices when you have many repeated indices.  This is typically the case when forming global stiffness matrices from local element stiffness matrices in a finite element assembly loop.  Note: Even though there is no Epetra_FECrsGraph class, once an Epetra_FECrsMatrix has been constructed, call it myFEMatrix, there is an Epetra_CrsGraph that can be accessed via myFEMatrix.Graph() and used to construct further matrices that have the same pattern as myFEMatrix.  When inserting indices into Epetra_CrsGraph/Matrix objects, avoid large numbers of repeated indices:  To reduce time costs, indices that are inserted into a row are not checked for redundancy at the time they are inserted. Instead, when FillComplete() is called, indices are sorted and then redundant indices are removed.  Because of this approach, repeated indices increase the memory used by a given row, at least until FillComplete() is called.  Submit large numbers of graph/matrix indices at once:  When inserting indices, submit many entries at once if possible.  Ideally, it is best to submit all indices for a given row at once. VSR SR

Picking a Sparse Matrix Class  Epetra_CrsMatrix: Compressed Row Storage scalar entry matrix.  Epetra_FECrsMatrix: Finite Element Compressed Row Storage matrix.  Epetra_VbrMatrix: Variable Block Row block entry matrix.  Epetra_FEVbrMatrix: Finite Element Variable Block Row matrix.  Note: Epetra_JadOperator does not implement Epetra_RowMatrix, but is worth mentioning for users of vector processors. This class is a first version to support vectorization of sparse matrix-vector multiplication.

Picking a Sparse Matrix Class (cont)  Use Epetra_FEVbrMatrix to construct a matrix with dense block entries and repeated summations into block entries  Use Epetra_VbrMatrix to construct a matrix with dense block entries and few repeated submissions:  Block entries should be of size 4 or larger before Vbr formats are preferable to Crs formats.  Use Epetra_FECrsMatrix to construct a matrix with scalar entries and repeated summations into entries:  Epetra_FECrsMatrix is designed to handle problems such as finite element, finite volume or finite difference problems where a single degree of freedom is being tracked at a single mesh point, and the matrix entries are being summed into the global stiffness matrix one finite element or control volume cell at a time.  Use Epetra_CrsMatrix in all other cases:  Epetra_CrsMatrix is the simplest and most natural matrix data structure for people who are used to thinking about sparse matrices. Unless you have one of the above three situations, you should use Epetra_CrsMatrix.  Use Epetra_RowMatrix to access matrix entries:  If you are writing code to use an existing Epetra sparse matrix object, use the Epetra_RowMatrix interface to access the matrix.  This will provide you compatibility with all of Epetra’s sparse matrix classes, and allow users of your code to provide their own custom implementation of Epetra_RowMatrix if needed. VSR R

Other RowMatrix adapters  In addition, there are numerous other implementation of Epetra_RowMatrix provided in other packages. For example:  Epetra_MsrMatrix: This class is provided within AztecOO. The constructor for Epetra_MsrMatrix takes a single argument, namely an existing AZ_DMSR matrix. Epetra_MsrMatrix does not make a copy of the Aztec matrix. Instead it make the Aztec matrix act like an Epetra_RowMatrix object.  Ifpack Filters: Ifpack uses the Epetra_RowMatrix interface to provide modified views of existing Epetra_RowMatrix objects. For example, Ifpack_DropFilter creates a new Epetra_RowMatrix from an existing one by dropping all matrix values below a certain tolerance.

Parallel Data Redistribution  Use Isorropia to balance load:  Although an advanced feature, any serious use of Epetra for scalable performance must ensure that work and data are balanced across the parallel machine.  Isorropia provides an interface to the Zoltan library that can greatly improve the load balance for typical sparse matrix computations.  Use Epetra_OffsetIndex to improve performance of multiple redistributions:  Often the data distribution that is optimal for constructing sparse matrices is not optimal for solving the related system of equations.  As a result, the matrix will be constructed in one distribution, and then redistributed for the solve.  Epetra_OffsetIndex precomputes the offsets for the redistribution pattern, making repeated redistributions cheaper.

General Practices  Check method return codes:  Almost all methods of Epetra classes provide an integer return argument.  This argument is set to zero if no errors or warning occurred.  However, a number of performance-sensitive methods will communicate potential performance problems by returning a positive error code.  For example, if the matrix insertion routine must re-allocate memory because the allocated row storage is too small, a return code of 1 is set. Since memory reallocation can be expensive, this information can be an indication that the user should increase the nonzero profile values (NumEntriesPerRow).  Compile Epetra with aggressive optimization:  Epetra performance can benefit greatly from aggressive compiler optimization settings.  In particular, aggressive optimization for FORTRAN can be especially important. Configuring Epetra (or Epetra as part of Trilinos) with the following compiler flags works well on 32-bit PC platforms with the GCC compilers:../configure CXXFLAGS="-O3" CFLAGS="-O3" \ FFLAGS="-O5 -funroll-all-loops -malign-double"

The Trilinos Tutorial Package  Trilinos is large (and still growing…)  More than 900K code lines  Many packages a lot of functionalities… … and also a lot to learn  What is the best way for a new user to learn Trilinos?  Using a Trilinos package of course: Didasko!

Didasko Contents  Tutorial document:  Tiered intro to Trilinos: Best way to get started.  16 chapters covering: Epetra, EpetraExt, Triutils, AztecOO, Belos, IFPACK, Teuchos, ML, Amesos, Anasazi, NOX, Zoltan, Tpetra.  Available from Trilinos website.  Working code:  62 example programs.

What DIDASKO is not  DIDASKO, as a tutorial, cannot cover the most advanced features of Trilinos:  Only the “stable” features are covered.  Turn on (global) : --enable-didasko.  Turn on (package) --enable-package-name: configure --enable-didasko --enable-epetra turns on Didasko Epetra examples.  DIDASKO is not a substitute of each package’s documentation and examples, which remain of fundamental importance.

Remainder of time  Walk through the use of Trilinos.  Focus on Epetra, Didasko.