NAMD
Classes | Public Member Functions | List of all members
RecBisection Class Reference

#include <RecBisection.h>

Public Member Functions

 RecBisection (int, PatchMap *)
 
 ~RecBisection ()
 
int partition (int *)
 

Detailed Description

Definition at line 103 of file RecBisection.h.

Constructor & Destructor Documentation

RecBisection::RecBisection ( int  numpartitions,
PatchMap thePatchMap 
)

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 18 of file RecBisection.C.

References NAMD_die(), and PatchMap::numPatches().

19 {
20  patchMap = thePatchMap;
21  npartition = numpartitions;
22  numPatches = patchMap->numPatches();
23  partitions = new Partition[npartition];
24  patchload = new PatchLoad[numPatches];
25  currentp = 0;
26 
27  if ( partitions == NULL ||
28  patchload == NULL )
29  {
30  NAMD_die("memory allocation failed in RecBisection::RecBisection");
31  }
32 
33 
34  // the cost coeffiencients that is used to compute the load introduced
35  // to the processor by a patch
36 
37  c_local0 = 1;
38  c_local1 = 0.015;
39  c_edge0 = 0.001;
40  c_edge1 = 0.001;
41  c_icompute0 = 0.001;
42  c_icompute1 = 0.000035;
43 
44  //c_local0 = 1.0;
45  //c_local1 = 0.;
46  //c_edge0 = 0.;
47  //c_edge1 = 0.;
48  //c_icompute0 = 0.;
49  //c_icompute1 = 0.;
50 }
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ cudaTextureObject_t const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
void NAMD_die(const char *err_msg)
Definition: common.C:85
int numPatches(void) const
Definition: PatchMap.h:59
RecBisection::~RecBisection ( )

Definition at line 56 of file RecBisection.C.

57 {
58  delete [] partitions;
59  delete [] patchload;
60 }

Member Function Documentation

int RecBisection::partition ( int *  dest_arr)

Definition at line 293 of file RecBisection.C.

References PatchMap::gridsize_a(), PatchMap::gridsize_b(), and PatchMap::gridsize_c().

294 {
295  int i;
296 
297  top_partition.origin.x = 0;
298  top_partition.origin.y = 0;
299  top_partition.origin.z = 0;
300  top_partition.corner.x = patchMap->gridsize_a()-1;
301  top_partition.corner.y = patchMap->gridsize_b()-1;
302  top_partition.corner.z = patchMap->gridsize_c()-1;
303  top_partition.load = 0.0;
304 
305  // calculate estimated computational load due to each patch
306  compute_patch_load();
307 
308  for(i=0; i<numPatches; i++) top_partition.load += patchload[i].total;
309 
310  // divide into rectangular prisms with load as equal as possible
311  rec_divide(npartition,top_partition);
312 
313  if (currentp != npartition)
314  return 0;
315  else {
316  if (dest_arr==NULL)
317  assignNodes();
318  else
319  assign_nodes_arr(dest_arr);
320  }
321 
322  return 1;
323 }
int gridsize_c(void) const
Definition: PatchMap.h:66
int gridsize_a(void) const
Definition: PatchMap.h:64
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ cudaTextureObject_t const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
int gridsize_b(void) const
Definition: PatchMap.h:65

The documentation for this class was generated from the following files: