escript  Revision_
Taipan.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 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-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 
19 #if !defined escript_Taipan_20050427_H
20 #define escript_Taipan_20050427_H
21 #include "system_dep.h"
22 
23 namespace escript {
24 
45 
46  public:
47 
48 typedef long size_type; // needs to be parallelised by openmp. It should not take negative values.
49  // do not assume that it is unsigned though
50 
64  Taipan();
65 
79  ~Taipan();
80 
89  double*
90  new_array(size_type dim, size_type N);
91 
98  void
99  delete_array(double* array);
100 
106  void
107  release_unused_arrays();
108 
113  int
114  num_arrays();
115 
120  int
121  num_arrays(size_type N);
122 
127  int
128  num_free(size_type N);
129 
134  long
135  num_elements();
136 
141  void
142  dump_stats();
143 
148  void
149  clear_stats();
150 
151  protected:
152 
153  private:
157  void operator=(const Taipan& c){}
158 
159  typedef struct Taipan_StatTable {
160  int requests;
161  int frees;
167  } Taipan_StatTable;
168 
170 
171  typedef struct Taipan_MemTable {
172  double* array;
176  bool free;
178  } Taipan_MemTable;
179 
181 
183 
184 };
185 
186 } // end of namespace
187 
188 #endif
Taipan array manager, C++ version. Based on TaipanMemManager C module by Lutz Gross.
Definition: Taipan.h:44
long size_type
Definition: Taipan.h:48
void operator=(const Taipan &c)
Definition: Taipan.h:157
Taipan_MemTable * memTable_Root
Definition: Taipan.h:180
Taipan_StatTable * statTable
Definition: Taipan.h:169
long totalElements
Definition: Taipan.h:182
#define ESCRIPT_DLL_API
Definition: escriptcore/src/system_dep.h:30
Definition: AbstractContinuousDomain.cpp:23
static dim_t N
Definition: SparseMatrix_saveHB.cpp:37
Definition: Taipan.h:171
double * array
Definition: Taipan.h:172
bool free
Definition: Taipan.h:176
int numThreads
Definition: Taipan.h:175
size_type N
Definition: Taipan.h:174
struct Taipan_MemTable * next
Definition: Taipan.h:177
size_type dim
Definition: Taipan.h:173
Definition: Taipan.h:159
int deallocations
Definition: Taipan.h:163
int frees
Definition: Taipan.h:161
long max_tab_size
Definition: Taipan.h:166
int requests
Definition: Taipan.h:160
long deallocated_elements
Definition: Taipan.h:165
int allocations
Definition: Taipan.h:162
long allocated_elements
Definition: Taipan.h:164