Overture  Version 25
App.h
Go to the documentation of this file.
1 #ifndef APP_UTILITY_INCLUDE_FILE
2 #define APP_UTILITY_INCLUDE_FILE
3 
4 
5 // -----
6 #include "Overture.h"
7 #include "A++.h"
8 #include "OGFunction.h"
9 // -----
11 
13 
14 
16 
17 
18 int getSent();
19 
20 int getReceived();
21 
22 void printMessageInfo( const char* msg, FILE *file=stdout );
23 
24 // Put this here for now -- should be moved to OGFunction
25 int
28  const Index &I1, const Index&I2, const Index&I3, const Index & N, const real t);
29 
30 // Assign values without communication (when lhs and rhs have the same distribution)
32 void assign( realGridCollectionFunction & u, real value);
34 void assign( intGridCollectionFunction & u, int value);
35 
36 // Assign values without communication (when lhs and rhs have the same distribution)
37 void assign( realArray & u, const realArray & v );
38 void assign( intArray & u, const intArray & v );
39 
40 // Assign values without communication (when lhs and rhs have the same distribution)
41 void assign( realArray & u, const realArray & v,
42  const Index & I1, const Index & I2, const Index & I3, const Index & I4 );
43 void assign( intArray & u, const intArray & v,
44  const Index & I1, const Index & I2, const Index & I3, const Index & I4 );
45 
46 // Assign values without communication (when lhs and rhs have the same distribution)
47 // u(I1,I2,I3,I4)=v(J1,J2,J3,J4)
48 void assign( realArray & u, const Index & I1, const Index & I2, const Index & I3, const Index & I4,
49  const realArray & v, const Index & J1, const Index & J2, const Index & J3, const Index & J4 );
50 void assign( intArray & u, const Index & I1, const Index & I2, const Index & I3, const Index & I4,
51  const intArray & v, const Index & J1, const Index & J2, const Index & J3, const Index & J4 );
52 
53 // Assign values without communication (when lhs and rhs have the same distribution)
54 void assign( realArray & u, real value,
55  const Index & I1, const Index & I2, const Index & I3, const Index & I4 );
56 void assign( intArray & u, int value,
57  const Index & I1, const Index & I2, const Index & I3, const Index & I4 );
58 void assign( realArray & u, real value );
59 void assign( intArray & u, int value );
60 
61 
62 // return the base of the local array that includes ghost points
63 inline int getFullBase( const doubleSerialArray & u, int axis)
64  { return u.getFullRange(axis).getBase(); }
65 
66 // return the bound of the local array that includes ghost points
67 inline int getFullBound( const doubleSerialArray & u, int axis)
68  { return u.getFullRange(axis).getBound(); }
69 
70 
71 void checkArrayIDs(const aString & label, bool printNumber = false );
72 
74 
75 // return true if the two arrays have the same parallel distribution:
76 bool hasSameDistribution(const intArray & u, const intArray & v );
77 bool hasSameDistribution(const floatArray & u, const floatArray & v );
78 bool hasSameDistribution(const doubleArray & u, const doubleArray & v );
79 
80 // return true if the array u has a consistent distribution with partition:
81 bool hasSameDistribution(const intArray & u, const Partitioning_Type & partition );
82 bool hasSameDistribution(const floatArray & u, const Partitioning_Type & partition );
83 bool hasSameDistribution(const doubleArray & u, const Partitioning_Type & partition );
84 
85 bool hasSameDistribution(const Partitioning_Type & uPartition, const Partitioning_Type & vPartition );
86 
87 int testConsistency( const intArray & u, const char* label );
88 int testConsistency( const floatArray & u, const char* label );
89 int testConsistency( const doubleArray & u, const char* label );
90 
91 #endif