Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

RecBisection Class Reference

#include <RecBisection.h>

List of all members.

Public Member Functions

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


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().

00019 {
00020     patchMap    = thePatchMap;
00021     npartition  = numpartitions;
00022     numPatches  = patchMap->numPatches();
00023     partitions  = new Partition[npartition];
00024     patchload   = new PatchLoad[numPatches];
00025     currentp    = 0;
00026 
00027     if ( partitions == NULL ||
00028          patchload == NULL )
00029     {
00030       NAMD_die("memory allocation failed in RecBisection::RecBisection");
00031     }
00032 
00033 
00034     // the cost coeffiencients that is used to compute the load introduced
00035     // to the processor by a patch
00036 
00037     c_local0    = 1;
00038     c_local1    = 0.015;
00039     c_edge0     = 0.001;
00040     c_edge1     = 0.001;
00041     c_icompute0 = 0.001;
00042     c_icompute1 = 0.000035;
00043 
00044     //c_local0    = 1.0;
00045     //c_local1    = 0.;
00046     //c_edge0     = 0.;
00047     //c_edge1     = 0.;
00048     //c_icompute0 = 0.;
00049     //c_icompute1 = 0.;
00050 }

RecBisection::~RecBisection  ) 
 

Definition at line 56 of file RecBisection.C.

00057 {
00058     delete [] partitions; 
00059     delete [] patchload;
00060 }


Member Function Documentation

int RecBisection::partition int *   ) 
 

Definition at line 293 of file RecBisection.C.

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

00294 {
00295     int i;
00296   
00297     top_partition.origin.x = 0; 
00298     top_partition.origin.y = 0; 
00299     top_partition.origin.z = 0; 
00300     top_partition.corner.x  = patchMap->gridsize_a()-1;
00301     top_partition.corner.y  = patchMap->gridsize_b()-1;
00302     top_partition.corner.z  = patchMap->gridsize_c()-1;
00303     top_partition.load      = 0.0;
00304 
00305     // calculate estimated computational load due to each patch
00306     compute_patch_load();
00307 
00308     for(i=0; i<numPatches; i++) top_partition.load += patchload[i].total;
00309 
00310     // divide into rectangular prisms with load as equal as possible
00311     rec_divide(npartition,top_partition);
00312 
00313     if (currentp != npartition) 
00314           return 0;
00315     else  {
00316       if (dest_arr==NULL)
00317           assignNodes();
00318       else
00319           assign_nodes_arr(dest_arr);
00320     }
00321 
00322     return 1;
00323 }


The documentation for this class was generated from the following files:
Generated on Fri May 24 04:07:31 2013 for NAMD by  doxygen 1.3.9.1