Alsvinn  0.5.3
The fast FVM simulator with UQ support
Namespaces | Classes | Typedefs | Functions
alsutils Namespace Reference

Various utilities for mpi and cuda. More...

Namespaces

 base
 
 cuda
 
 debug
 
 io
 
 log
 
 math
 
 mpi
 
 parameters
 
 timer
 

Classes

class  matrix
 
struct  Types
 
struct  Types< 1 >
 
struct  Types< 2 >
 
struct  Types< 3 >
 
struct  Types< 4 >
 
struct  Types< 5 >
 
struct  vec1
 
struct  vec2
 
struct  vec3
 
struct  vec4
 
struct  vec5
 
struct  vec6
 

Typedefs

typedef double real
 
typedef vec1< realrvec1
 
typedef vec1< int > ivec1
 
typedef vec2< realrvec2
 
typedef vec2< int > ivec2
 
typedef vec3< realrvec3
 
typedef vec3< int > ivec3
 
typedef vec4< realrvec4
 
typedef vec4< int > ivec4
 
typedef vec5< realrvec5
 
typedef vec5< int > ivec5
 
typedef vec6< realrvec6
 
typedef vec6< int > ivec6
 
typedef matrix< real, 1, 1 > matrix1
 
typedef matrix< real, 2, 2 > matrix2
 
typedef matrix< real, 3, 3 > matrix3
 
typedef matrix< real, 4, 4 > matrix4
 
typedef matrix< real, 5, 5 > matrix5
 

Functions

boost::property_tree::ptree getBoostProperties ()
 
std::string getCPUName ()
 
std::string getHostname ()
 
std::string getOSName ()
 
std::string getPythonVersion ()
 Returns the Python version. More...
 
std::string getStandardCLibrary ()
 
std::string getUsername ()
 
boost::property_tree::ptree makeBasicReport ()
 
__device__ __host__ ivec3 make_direction_vector (size_t direction)
 
__device__ __host__ ivec3 make_space_filling_vector (int nx, int ny, int nz)
 
__host__ __device__ real square (const real &x)
 
template<class T >
__device__ __host__ vec1< T > operator/ (const vec1< T > &a, const vec1< T > &b)
 
template<class T >
__device__ __host__ vec1< T > operator* (T scalar, const vec1< T > &a)
 
template<class T >
__device__ __host__ vec1< T > operator- (const vec1< T > &a, const vec1< T > &b)
 
template<class T >
__device__ __host__ vec1< T > operator/ (const vec1< T > &a, T scalar)
 
template<class T , class S >
__device__ __host__ vec1< T > operator+ (const vec1< T > &a, const vec1< S > &b)
 
template<class T >
__device__ __host__ vec2< T > operator/ (const vec2< T > &a, const vec2< T > &b)
 
template<class T >
__device__ __host__ vec2< T > operator* (T scalar, const vec2< T > &a)
 
template<class T >
__device__ __host__ vec2< T > operator- (const vec2< T > &a, const vec2< T > &b)
 
template<class T >
__device__ __host__ vec2< T > operator/ (const vec2< T > &a, T scalar)
 
template<class T , class S >
__device__ __host__ vec2< T > operator+ (const vec2< T > &a, const vec2< S > &b)
 
template<class T >
__device__ __host__ vec3< T > operator/ (const vec3< T > &a, const vec3< T > &b)
 
template<class T >
__device__ __host__ vec3< T > operator* (T scalar, const vec3< T > &a)
 
template<class T , class S >
__device__ __host__ vec3< T > operator* (const vec3< T > &a, const vec3< S > &b)
 
template<class T >
__device__ __host__ vec3< T > operator- (const vec3< T > &a, const vec3< T > &b)
 
template<class T >
__device__ __host__ vec3< T > operator/ (const vec3< T > &a, T scalar)
 
template<class T , class S >
__device__ __host__ vec3< T > operator+ (const vec3< T > &a, const vec3< S > &b)
 
template<class T >
__device__ __host__ vec4< T > operator/ (const vec4< T > &a, const vec4< T > &b)
 
template<class T >
__device__ __host__ vec4< T > operator* (T scalar, const vec4< T > &a)
 
template<class T >
__device__ __host__ vec4< T > operator- (const vec4< T > &a, const vec4< T > &b)
 
template<class T >
__device__ __host__ vec4< T > operator/ (const vec4< T > &a, T scalar)
 
template<class T , class S >
__device__ __host__ vec4< T > operator+ (const vec4< T > &a, const vec4< S > &b)
 
