FEI Version of the Day
fei_mpiTraits.hpp
00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_mpiTraits_hpp_
00010 #define _fei_mpiTraits_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 #include <fei_defs.h>
00014 
00015 #ifndef FEI_SER
00016 
00017 namespace fei {
00018 
00021   template<class T>
00022     struct mpiTraits {};
00023 
00026   template<>
00027     struct mpiTraits<float> {
00029       static MPI_Datatype mpi_type() {return(MPI_FLOAT);};
00030     };
00031 
00034   template<>
00035     struct mpiTraits<double> {
00037       static MPI_Datatype mpi_type() {return(MPI_DOUBLE);};
00038     };
00039 
00042   template<>
00043     struct mpiTraits<int> {
00045       static MPI_Datatype mpi_type() {return(MPI_INT);};
00046     };
00047 
00050   template<>
00051     struct mpiTraits<long> {
00053       static MPI_Datatype mpi_type() {return(MPI_LONG);};
00054     };
00055 
00056 #ifdef EIGHT_BYTE_GLOBAL_ID
00057 
00059   template<>
00060     struct mpiTraits<GlobalID> {
00062       static MPI_Datatype mpi_type() {return(MPI_LONG_LONG);};
00063     };
00064 #endif
00065 
00066 } //namespace fei
00067 
00068 #endif //FEI_SER
00069 
00070 #endif // _fei_mpiTraits_hpp_
00071 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends