Newer
Older
/*
* EnginePy.cpp
*
* Created on: Mar 15, 2017
* Author: wgodoy
*/
#include "EnginePy.h"
#include "adiosPyFunctions.h"
namespace adios
{
EnginePy::EnginePy( ADIOSPy& adiosPy ):
m_ADIOSPy{ adiosPy }
{ }
EnginePy::~EnginePy( )
{ }
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
void EnginePy::WritePy( VariablePy& variable, const pyArray& array )
{
const dtype arrayDType = DType( array );
if( variable.m_IsVariableDefined == false ) //here define variable
{
if( arrayDType == GetDType<char>() ) DefineVariableInADIOS<char>( variable );
else if( arrayDType == GetDType<unsigned char>() ) DefineVariableInADIOS<unsigned char>( variable );
else if( arrayDType == GetDType<short>() ) DefineVariableInADIOS<short>( variable );
else if( arrayDType == GetDType<unsigned short>() ) DefineVariableInADIOS<unsigned short>( variable );
else if( arrayDType == GetDType<int>() ) DefineVariableInADIOS<int>( variable );
else if( arrayDType == GetDType<unsigned int>() ) DefineVariableInADIOS<unsigned int>( variable );
else if( arrayDType == GetDType<long int>() ) DefineVariableInADIOS<long int>( variable );
else if( arrayDType == GetDType<unsigned long int>() ) DefineVariableInADIOS<unsigned long int>( variable );
else if( arrayDType == GetDType<long long int>() ) DefineVariableInADIOS<long long int>( variable );
else if( arrayDType == GetDType<unsigned long long int>() ) DefineVariableInADIOS<unsigned long long int>( variable );
else if( arrayDType == GetDType<float>() ) DefineVariableInADIOS<float>( variable );
else if( arrayDType == GetDType<double>() ) DefineVariableInADIOS<double>( variable );
else if( arrayDType == GetDType<long double>() ) DefineVariableInADIOS<long double>( variable );
else if( arrayDType == GetDType<std::complex<float>>() ) DefineVariableInADIOS<std::complex<float>>( variable );
else if( arrayDType == GetDType<std::complex<double>>() ) DefineVariableInADIOS<std::complex<double>>( variable );
else if( arrayDType == GetDType<std::complex<long double>>() ) DefineVariableInADIOS<std::complex<long double>>( variable );
}
if( arrayDType == GetDType<char>() ) WriteVariableInADIOS<char>( variable, array );
else if( arrayDType == GetDType<unsigned char>() ) WriteVariableInADIOS<unsigned char>( variable, array );
else if( arrayDType == GetDType<short>() ) WriteVariableInADIOS<short>( variable, array );
else if( arrayDType == GetDType<unsigned short>() ) WriteVariableInADIOS<unsigned short>( variable, array );
else if( arrayDType == GetDType<int>() ) WriteVariableInADIOS<int>( variable, array );
else if( arrayDType == GetDType<unsigned int>() ) WriteVariableInADIOS<unsigned int>( variable, array );
else if( arrayDType == GetDType<long int>() ) WriteVariableInADIOS<long int>( variable, array );
else if( arrayDType == GetDType<unsigned long int>() ) WriteVariableInADIOS<unsigned long int>( variable, array );
else if( arrayDType == GetDType<long long int>() ) WriteVariableInADIOS<long long int>( variable, array );
else if( arrayDType == GetDType<unsigned long long int>() ) WriteVariableInADIOS<unsigned long long int>( variable, array );
else if( arrayDType == GetDType<float>() ) WriteVariableInADIOS<float>( variable, array );
else if( arrayDType == GetDType<double>() ) WriteVariableInADIOS<double>( variable, array );
else if( arrayDType == GetDType<long double>() ) WriteVariableInADIOS<long double>( variable, array );
else if( arrayDType == GetDType<std::complex<float>>() ) WriteVariableInADIOS<std::complex<float>>( variable, array );
else if( arrayDType == GetDType<std::complex<double>>() ) WriteVariableInADIOS<std::complex<double>>( variable, array );
else if( arrayDType == GetDType<std::complex<long double>>() ) WriteVariableInADIOS<std::complex<long double>>( variable, array );
}