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<char> {
00029       static MPI_Datatype mpi_type() {return(MPI_CHAR);};
00030     };
00031 
00034   template<>
00035     struct mpiTraits<float> {
00037       static MPI_Datatype mpi_type() {return(MPI_FLOAT);};
00038     };
00039 
00042   template<>
00043     struct mpiTraits<double> {
00045       static MPI_Datatype mpi_type() {return(MPI_DOUBLE);};
00046     };
00047 
00050   template<>
00051     struct mpiTraits<int> {
00053       static MPI_Datatype mpi_type() {return(MPI_INT);};
00054     };
00055 
00058   template<>
00059     struct mpiTraits<long> {
00061       static MPI_Datatype mpi_type() {return(MPI_LONG);};
00062     };
00063 
00064 #ifdef EIGHT_BYTE_GLOBAL_ID
00065 
00067   template<>
00068     struct mpiTraits<GlobalID> {
00070       static MPI_Datatype mpi_type() {return(MPI_LONG_LONG);};
00071     };
00072 #endif
00073 
00074 } //namespace fei
00075 
00076 #endif //FEI_SER
00077 
00078 #endif // _fei_mpiTraits_hpp_
00079 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends