Taipan.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#if !defined escript_Taipan_20050427_H
#define escript_Taipan_20050427_H
#include "system_dep.h"
namespace escript {
class ESCRIPT_DLL_API Taipan {
public:
typedef long size_type; // needs to be parallelised by openmp. It should not take negative values.
// do not assume that it is unsigned though
Taipan();
~Taipan();
double*
new_array(size_type dim, size_type N);
void
delete_array(double* array);
void
release_unused_arrays();
int
num_arrays();
int
num_arrays(size_type N);
int
num_free(size_type N);
long
num_elements();
void
dump_stats();
void
clear_stats();
protected:
private:
void operator=(const Taipan& c){}
typedef struct Taipan_StatTable {
int requests;
int frees;
int allocations;
int deallocations;
long allocated_elements;
long deallocated_elements;
long max_tab_size;
} Taipan_StatTable;
Taipan_StatTable* statTable;
typedef struct Taipan_MemTable {
double* array;
size_type dim;
size_type N;
int numThreads;
bool free;
struct Taipan_MemTable* next;
} Taipan_MemTable;
Taipan_MemTable* memTable_Root;
long totalElements;
};
} // end of namespace
#endif
ESCRIPT_DLL_API
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
paso::N
static dim_t N
Definition: SparseMatrix_saveHB.cpp:52
escript::Taipan::Taipan_StatTable::frees
int frees
Definition: Taipan.h:189
escript::Taipan::Taipan_MemTable::next
struct Taipan_MemTable * next
Definition: Taipan.h:205
escript::Taipan::totalElements
long totalElements
Definition: Taipan.h:210
escript::Taipan::Taipan_MemTable
struct escript::Taipan::Taipan_MemTable Taipan_MemTable
escript::Distribution_ptr
boost::shared_ptr< Distribution > Distribution_ptr
Definition: Distribution.h:39
escript::Taipan::num_arrays
int num_arrays()
Calculate the total number of arrays currently under management.
Definition: Taipan.cpp:275
paso::SystemMatrixPattern::col_connector
Connector_ptr col_connector
Definition: SystemMatrixPattern.h:81
escript::Taipan::memTable_Root
Taipan_MemTable * memTable_Root
Definition: Taipan.h:208
paso::SystemMatrixPattern_ptr
boost::shared_ptr< SystemMatrixPattern > SystemMatrixPattern_ptr
Definition: SystemMatrixPattern.h:54
paso::SystemMatrixPattern::SystemMatrixPattern
SystemMatrixPattern(int type, escript::Distribution_ptr output_distribution, escript::Distribution_ptr input_distribution, Pattern_ptr mainPattern, Pattern_ptr col_couplePattern, Pattern_ptr row_couplePattern, Connector_ptr col_connector, Connector_ptr row_connector)
Definition: SystemMatrixPattern.cpp:48
escript::Taipan::Taipan_StatTable::deallocations
int deallocations
Definition: Taipan.h:191
escript::Taipan::Taipan_StatTable::allocated_elements
long allocated_elements
Definition: Taipan.h:192
paso::SystemMatrixPattern::output_distribution
escript::Distribution_ptr output_distribution
Definition: SystemMatrixPattern.h:83
escript::Taipan::Taipan_MemTable::array
double * array
Definition: Taipan.h:200
MATRIX_FORMAT_OFFSET1
#define MATRIX_FORMAT_OFFSET1
Definition: Paso.h:65
escript::Distribution
Definition: Distribution.h:46
paso::SystemMatrixPattern::row_connector
Connector_ptr row_connector
Definition: SystemMatrixPattern.h:82
escript::Taipan::clear_stats
void clear_stats()
Clear record of statistics on the memory under management.
Definition: Taipan.cpp:368
system_dep.h
paso::SystemMatrixPattern::type
int type
Definition: SystemMatrixPattern.h:76
escript::Taipan::Taipan_StatTable::requests
int requests
Definition: Taipan.h:188
escript::Taipan::size_type
long size_type
Definition: Taipan.h:76
escript::Taipan::statTable
Taipan_StatTable * statTable
Definition: Taipan.h:197
escript::Taipan::Taipan_MemTable::dim
size_type dim
Definition: Taipan.h:201
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
escript::Taipan::Taipan_StatTable
struct escript::Taipan::Taipan_StatTable Taipan_StatTable
escript::Taipan::~Taipan
~Taipan()
Default destructor for Taipan data-array manager.
Definition: Taipan.cpp:41
SystemMatrixPattern.h
paso::SystemMatrixPattern::input_distribution
escript::Distribution_ptr input_distribution
Definition: SystemMatrixPattern.h:84
Taipan.h
escript::Taipan::Taipan_MemTable::numThreads
int numThreads
Definition: Taipan.h:203
escript::Taipan::num_free
int num_free(size_type N)
Calculate the total number of free arrays of N blocks currently under management.
Definition: Taipan.cpp:315
escript::Taipan::new_array
double * new_array(size_type dim, size_type N)
Taipan data-array allocator.
Definition: Taipan.cpp:105
escript::Taipan::dump_stats
void dump_stats()
Print out statistics on the memory under management.
Definition: Taipan.cpp:345
escript::Taipan::delete_array
void delete_array(double *array)
Taipan data-array deallocator.
Definition: Taipan.cpp:192
escript::Taipan::Taipan_StatTable::allocations
int allocations
Definition: Taipan.h:190
escript::Taipan::Taipan_StatTable::max_tab_size
long max_tab_size
Definition: Taipan.h:194
escript
Definition: AbstractContinuousDomain.cpp:23
paso::SystemMatrixPattern::row_couplePattern
Pattern_ptr row_couplePattern
Definition: SystemMatrixPattern.h:80
escript::Taipan::Taipan_MemTable::N
size_type N
Definition: Taipan.h:202
paso::SystemMatrixPattern::unrollBlocks
SystemMatrixPattern_ptr unrollBlocks(int type, dim_t output_block_size, dim_t input_block_size)
Definition: SystemMatrixPattern_unrollBlocks.cpp:47
escript::Taipan::Taipan_StatTable::deallocated_elements
long deallocated_elements
Definition: Taipan.h:193
escript::Taipan::Taipan_MemTable::free
bool free
Definition: Taipan.h:204
paso::SystemMatrixPattern::col_couplePattern
Pattern_ptr col_couplePattern
Definition: SystemMatrixPattern.h:79
paso::Connector_ptr
boost::shared_ptr< Connector > Connector_ptr
Definition: Coupler.h:52
paso::Pattern_ptr
boost::shared_ptr< Pattern > Pattern_ptr
Definition: Pattern.h:52
escript::Taipan::num_elements
long num_elements()
Return the total number of array elements currently under management.
Definition: Taipan.cpp:337
escript::Taipan::Taipan_MemTable
Definition: Taipan.h:199
paso
Definition: BiCGStab.cpp:26
escript::Taipan::release_unused_arrays
void release_unused_arrays()
frees all arrays that are currently unused.
Definition: Taipan.cpp:74
paso::SystemMatrixPattern::mainPattern
Pattern_ptr mainPattern
Definition: SystemMatrixPattern.h:78