template<class T >
__device__ __host__ vec5< T > operator/ (const vec5< T > &a, const vec5< T > &b)
 
template<class T >
__device__ __host__ vec5< T > operator* (T scalar, const vec5< T > &a)
 
template<class T >
__device__ __host__ vec5< T > operator- (const vec5< T > &a, const vec5< T > &b)
 
template<class T >
__device__ __host__ vec5< T > operator/ (const vec5< T > &a, T scalar)
 
template<class T , class S >
__device__ __host__ vec5< T > operator+ (const vec5< T > &a, const vec5< S > &b)
 
template<class T >
__device__ __host__ vec6< T > operator/ (const vec6< T > &a, const vec6< T > &b)
 
template<class T >
__device__ __host__ vec6< T > operator* (T scalar, const vec6< T > &a)
 
template<class T >
__device__ __host__ vec6< T > operator- (const vec6< T > &a, const vec6< T > &b)
 
template<class T >
__device__ __host__ vec6< T > operator/ (const vec6< T > &a, T scalar)
 
template<class T >
__device__ __host__ vec6< T > operator+ (const vec6< T > &a, const vec6< T > &b)
 
void writeRunReport (const std::string &executable, const std::string &name, const int cpuDurationMs, const int wall, const int timesteps, const int argc, char **argv)
 

Detailed Description

Various utilities for mpi and cuda.

Really easy way of computing the legendre polynomials This file was only implemented since boost::legendre did not support cuda if this becomes the case in the future, this file can be removed

I have tried to keep the interface 100% identical to boost, see http://www.boost.org/doc/libs/1_46_1/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_poly/legendre.html

Typedef Documentation

◆ ivec1

typedef vec1<int> alsutils::ivec1

◆ ivec2

typedef vec2<int> alsutils::ivec2

◆ ivec3

typedef vec3<int> alsutils::ivec3

◆ ivec4

typedef vec4<int> alsutils::ivec4

◆ ivec5

typedef vec5<int> alsutils::ivec5

◆ ivec6

typedef vec6<int> alsutils::ivec6

◆ matrix1

typedef matrix<real, 1, 1> alsutils::matrix1

◆ matrix2

typedef matrix<real, 2, 2> alsutils::matrix2

◆ matrix3

typedef matrix<real, 3, 3> alsutils::matrix3

◆ matrix4

typedef matrix<real, 4, 4> alsutils::matrix4

◆ matrix5

typedef matrix<real, 5, 5> alsutils::matrix5

◆ real

typedef double alsutils::real

◆ rvec1

◆ rvec2

◆ rvec3

◆ rvec4

◆ rvec5

◆ rvec6

Function Documentation

◆ getBoostProperties()

boost::property_tree::ptree alsutils::getBoostProperties ( )
inline

◆ getCPUName()

std::string alsutils::getCPUName ( )

◆ getHostname()

std::string alsutils::getHostname ( )

Tries in a portable way to get the hostname of the current computer This will in most instances call gethostname See http://man7.org/linux/man-pages/man2/gethostname.2.html and https://msdn.microsoft.com/library/windows/desktop/ms738527(v=vs.85).aspx/

◆ getOSName()

std::string alsutils::getOSName ( )

◆ getPythonVersion()

std::string alsutils::getPythonVersion ( )

Returns the Python version.

◆ getStandardCLibrary()

std::string alsutils::getStandardCLibrary ( )

Returns a descriptive name of the standard C library being used

Note
only works on Linux so far, otherwise returns "Unknown"

◆ getUsername()

std::string alsutils::getUsername ( )

◆ make_direction_vector()

__device__ __host__ ivec3 alsutils::make_direction_vector ( size_t  direction)
inline

◆ make_space_filling_vector()

__device__ __host__ ivec3 alsutils::make_space_filling_vector ( int  nx,
int  ny,
int  nz 
)
inline

◆ makeBasicReport()

boost::property_tree::ptree alsutils::makeBasicReport ( )

Writes a short boost::property_tree on the current alsvinn system

This includes, but is not limited to: compiler version, CPU, GPU, MPI version, etc

The output should not be used programatically, only for "human readable" output afterwards to increase reproducability.

◆ operator*() [1/7]

template<class T >
__device__ __host__ vec6<T> alsutils::operator* ( scalar,
const vec6< T > &  a 
)
inline

Computes the product $\mathrm{scalar} \vec{a}$

Note
Creates a new vector instance

