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

ProxyMgr.C File Reference

#include "InfoStream.h"
#include "main.h"
#include "BOCgroup.h"
#include "ProxyMgr.decl.h"
#include "ProxyMgr.h"
#include "PatchMap.inl"
#include "ProxyPatch.h"
#include "ComputeMap.h"
#include "HomePatch.h"
#include <string.h>
#include "ProcessorPrivate.h"
#include "packmsg.h"
#include "Priorities.h"
#include "Debug.h"
#include "ProxyMgr.def.h"

Go to the source code of this file.

Defines

#define MIN_DEBUG_LEVEL   2
#define MAX_INTERNODE   1

Functions

 PACK_MSG (ProxyAtomsMsg, PACK(patch);PACK_RESIZE(atomIDList);)
int compLoad (const void *a, const void *b)
void processCpuLoad ()
int noInterNode (int p)

Variables

int proxySendSpanning = 0
int proxyRecvSpanning = 0
const int proxySpanDim = 9
const int inNodeProxySpanDim = 16
double * cpuloads
int * procidx = NULL
double averageLoad = 0.0


Define Documentation

#define MAX_INTERNODE   1
 

Definition at line 575 of file ProxyMgr.C.

Referenced by ProxyMgr::buildSpanningTree0().

#define MIN_DEBUG_LEVEL   2
 

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

Definition at line 22 of file ProxyMgr.C.


Function Documentation

int compLoad const void *  a,
const void *  b
[static]
 

Definition at line 611 of file ProxyMgr.C.

References cpuloads.

Referenced by processCpuLoad().

00612 {
00613   int i1 = *(int *)a;
00614   int i2 = *(int *)b;
00615   double d1 = cpuloads[i1];
00616   double d2 = cpuloads[i2];
00617   if (d1 < d2) 
00618     return 1;
00619   else if (d1 == d2) 
00620     return 0;
00621   else 
00622     return -1;
00623   // sort from high to low
00624 }

int noInterNode int  p  )  [static]
 

Definition at line 642 of file ProxyMgr.C.

References procidx.

Referenced by ProxyMgr::buildSpanningTree0().

00643 {
00644   int exclude = 0;
00645   if(CkNumPes()<1025)
00646     exclude = 5;
00647   else if(CkNumPes()<4097)
00648     exclude = 10;
00649   else if(CkNumPes()<8193)
00650     exclude = 40;
00651   else if(CkNumPes()<16385)
00652     exclude = 40;
00653   else
00654     exclude = 80;
00655   for (int i=0; i<exclude; i++) if (procidx[i] == p) return 1;
00656 //  if (cpuloads[p] > averageLoad) return 1;
00657   return 0;
00658 }

PACK_MSG ProxyAtomsMsg  ,
PACK(patch);PACK_RESIZE(atomIDList); 
 

Definition at line 30 of file ProxyMgr.C.

References ALIGN_8, ResizeArray< Elem >::begin(), CmiMemcpy, Force, ProxyResultMsg::forceList, ProxyResultMsg::node, ProxyResultMsg::patch, ResizeArray< Elem >::size(), Vector::x, Vector::y, and Vector::z.

