escript  Revision_
Taipan.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
18 #if !defined escript_Taipan_20050427_H
19 #define escript_Taipan_20050427_H
20 #include "system_dep.h"
21 
22 namespace escript {
23 
44 
45  public:
46 
47 typedef long size_type; // needs to be parallelised by openmp. It should not take negative values.
48  // do not assume that it is unsigned though
49 
63  Taipan();
64 
78  ~Taipan();
79 
88  double*
89  new_array(size_type dim, size_type N);
90 
97  void
98  delete_array(double* array);
99 
105  void
106  release_unused_arrays();
107 
112  int
113  num_arrays();
114 
119  int
120  num_arrays(size_type N);
121 
126  int
127  num_free(size_type N);
128 
133  long
134  num_elements();
135 
140  void
141  dump_stats();
142 
147  void
148  clear_stats();
149 
150  protected:
151 
152  private:
156  void operator=(const Taipan& c){}
157 
158  typedef struct Taipan_StatTable {
159  int requests;
160  int frees;
167 
169 
170  typedef struct Taipan_MemTable {
171  double* array;
172  size_type dim;
173  size_type N;
175  bool free;
177  } Taipan_MemTable;
178 
180 
182 
183 };
184 
185 } // end of namespace
186 
187 #endif
double * array
Definition: Taipan.h:171
long allocated_elements
Definition: Taipan.h:163
Definition: AbstractContinuousDomain.cpp:22
size_type dim
Definition: Taipan.h:172
long totalElements
Definition: Taipan.h:181
Taipan_StatTable * statTable
Definition: Taipan.h:168
int frees
Definition: Taipan.h:160
bool free
Definition: Taipan.h:175
Taipan_MemTable * memTable_Root
Definition: Taipan.h:179
Definition: Taipan.h:158
void operator=(const Taipan &c)
Definition: Taipan.h:156
long size_type
Definition: Taipan.h:47
struct Taipan_MemTable * next
Definition: Taipan.h:176
static dim_t N
Definition: SparseMatrix_saveHB.cpp:37
Taipan array manager, C++ version. Based on TaipanMemManager C module by Lutz Gross.
Definition: Taipan.h:43
long deallocated_elements
Definition: Taipan.h:164
int requests
Definition: Taipan.h:159
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:29
Definition: Taipan.h:170
long max_tab_size
Definition: Taipan.h:165
int allocations
Definition: Taipan.h:161
int deallocations
Definition: Taipan.h:162
int numThreads
Definition: Taipan.h:174
size_type N
Definition: Taipan.h:173