ESScript  Revision_4488
Taipan.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 
17 #if !defined escript_Taipan_20050427_H
18 #define escript_Taipan_20050427_H
19 #include "system_dep.h"
20 
21 namespace escript {
22 
43 
44  public:
45 
46 typedef long size_type; // needs to be parallelised by openmp. It should not take negative values.
47  // do not assume that it is unsigned though
48 
62  Taipan();
63 
77  ~Taipan();
78 
87  double*
88  new_array(size_type dim, size_type N);
89 
96  void
97  delete_array(double* array);
98 
104  void
105  release_unused_arrays();
106 
111  int
112  num_arrays();
113 
118  int
119  num_arrays(size_type N);
120 
125  int
126  num_free(size_type N);
127 
132  long
133  num_elements();
134 
139  void
140  dump_stats();
141 
146  void
147  clear_stats();
148 
149  protected:
150 
151  private:
155  void operator=(const Taipan& c){}
156 
157  typedef struct Taipan_StatTable {
158  int requests;
159  int frees;
166 
168 
169  typedef struct Taipan_MemTable {
170  double* array;
174  bool free;
176  } Taipan_MemTable;
177 
179 
181 
182 };
183 
184 } // end of namespace
185 
186 #endif