00041                                               {
00042 
00043   int msg_size = 0;
00044   msg_size += sizeof(msg->node);
00045   msg_size += sizeof(msg->patch);
00046 
00047   int j;
00048   for ( j = 0; j < Results::maxNumForces; ++j ) {
00049     int array_size = msg->forceList[j].size();
00050     msg_size += sizeof(array_size);
00051     msg_size += array_size * sizeof(char);    
00052     msg_size = ALIGN_8 (msg_size);
00053     Force* f = msg->forceList[j].begin();
00054     int nonzero_count = 0;
00055     for ( int i = 0; i < array_size; ++i ) {
00056       if ( f[i].x != 0. || f[i].y != 0. || f[i].z != 0. ) { ++nonzero_count; }
00057     }
00058     msg_size += nonzero_count * sizeof(Vector);
00059   }
00060 
00061   void *msg_buf = CkAllocBuffer(msg,msg_size);
00062   char *msg_cur = (char *)msg_buf;
00063 
00064   CmiMemcpy((void*)msg_cur,(void*)(&(msg->node)),sizeof(msg->node));
00065   msg_cur += sizeof(msg->node);
00066   CmiMemcpy((void*)msg_cur,(void*)(&(msg->patch)),sizeof(msg->patch));
00067   msg_cur += sizeof(msg->patch);
00068   for ( j = 0; j < Results::maxNumForces; ++j ) {
00069     int array_size = msg->forceList[j].size();
00070     *(int *) msg_cur = array_size;
00071     msg_cur += sizeof(int);
00072     char *nonzero = msg_cur;
00073     msg_cur += array_size * sizeof(char);
00074     msg_cur = (char *)ALIGN_8 (msg_cur);
00075     Vector *farr = (Vector *)msg_cur;
00076     Force* f = msg->forceList[j].begin();
00077 
00078     for ( int i = 0; i < array_size; ++i ) {
00079       if ( f[i].x != 0. || f[i].y != 0. || f[i].z != 0. ) {
00080         nonzero[i] = 1;
00081         farr->x = f[i].x;
00082         farr->y = f[i].y;
00083         farr->z = f[i].z;
00084         farr ++;
00085       } else {
00086         nonzero[i] = 0;
00087       }
00088     }
00089     msg_cur = (char *) farr;      
00090   }
00091 
00092   delete msg;
00093   return msg_buf;
00094 }

void processCpuLoad  )  [static]
 

Definition at line 626 of file ProxyMgr.C.

References averageLoad, compLoad(), cpuloads, and procidx.

Referenced by ProxyMgr::buildSpanningTree0().

00627 {
00628   int i;
00629   if (!procidx) {
00630     procidx = new int[CkNumPes()];
00631   }
00632   for (i=0; i<CkNumPes(); i++) procidx[i] = i;
00633   qsort(procidx, CkNumPes(), sizeof(int), compLoad);
00634 
00635   double averageLoad = 0.0;
00636   for (i=0; i<CkNumPes(); i++) averageLoad += cpuloads[i];
00637   averageLoad /= CkNumPes();
00638 //  iout << "buildSpanningTree1: no intermediate node on " << procidx[0] << " " << procidx[1] << endi;
00639 
00640 }


Variable Documentation

double averageLoad = 0.0 [static]
 

Definition at line 609 of file ProxyMgr.C.

Referenced by processCpuLoad().

double* cpuloads
 

Definition at line 24 of file NamdCentLB.C.

Referenced by compLoad(), CreateNamdCentLB(), and processCpuLoad().

const int inNodeProxySpanDim = 16
 

Definition at line 28 of file ProxyMgr.C.

int* procidx = NULL [static]
 

Definition at line 608 of file ProxyMgr.C.

Referenced by noInterNode(), and processCpuLoad().

int proxyRecvSpanning = 0
 

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

Definition at line 26 of file ProxyMgr.C.

Referenced by ProxyMgr::buildProxySpanningTree(), and ProxyMgr::setRecvSpanning().

int proxySendSpanning = 0
 

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

Definition at line 25 of file ProxyMgr.C.

Referenced by ProxyMgr::buildProxySpanningTree(), Sync::openSync(), HomePatch::positionsReady(), ProxyMgr::recvImmediateProxyAll(), ProxyMgr::recvImmediateProxyData(), RefineOnly::RefineOnly(), RefineTorusLB::RefineTorusLB(), ProxyMgr::setSendSpanning(), Node::startup(), and ComputeMgr::updateLocalComputes5().

const int proxySpanDim = 9
 

Definition at line 27 of file ProxyMgr.C.

Referenced by HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), and ProxyMgr::recvNodeAwareSpanningTree().


Generated on Sun Jul 6 04:07:44 2008 for NAMD by  doxygen 1.3.9.1