[Trilinos-Users] TPetra for different types

Baker, Christopher G. bakercg at ornl.gov
Mon Nov 15 13:47:23 MST 2010


Hello Andrea,

I have experimented with more interesting scalar types in Tpetra. Unfortunately, at the moment it exists as a very advanced use case, and we do not provide any examples; this is something that needs to be remedied. Some thoughts are below, regarding the capabilities that might be possible and those that definitely are not.

Simply handing the communication aspect for Tpetra with a variable size data type would be complicated. This has to do not only with the variable size, but also with the dynamic nature of a SerialDenseVector (SDV). This is because the SDV object consists of a pointer and a few integers; therefore, to serialize the objects for communication between nodes, the data for the Vector needs to be copied appropriately; at the very least, this is an inefficient operation. Having said that, it may be possible to exploit Tpetra for the distribution of "thick" scalar types. We need to set down some examples which demonstrate the requirements for using Tpetra in this capacity, if it is possible and advisable to do so.

Assuming that the communication/distribution issues are handled, the use of thick scalar types for arithmetic in Tpetra is not, in general, supported (even for statically sized types). The reason is that arithmetic operations on Tpetra objects are only well-defined for scalar types which are a field, in the mathematical sense. Otherwise, for a thick scalar like SerialDenseVector<T>, it is always necessary to distinguish between the SerialDenseVector<T> as an object and as a collection of objects. For example, how do we define the inner product of two Tpetra::Vector< SerialDenseVector<float> > objects? Ideally, it would return a float, as long as the sizes of the SDV objects were appropriate (something that must be dealt with at runtime, via exceptions). Under the current Tpetra interface, it must return a SerialDenseVector<float>, of length 1. This requires adding ScalarTraits<> support for conjugate(), which transposes vector to allow the inner product of two SDV of length N into a SDV of length 1. The resulting SDV of length 1 can be multiplied against other SDV objects, but is it sensible to add it another SDV whose length is not 1? Perhaps we could make a special exception, so that a SDV<T> of length 1 is always treated as a T... and these sorts of exceptions keep piling up until the Tpetra interface is a mess.

If the scalar type is a well-defined field, then the Tpetra object is well-defined. However, unless the class employs sophisticated techniques (such as expression templates), the efficiency is poor, because the arithmetic is implemented two objects at a time using the overloaded arithmetic operators, which creates an excess of temporaries.

I have create a feature backlog/story to collect the features needed to support the use of Tpetra for communicating thick, variable- and statically-sized scalars. This will entail the creation of some documenting examples. However, I expect that arithmetic using Tpetra objects over thick scalars will not be supported for quite some time. Our energy for those use cases is probably better spent supporting the Tpetra block objects (BlockCrsMatrix and BlockMultiVector).

Feel free to continue this discussion on the tpetra-users at software.sandia.gov list.

Chris


On 11/14/10 2:10 PM, "andrea3.villa at mail.polimi.it" <andrea3.villa at mail.polimi.it> wrote:

Hello, I have followed with interest the discussion regarding the
possibility of using Tpetra as a distribution device for a general
type that implements the scalarTraits, the serializationTraits and the
basic algebraic operations.

I was wondering: would Tpetra  work also with a variable size type
such as the serialDenseVector?

Moreover  can you suggest me some documents or just examples where the
  serializationTraits is specialized for a new kind of type?

Thank you very much.
Best regards,
Andrea

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov
http://software.sandia.gov/mailman/listinfo/trilinos-users






More information about the Trilinos-Users mailing list