
The Matrix LibraryThe scientific computing matrix library (SCMAT) is designed around a set of matrix abstractions that permit very general matrix implementations. This flexibility is needed to support diverse computing environments. For example, this library must support, at a minimum: simple matrices that provide efficient matrix computations in a uniprocessor environment, clusters of processors with enough memory to store all matrices connected by a relatively slow network (workstations on an LAN), clusters of processors with enough memory to store all matrices and a fast interconnect network (a massively parallel machine such as the Intel Paragon), and clusters of machines that don't have enough memory to hold entire matrices.
OverviewThe design of SCMAT differs from other objectoriented matrix packages in two important ways. First, the matrix classes are abstract base classes. No storage layout is defined and virtual function calls must be used to access individual matrix elements. This would have a negative performance impact if users needed to frequently access matrix elements. The interface to the matrix classes is hopefully rich enough to avoid individual matrix element access for any computationally significant task. The second major difference is that symmetric matrices do not inherit from matrices, etc. The SCMAT user must know whether a matrix is symmetric at all places it is used if any performance gain, by virtue of symmetry, is expected. Dimension information is contained objects of the SCDimension type. In addition to the simple integer dimension, application specific blocking information can be provided. For example, in a quantum chemistry application, the dimension corresponding to the atomic orbital basis set will have block sizes that correspond to the shells. Dimensions are used to create new matrix or vector objects. The primary abstract classes are SCMatrix, SymmSCMatrix, DiagSCMatrix, and SCVector. These represent matrices, symmetric matrices, diagonal matrices, and vectors, respectively. These abstract classes are specialized into groups of classes. For example, the locally stored matrix implementation specializes the abstract classes to LocalSCMatrix, LocalSymmSCMatrix, LocalDiagSCMatrix, LocalSCVector, LocalSCDimension, and LocalSCMatrixKit. These specializations are all designed to work with each other. However, a given specialization is incompatible with other matrix specializations. An attempt to multiply a local matrix by a distributed matrix would generate an error at runtime. Since the different groups of classes do not interoperate, some mechanism of creating consistent specializations is needed. This is done with SCMatrixKit objects. SCMatrixKit is an abstract base type which has specializations that correspond to each group of the matrix specializations. It is used to create matrices and vectors from that group. For example, the DistSCMatrixKit is used to create objects of type DistSCMatrix, DistSymmSCMatrix, DistDiagSCMatrix, and DistSCVector. The abstract matrix classes and their derivations are usually not directly used by SCMAT users. The most convenient classes to use are the smart pointer classes RefSCMatrix, RefSymmSCMatrix, RefDiagSCMatrix, and RefSCDimension. These classes respectively inherit from Ref<SCMatrix>, Ref<SymmSCMatrix>, Ref<DiagSCMatrix>, and Ref<SCDimension>, providing automatic memory management through reference counting. The smart pointer classes also have matrix operations such as operator *(), operator(), and operator+() defined as members for convenience. These forward the operations to the contained matrix object. The smart pointer classes also simplify creation of matrices by providing constructors that take as arguments one or more RefSCDimension's and a Ref<SCMatrixKit>. These initialize the smart pointer to contain a new matrix with a specialization corresponding to that of the Ref<SCMatrixKit>. Matrix operations not provided by the smart pointer classes but present as member in the abstract classes can be accessed with operator>(). If a needed matrix operation is missing, mechanisms exist to add more general operations. Operations which only depend on individual elements of matrices can be provided by specializations of the SCElementOp class. Sometimes we need operations on matrices with identical dimensions that examine each element in one matrix along with the corresponding element from the other matrix. This is accomplished with SCElementOp2 for two matrices and with SCElementOp3 for three. Other features of SCMAT include runtime type facilities and persistence. Castdown operations (type conversions from less to more derived objects) and other runtime type information are provided by the DescribedClass base class. Persistence is not provided by inheriting from SavableState base clase as is the case with many other classes in the SC class hierarchies, because it is necessary to save objects in an implementation independent manner. If a calculation checkpoints a matrix on a single processor machine and later is restarted on a multiprocessor machine the matrix would need to be restored as a different matrix specialization. This is handled by saving and restoring matrices' and vectors' data without reference to the specialization. The following include files are provided by the matrix library:
Matrix DimensionsIn addition to the simple integer dimension, objects of the SCDimension class contain application specific blocking information. This information is held in an object of class SCBlockInfo. Matrix Reference ClassesThe easiest way to use SCMAT is through the smart pointer classes RefSCMatrix, RefSymmSCMatrix, RefDiagSCMatrix, RefSCVector, RefSCDimension, and Ref<SCMatrixKit>. These are based on the Ref reference counting package and automatically delete matrix objects when they are no longer needed. These reference classes also have common operations defined as members for convenience. This makes it unnecessary to also use the sometimes awkward syntax of operator>() to manipulate the contained objects. Abstract Matrix ClassesThis section documents the primary abstract classes: SCMatrix, SymmSCMatrix, DiagSCMatrix, and SCVector, as well as the SCMatrixKit class which allows the programmer to generate consistent specializations of matrices. These represent matrices, symmetric matrices, diagonal matrices, and vectors, respectively. This section is primarily for implementers of new specializations of matrices. Users of existing matrices will be most interested in the matrix reference classes. Matrix StorageAll elements of matrices and vectors are kept in blocks. The choice of blocks and where they are keep is left up to each matrix specialization. Manipulating Matrix Elements with Element OperationsThe SCElementOp, SCElementOp2, and SCElementOp3 classes can be used to maniupulate matrix elements. SCElementOp SpecializationsSeveral commonly needed element operations are already coded up and available by including math/scmat/elemop.h. Below are descriptions of these classes:
Local MatricesLocal matrices do no communication. All elements reside on each node and all computations are duplicated on each node. Replicated MatricesReplicated matrices hold all of the elements on each node, however do some communications in order to reduce computation time. Distributed MatricesDistributed matrices spread the elements across all the nodes and thus require less storage than local matrices however these use more communications than replicated matrices. Blocked MatricesBlocked matrices are used to implement point group symmetry. Another matrix specialization is used to hold the diagonal subblocks of a matrix. The offdiagonal subblocks are known to be zero and not stored. This results in considerable savings in storage and computation for those cases where it applies.
Generated at Fri Jan 10 08:14:10 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14. 