예제 #1
0
void TempAwareRefineLB::changeFreq(int nFreq)
{
#ifdef TEMP_LDB
        //CkPrintf("PROC#%d in changeFreq numProcs=%d\n",CkMyPe(),nFreq);
//  for(int i=0;i<numProcs;i++)
  {
//        if(procFreq[i]!=procFreqNew[i])
        {
              char newfreq[10];
              sprintf(newfreq,"%d",nFreq);
              cpufreq_sysfs_write(newfreq,CkMyPe()%physicalCoresPerNode);//i%physicalCoresPerNode);
//            CkPrintf("PROC#%d freq changing from %d to %d temp=%f\n",i,procFreq[i],procFreqNew[i],procTemp[i]);
        }
  }
#endif
}
예제 #2
0
파일: CentralLB.C 프로젝트: luyukunphy/namd
/*
void CentralLB::changeFreq(int r)
{
	CkAbort("ERROR: changeFreq in CentralLB should never be called!\n");
}
*/
void CentralLB::changeFreq(int nFreq)
{
#ifdef TEMP_LDB
        //CkPrintf("PROC#%d in changeFreq numProcs=%d\n",CkMyPe(),nFreq);
//  for(int i=0;i<numProcs;i++)
  {
//        if(procFreq[i]!=procFreqNew[i])
        {
              char newfreq[10];
              sprintf(newfreq,"%d",nFreq);
              cpufreq_sysfs_write(newfreq,CkMyPe()%physicalCoresPerNode);//i%physicalCoresPerNode);
//            CkPrintf("PROC#%d freq changing from %d to %d temp=%f\n",i,procFreq[i],procFreqNew[i],procTemp[i]);
        }
  }
#else
	CmiAbort("You should never call CentralLB::changeFreq without using the flag TEMP_LDB\n");
#endif

}
예제 #3
0
TempAwareRefineLB::TempAwareRefineLB(const CkLBOptions &opt): CentralLB(opt)
{
#ifdef TEMP_LDB
starting=CmiWallTimer();
//  procsPerNode=4;
migFile=fopen("migInfo","w");
  numAvailFreqs = 11;
//numAvailFreqs = 14;
//numAvailFreqs = 7;  
freqs=new int[numAvailFreqs];
freqsEffect=new int[numAvailFreqs];
// for might (lab machine)
/*
  freqs[0] = 2262000;
  freqs[1] = 2261000;
  freqs[2] = 2128000;
  freqs[3] = 1995000;
  freqs[4] = 1862000;
  freqs[5] = 1729000;
  freqs[6] = 1596000;
*/

// for tarekc cluster
  freqs[0] = 2395000;
  freqs[1] = 2394000;
  freqs[2] = 2261000;
  freqs[3] = 2128000;
  freqs[4] = 1995000;
  freqs[5] = 1862000;
  freqs[6] = 1729000;
  freqs[7] = 1596000;
  freqs[8] = 1463000;
  freqs[9] = 1330000;
  freqs[10] = 1197000;

	freqsEffect[0] = 1979886;
  freqsEffect[1] = 1943017;
  freqsEffect[2] = 1910989;
  freqsEffect[3] = 1876619;
  freqsEffect[4] = 1824126;
  freqsEffect[5] = 1763990;
  freqsEffect[6] = 1666773;
  freqsEffect[7] = 1560224;
  freqsEffect[8] = 1443154;
  freqsEffect[9] = 1317009;
  freqsEffect[10] = 1200000;


/*
// for grace, humility etc (lab i7 machines)
  freqs[0] = 2801000;
  freqs[1] = 2800000;
  freqs[2] = 2667000;
  freqs[3] = 2533000;
  freqs[4] = 2400000;
  freqs[5] = 2267000;
freqs[6] = 2133000;
freqs[7] = 2000000;
freqs[8] = 1867000;
freqs[9] = 1733000;
freqs[10] = 1600000;
freqs[11] = 1467000;
freqs[12] = 1333000;
  freqs[13] = 1200000;
*/

  procFreqPtr = new int[CkNumPes()];

  for(int i=0;i<CkNumPes();i++)
  {
        char newfreq[10];
        sprintf(newfreq,"%d",freqs[0]);
	cpufreq_sysfs_write(newfreq,i%physicalCoresPerNode);	
	procFreqPtr[i]=0;
  }
//  logicalCoresPerChip=4;
  procFreq=NULL;
  procTemp=NULL;
	procFreqNew=NULL;
	procFreqNewEffect = NULL;
	avgChipTemp=NULL;
  lbname = "TempAwareRefineLB";
  if (CkMyPe()==0)
    CkPrintf("[%d] TempAwareRefineLB created\n",CkMyPe());

  char logFile[100];
  snprintf(logFile, sizeof(logFile), "temp_freq.log.%d", CkMyPe());
  if ((logFD = fopen(logFile, "a"))) {
    fprintf(logFD, "Time, PE, Temperature, Frequency\n");
  } else {
    CkAbort("Couldn't open temperature/frequency log file");
  }


  CcdCallOnConditionKeep(CcdPERIODIC_1second, &printCurrentTemperature, this);
#else
	CmiAbort("TEMPLB ERROR: not supported without TEMP_LDB flag.\n");
#endif

}
예제 #4
0
TempAwareCommLB::TempAwareCommLB(const CkLBOptions &opt): CBase_TempAwareCommLB(opt)
{
#ifdef TEMP_LDB
  lbname = "TempAwareCommLB";
  if (CkMyPe()==0)
    CkPrintf("[%d] TempAwareCommLB created\n",CkMyPe());

	starting=CmiWallTimer();
	migFile=fopen("migInfo","w");
  numAvailFreqs = 11;
	freqs=new int[numAvailFreqs];
	freqsEffect=new int[numAvailFreqs];
// for tarekc cluster
  freqs[0] = 2395000;
  freqs[1] = 2394000;
  freqs[2] = 2261000;
  freqs[3] = 2128000;
  freqs[4] = 1995000;
  freqs[5] = 1862000;
  freqs[6] = 1729000;
  freqs[7] = 1596000;
  freqs[8] = 1463000;
  freqs[9] = 1330000;
  freqs[10] = 1197000;

  freqsEffect[0] = 1979886;
  freqsEffect[1] = 1943017;
  freqsEffect[2] = 1910989;
  freqsEffect[3] = 1876619;
  freqsEffect[4] = 1824126;
  freqsEffect[5] = 1763990;
  freqsEffect[6] = 1666773;
  freqsEffect[7] = 1560224;
  freqsEffect[8] = 1443154;
  freqsEffect[9] = 1317009;
  freqsEffect[10] = 1200000;

  procFreqPtr = new int[CkNumPes()];

  for(int i=0;i<CkNumPes();i++)
  {
        char newfreq[10];
        sprintf(newfreq,"%d",freqs[0]);
  cpufreq_sysfs_write(newfreq,i%physicalCoresPerNode);
  procFreqPtr[i]=0;
  }

  procFreq=NULL;
  procTemp=NULL;
  procFreqNew=NULL;
  procFreqNewEffect = NULL;
  avgChipTemp=NULL;

  char logFile[100];
  snprintf(logFile, sizeof(logFile), "temp_freq.log.%d", CkMyPe());
  if ((logFD = fopen(logFile, "a"))) {
    fprintf(logFD, "Time, PE, Temperature, Frequency\n");
  } else {
    CkAbort("Couldn't open temperature/frequency log file");
  }


  CcdCallOnConditionKeep(CcdPERIODIC_1second, &printCurrentTemperature, this);
#else
#endif
}