◆ operator*() [2/7]

template<class T >
__device__ __host__ vec1<T> alsutils::operator* ( scalar,
const vec1< T > &  a 
)
inline

Computes the product $\mathrm{scalar} \vec{a}$

Note
Creates a new vector instance

◆ operator*() [3/7]

template<class T >
__device__ __host__ vec2<T> alsutils::operator* ( scalar,
const vec2< T > &  a 
)
inline

Computes the product $\mathrm{scalar} \vec{a}$

Note
Creates a new vector instance

◆ operator*() [4/7]

template<class T >
__device__ __host__ vec3<T> alsutils::operator* ( scalar,
const vec3< T > &  a 
)
inline

Computes the product $\mathrm{scalar} \vec{a}$

Note
Creates a new vector instance

◆ operator*() [5/7]

template<class T >
__device__ __host__ vec4<T> alsutils::operator* ( scalar,
const vec4< T > &  a 
)
inline

Computes the product $\mathrm{scalar} \vec{a}$

Note
Creates a new vector instance

◆ operator*() [6/7]

template<class T >
__device__ __host__ vec5<T> alsutils::operator* ( scalar,
const vec5< T > &  a 
)
inline

Computes the product $\mathrm{scalar} \vec{a}$

Note
Creates a new vector instance

◆ operator*() [7/7]

template<class T , class S >
__device__ __host__ vec3<T> alsutils::operator* ( const vec3< T > &  a,
const vec3< S > &  b 
)
inline

Computes the product $\ (a_x\cdot b_x, a_y\cdot b_y, a_z\cdot b_z)$

Note
Creates a new vector instance

◆ operator+() [1/6]

template<class T >
__device__ __host__ vec6<T> alsutils::operator+ ( const vec6< T > &  a,
const vec6< T > &  b 
)
inline

Computes the product $\vec{a}+\vec{b}$

Note
Creates a new vector instance.

◆ operator+() [2/6]

template<class T , class S >
__device__ __host__ vec1<T> alsutils::operator+ ( const vec1< T > &  a,
const vec1< S > &  b 
)
inline

Computes the product $\vec{a}+\vec{b}$

Note
Creates a new vector instance.

◆ operator+() [3/6]

template<class T , class S >
__device__ __host__ vec2<T> alsutils::operator+ ( const vec2< T > &  a,
const vec2< S > &  b 
)
inline

Computes the product $\vec{a}+\vec{b}$

Note
Creates a new vector instance.

◆ operator+() [4/6]

template<class T , class S >
__device__ __host__ vec4<T> alsutils::operator+ ( const vec4< T > &  a,
const vec4< S > &  b 
)
inline

Computes the product $\vec{a}+\vec{b}$

Note
Creates a new vector instance.

◆ operator+() [5/6]

template<class T , class S >
__device__ __host__ vec5<T> alsutils::operator+ ( const vec5< T > &  a,
const vec5< S > &  b 
)
inline

Computes the product $\vec{a}+\vec{b}$

Note
Creates a new vector instance.

◆ operator+() [6/6]

template<class T , class S >
__device__ __host__ vec3<T> alsutils::operator+ ( const vec3< T > &  a,
const vec3< S > &  b 
)
inline

Computes the product $\vec{a}+\vec{b}$

Note
Creates a new vector instance.

◆ operator-() [1/6]

template<class T >
__device__ __host__ vec6<T> alsutils::operator- ( const vec6< T > &  a,
const vec6< T > &  b 
)
inline

Computes the difference $ \vec{a}-\vec{b}$

Note
Creates a new vector instance

◆ operator-() [2/6]

template<class T >
__device__ __host__ vec1<T> alsutils::operator- ( const vec1< T > &  a,
const vec1< T > &  b 
)
inline

Computes the difference $ \vec{a}-\vec{b}$

Note
Creates a new vector instance

◆ operator-() [3/6]

template<class T >
__device__ __host__ vec2<T> alsutils::operator- ( const vec2< T > &  a,
const vec2< T > &  b 
)
inline

Computes the difference $ \vec{a}-\vec{b}$

Note
Creates a new vector instance

◆ operator-() [4/6]

template<class T >
__device__ __host__ vec4<T> alsutils::operator- ( const vec4< T > &  a,
const vec4< T > &  b 
)
inline

Computes the difference $ \vec{a}-\vec{b}$

Note
Creates a new vector instance

◆ operator-() [5/6]

