/[escript]/trunk/escript/src/Taipan.h
ViewVC logotype

Diff of /trunk/escript/src/Taipan.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC revision 151 by jgs, Thu Sep 22 01:55:00 2005 UTC
# Line 26  namespace escript { Line 26  namespace escript {
26     Taipan: data-array manager.     Taipan: data-array manager.
27    
28     The Taipan data-array manager holds a set of (dim x N) arrays distributed across a number of threads.     The Taipan data-array manager holds a set of (dim x N) arrays distributed across a number of threads.
29     If a (dim x N) array is requested via the Taipan allocator, the pool of managed arrays is searched for     If a (dim x N) array is requested via the Taipan allocator, the buffer of managed arrays is searched for
30     a free array of this size on the current number of threads. If none is available, a new one is allocated     a free array of this size on the current number of threads. If none is available, a new one is allocated
31     and added to the pool of managed arrays.     and added to the buffer of managed arrays.
32    
33     When a managed array is deallocated, the array is marked as free but not returned to the system as long     When a managed array is deallocated, the array is marked as free but not returned to the system as long
34     as at least one array with dimension N is in use. Otherwise all arrays with second dimsenion N are     as at least one array of N is in use. Otherwise all arrays of N are deallocated as it is assumed that
35     deallocated as it is assumed that arrays with second dimension N will not be used anymore.     these arrays not be used anymore. The exceptions to this strategy are arrays with N=0 or N=1, these
36       arrays are never deallocated, but are kept for possible reuse.
    Template Parameters:  
    For templates describe any conditions that the parameters used in the  
    template must satisfy  
37  */  */
38    
39  class Taipan {  class Taipan {
# Line 80  class Taipan { Line 77  class Taipan {
77       The parameter "dim" defines the contiguous "blocksize" within the array.       The parameter "dim" defines the contiguous "blocksize" within the array.
78       Where the array is allocated accross multiple threads, it will be split       Where the array is allocated accross multiple threads, it will be split
79       on block boundaries only. N defines the number of "blocks" in the array.       on block boundaries only. N defines the number of "blocks" in the array.
   
      Where escript Data objects are concerned, N corresponds to the number of samples,  
      and dim correesponds to the number of data-points per sample multiplied by the  
      number of entries in a data-point.  
80    */    */
81    double*    double*
82    new_array(int dim, int N);    new_array(int dim, int N);
# Line 144  class Taipan { Line 137  class Taipan {
137   private:   private:
138    
139    typedef struct Taipan_StatTable {    typedef struct Taipan_StatTable {
140      int allocs;      int requests;
141      int deallocs;      int frees;
142      int arrays;      int allocations;
143      int dearrays;      int deallocations;
144      long elements;      long allocated_elements;
145      long deelements;      long deallocated_elements;
146        long max_tab_size;
147    } Taipan_StatTable;    } Taipan_StatTable;
148    
149    Taipan_StatTable* statTable;    Taipan_StatTable* statTable;

Legend:
Removed from v.149  
changed lines
  Added in v.151

  ViewVC Help
Powered by ViewVC 1.1.26