aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/dist.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2012-02-24 23:02:22 -0500
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:23:05 +0100
commit0f0235b7a2a02a93cfe757d977ed56c2469dc673 (patch)
treec9ebc615cbee510ddefa3d575e36ba4a01bbc40c /Carpet/CarpetLib/src/dist.hh
parent5f566b7daa4e0d1d14536600b31207a1bc4dfc64 (diff)
CarpetLib: Remove/correct ATTRIBUTE_CONST and ATTRIBUTE_PURE declarations
Diffstat (limited to 'Carpet/CarpetLib/src/dist.hh')
-rw-r--r--Carpet/CarpetLib/src/dist.hh75
1 files changed, 0 insertions, 75 deletions
diff --git a/Carpet/CarpetLib/src/dist.hh b/Carpet/CarpetLib/src/dist.hh
index 7fd084bb3..cb0770efe 100644
--- a/Carpet/CarpetLib/src/dist.hh
+++ b/Carpet/CarpetLib/src/dist.hh
@@ -145,21 +145,18 @@ namespace dist {
// Information about the communicator
// Return the communicator
- inline MPI_Comm comm () CCTK_ATTRIBUTE_CONST;
inline MPI_Comm comm ()
{
return comm_;
}
// Always return a good communicator
- inline MPI_Comm goodcomm () CCTK_ATTRIBUTE_CONST;
inline MPI_Comm goodcomm ()
{
return comm_ != MPI_COMM_NULL ? comm_ : MPI_COMM_WORLD;
}
// Rank in the communicator (this processor's number, 0 .. size-1)
- inline int rank () CCTK_ATTRIBUTE_CONST;
inline int rank ()
{
static int rank_ = -1;
@@ -168,7 +165,6 @@ namespace dist {
}
// Size of the communicator
- inline int size () CCTK_ATTRIBUTE_CONST;
inline int size ()
{
static int size_ = -1;
@@ -180,7 +176,6 @@ namespace dist {
void set_num_threads (int num_threads);
// Local number of threads
- inline int num_threads () CCTK_ATTRIBUTE_CONST;
inline int num_threads ()
{
return num_threads_;
@@ -188,7 +183,6 @@ namespace dist {
// Global number of threads
void collect_total_num_threads ();
- inline int total_num_threads () CCTK_ATTRIBUTE_CONST;
inline int total_num_threads ()
{
return total_num_threads_;
@@ -200,124 +194,89 @@ namespace dist {
// C Datatype helpers
// Map a C datatype to a 0-based index running up to c_ndatatypes().
/////////////////////////////////////////////////////////////////////////
- inline unsigned int c_datatype (const char&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const char&)
{ return 0; }
- inline unsigned int c_datatype (const signed char&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const signed char&)
{ return 1; }
- inline unsigned int c_datatype (const unsigned char&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const unsigned char&)
{ return 2; }
- inline unsigned int c_datatype (const short&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const short&)
{ return 3; }
- inline unsigned int c_datatype (const unsigned short&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const unsigned short&)
{ return 4; }
- inline unsigned int c_datatype (const int&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const int&)
{ return 5; }
- inline unsigned int c_datatype (const unsigned int&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const unsigned int&)
{ return 6; }
- inline unsigned int c_datatype (const long&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const long&)
{ return 7; }
- inline unsigned int c_datatype (const unsigned long&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const unsigned long&)
{ return 8; }
- inline unsigned int c_datatype (const long long&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const long long&)
{ return 9; }
- inline unsigned int c_datatype (const unsigned long long&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const unsigned long long&)
{ return 10; }
- inline unsigned int c_datatype (const float&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const float&)
{ return 11; }
- inline unsigned int c_datatype (const double&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const double&)
{ return 12; }
- inline unsigned int c_datatype (const long double&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const long double&)
{ return 13; }
#ifdef HAVE_CCTK_COMPLEX8
- inline unsigned int c_datatype (const CCTK_COMPLEX8&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const CCTK_COMPLEX8&)
{ return 14; }
#endif
#ifdef HAVE_CCTK_COMPLEX16
- inline unsigned int c_datatype (const CCTK_COMPLEX16&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const CCTK_COMPLEX16&)
{ return 15; }
#endif
#ifdef HAVE_CCTK_COMPLEX32
- inline unsigned int c_datatype (const CCTK_COMPLEX32&) CCTK_ATTRIBUTE_CONST;
inline unsigned int c_datatype (const CCTK_COMPLEX32&)
{ return 16; }
#endif
// keep this function's return code consistent with functions above
- inline unsigned int c_ndatatypes () CCTK_ATTRIBUTE_CONST;
inline unsigned int c_ndatatypes ()
{ return 17; }
template <typename T> unsigned int c_datatype () { abort(); }
- template<> inline unsigned int c_datatype <char> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <char> () { return 0; }
- template<> inline unsigned int c_datatype <signed char> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <signed char> () { return 1; }
- template<> inline unsigned int c_datatype <unsigned char> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <unsigned char> () { return 2; }
- template<> inline unsigned int c_datatype <short> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <short> () { return 3; }
- template<> inline unsigned int c_datatype <unsigned short> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <unsigned short> () { return 4; }
- template<> inline unsigned int c_datatype <int> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <int> () { return 5; }
- template<> inline unsigned int c_datatype <unsigned int> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <unsigned int> () { return 6; }
- template<> inline unsigned int c_datatype <long> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <long> () { return 7; }
- template<> inline unsigned int c_datatype <unsigned long> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <unsigned long> () { return 8; }
- template<> inline unsigned int c_datatype <long long> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <long long> () { return 9; }
- template<> inline unsigned int c_datatype <unsigned long long> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <unsigned long long> () { return 10; }
- template<> inline unsigned int c_datatype <float> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <float> () { return 11; }
- template<> inline unsigned int c_datatype <double> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <double> () { return 12; }
- template<> inline unsigned int c_datatype <long double> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <long double> () { return 13; }
#ifdef HAVE_CCTK_COMPLEX8
- template<> inline unsigned int c_datatype <CCTK_COMPLEX8> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <CCTK_COMPLEX8> () { return 14; }
#endif
#ifdef HAVE_CCTK_COMPLEX16
- template<> inline unsigned int c_datatype <CCTK_COMPLEX16> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <CCTK_COMPLEX16> () { return 15; }
#endif
#ifdef HAVE_CCTK_COMPLEX32
- template<> inline unsigned int c_datatype <CCTK_COMPLEX32> () CCTK_ATTRIBUTE_CONST;
template<> inline unsigned int c_datatype <CCTK_COMPLEX32> () { return 16; }
#endif
@@ -328,119 +287,85 @@ namespace dist {
// MPI Datatype helpers
// Map a C datatype to its corresponding MPI datatype.
/////////////////////////////////////////////////////////////////
- inline MPI_Datatype mpi_datatype (const char&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const char&)
{ return MPI_CHAR; }
- inline MPI_Datatype mpi_datatype (const signed char&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const signed char&)
{ return MPI_CHAR; }
- inline MPI_Datatype mpi_datatype (const unsigned char&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const unsigned char&)
{ return MPI_UNSIGNED_CHAR; }
- inline MPI_Datatype mpi_datatype (const short&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const short&)
{ return MPI_SHORT; }
- inline MPI_Datatype mpi_datatype (const unsigned short&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const unsigned short&)
{ return MPI_UNSIGNED_SHORT; }
- inline MPI_Datatype mpi_datatype (const int&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const int&)
{ return MPI_INT; }
- inline MPI_Datatype mpi_datatype (const unsigned int&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const unsigned int&)
{ return MPI_UNSIGNED; }
- inline MPI_Datatype mpi_datatype (const long&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const long&)
{ return MPI_LONG; }
- inline MPI_Datatype mpi_datatype (const unsigned long&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const unsigned long&)
{ return MPI_UNSIGNED_LONG; }
- inline MPI_Datatype mpi_datatype (const long long&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const long long&)
{ return MPI_LONG_LONG_INT; }
- inline MPI_Datatype mpi_datatype (const unsigned long long&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const unsigned long long&)
{ return MPI_LONG_LONG_INT; } // should be unsigned, but this doesn't exist
- inline MPI_Datatype mpi_datatype (const float&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const float&)
{ return MPI_FLOAT; }
- inline MPI_Datatype mpi_datatype (const double&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const double&)
{ return MPI_DOUBLE; }
- inline MPI_Datatype mpi_datatype (const long double&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const long double&)
{ return MPI_LONG_DOUBLE; }
#ifdef HAVE_CCTK_COMPLEX8
- inline MPI_Datatype mpi_datatype (const CCTK_COMPLEX8&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const CCTK_COMPLEX8&)
{ return mpi_complex8; }
#endif
#ifdef HAVE_CCTK_COMPLEX16
- inline MPI_Datatype mpi_datatype (const CCTK_COMPLEX16&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const CCTK_COMPLEX16&)
{ return mpi_complex16; }
#endif
#ifdef HAVE_CCTK_COMPLEX32
- inline MPI_Datatype mpi_datatype (const CCTK_COMPLEX32&) CCTK_ATTRIBUTE_CONST;
inline MPI_Datatype mpi_datatype (const CCTK_COMPLEX32&)
{ return mpi_complex32; }
#endif
template <typename T> MPI_Datatype mpi_datatype () { abort(); }
- template<> inline MPI_Datatype mpi_datatype <char> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <char> () { return MPI_CHAR; }
- template<> inline MPI_Datatype mpi_datatype <signed char> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <signed char> () { return MPI_CHAR; }
- template<> inline MPI_Datatype mpi_datatype <unsigned char> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <unsigned char> () { return MPI_UNSIGNED_CHAR; }
- template<> inline MPI_Datatype mpi_datatype <short> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <short> () { return MPI_SHORT; }
- template<> inline MPI_Datatype mpi_datatype <unsigned short> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <unsigned short> () { return MPI_UNSIGNED_SHORT; }
- template<> inline MPI_Datatype mpi_datatype <int> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <int> () { return MPI_INT; }
- template<> inline MPI_Datatype mpi_datatype <unsigned int> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <unsigned int> () { return MPI_UNSIGNED; }
- template<> inline MPI_Datatype mpi_datatype <long> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <long> () { return MPI_LONG; }
- template<> inline MPI_Datatype mpi_datatype <unsigned long> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <unsigned long> () { return MPI_UNSIGNED_LONG; }
- template<> inline MPI_Datatype mpi_datatype <long long> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <long long> () { return MPI_LONG_LONG_INT; }
- template<> inline MPI_Datatype mpi_datatype <unsigned long long> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <unsigned long long> () { return MPI_LONG_LONG_INT; } // should be unsigned, but this doesn't exist
- template<> inline MPI_Datatype mpi_datatype <float> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <float> () { return MPI_FLOAT; }
- template<> inline MPI_Datatype mpi_datatype <double> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <double> () { return MPI_DOUBLE; }
- template<> inline MPI_Datatype mpi_datatype <long double> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <long double> () { return MPI_LONG_DOUBLE; }
#ifdef HAVE_CCTK_COMPLEX8
- template<> inline MPI_Datatype mpi_datatype <CCTK_COMPLEX8> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <CCTK_COMPLEX8> () { return mpi_complex8; }
#endif
#ifdef HAVE_CCTK_COMPLEX16
- template<> inline MPI_Datatype mpi_datatype <CCTK_COMPLEX16> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <CCTK_COMPLEX16> () { return mpi_complex16; }
#endif
#ifdef HAVE_CCTK_COMPLEX32
- template<> inline MPI_Datatype mpi_datatype <CCTK_COMPLEX32> () CCTK_ATTRIBUTE_CONST;
template<> inline MPI_Datatype mpi_datatype <CCTK_COMPLEX32> () { return mpi_complex32; }
#endif