template<class T >
__device__ __host__ vec5<T> alsutils::operator- ( const vec5< T > &  a,
const vec5< T > &  b 
)
inline

Computes the difference $ \vec{a}-\vec{b}$

Note
Creates a new vector instance

◆ operator-() [6/6]

template<class T >
__device__ __host__ vec3<T> alsutils::operator- ( const vec3< T > &  a,
const vec3< T > &  b 
)
inline

Computes the difference $ \vec{a}-\vec{b}$

Note
Creates a new vector instance

◆ operator/() [1/12]

template<class T >
__device__ __host__ vec6<T> alsutils::operator/ ( const vec6< T > &  a,
const vec6< T > &  b 
)
inline

Computes the component wise division of a by b. Ie. the new vector will be

\[(a_0/b_0, a_1/b_1, a_2/b_2)\]

◆ operator/() [2/12]

template<class T >
__device__ __host__ vec1<T> alsutils::operator/ ( const vec1< T > &  a,
const vec1< T > &  b 
)
inline

Computes the component wise division of a by b. Ie. the new vector will be

\[(a_0/b_0, a_1/b_1, a_2/b_2)\]

◆ operator/() [3/12]

template<class T >
__device__ __host__ vec2<T> alsutils::operator/ ( const vec2< T > &  a,
const vec2< T > &  b 
)
inline

Computes the component wise division of a by b. Ie. the new vector will be

\[(a_0/b_0, a_1/b_1, a_2/b_2)\]

◆ operator/() [4/12]

template<class T >
__device__ __host__ vec3<T> alsutils::operator/ ( const vec3< T > &  a,
const vec3< T > &  b 
)
inline

Computes the component wise division of a by b. Ie. the new vector will be

\[(a_0/b_0, a_1/b_1, a_2/b_2)\]

◆ operator/() [5/12]

template<class T >
__device__ __host__ vec6<T> alsutils::operator/ ( const vec6< T > &  a,
scalar 
)
inline

Computes the division $\frac{1}{\mathrm{scalar}} \vec{a}$

Note
Creates a new vector instance

◆ operator/() [6/12]

template<class T >
__device__ __host__ vec4<T> alsutils::operator/ ( const vec4< T > &  a,
const vec4< T > &  b 
)
inline

Computes the component wise division of a by b. Ie. the new vector will be

\[(a_0/b_0, a_1/b_1, a_2/b_2)\]

◆ operator/() [7/12]

template<class T >
__device__ __host__ vec5<T> alsutils::operator/ ( const vec5< T > &  a,
const vec5< T > &  b 
)
inline

Computes the component wise division of a by b. Ie. the new vector will be

\[(a_0/b_0, a_1/b_1, a_2/b_2)\]

◆ operator/() [8/12]

template<class T >
__device__ __host__ vec1<T> alsutils::operator/ ( const vec1< T > &  a,
scalar 
)
inline

Computes the division $\frac{1}{\mathrm{scalar}} \vec{a}$

Note
Creates a new vector instance

◆ operator/() [9/12]

template<class T >
__device__ __host__ vec2<T> alsutils::operator/ ( const vec2< T > &  a,
scalar 
)
inline

Computes the division $\frac{1}{\mathrm{scalar}} \vec{a}$

Note
Creates a new vector instance

◆ operator/() [10/12]

template<class T >
__device__ __host__ vec4<T> alsutils::operator/ ( const vec4< T > &  a,
scalar 
)
inline

Computes the division $\frac{1}{\mathrm{scalar}} \vec{a}$

Note
Creates a new vector instance

◆ operator/() [11/12]

template<class T >
__device__ __host__ vec5<T> alsutils::operator/ ( const vec5< T > &  a,
scalar 
)
inline

Computes the division $\frac{1}{\mathrm{scalar}} \vec{a}$

Note
Creates a new vector instance

◆ operator/() [12/12]

template<class T >
__device__ __host__ vec3<T> alsutils::operator/ ( const vec3< T > &  a,
scalar 
)
inline

Computes the division $\frac{1}{\mathrm{scalar}} \vec{a}$

Note
Creates a new vector instance

◆ square()

__host__ __device__ real alsutils::square ( const real x)
inline

Computes the square of x

Returns
x*x

◆ writeRunReport()

void alsutils::writeRunReport ( const std::string &  executable,
const std::string &  name,
const int  cpuDurationMs,
const int  wall,
const int  timesteps,
const int  argc,
char **  argv 
)

Writes a run report to the json file

executable_name_report.json

and to the xml file

executable_name_report.xml