BackEnd Class Reference

#include <BackEnd.h>

List of all members.

Static Public Member Functions

static void init (int argc, char **argv)
static void exit (void)
static void suspend (void)
static void awaken (void)
static void barrier (void)
static void ExitSchedOn (int pe)


Detailed Description

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

Definition at line 12 of file BackEnd.h.


Member Function Documentation

void BackEnd::awaken ( void   )  [static]

Definition at line 303 of file BackEnd.C.

References Node::enableExitScheduler(), and Node::Object().

Referenced by Controller::algorithm(), barrier(), and Controller::terminate().

00303                          {
00304   Node::Object()->enableExitScheduler();
00305 }

void BackEnd::barrier ( void   )  [static]

Definition at line 308 of file BackEnd.C.

References awaken(), and suspend().

00308                           {
00309   awaken();
00310   suspend();
00311 }

void BackEnd::exit ( void   )  [static]

Definition at line 267 of file BackEnd.C.

References cpuTime_start, cuda_finalize(), memusage_MB(), and wallTime_start.

Referenced by after_backend_init(), Node::earlyExit(), colvarproxy_namd::exit(), NamdState::loadStructure(), and Node::startup().

00267                        {
00268   float cpuTime = CmiCpuTimer() - cpuTime_start;
00269   float wallTime = CmiWallTimer() - wallTime_start;
00270   CmiPrintf("====================================================\n\n"
00271             "WallClock: %f  CPUTime: %f  Memory: %f MB\n",
00272             wallTime, cpuTime, memusage_MB());
00273 #ifdef NAMD_TCL
00274   Tcl_Finalize();
00275 #endif
00276 #ifdef NAMD_CUDA
00277   cuda_finalize();
00278 #ifdef __APPLE__
00279 #if 0 && CMK_MULTICORE
00280   CmiPrintf("EXITING ABNORMALLY TO AVOID HANGING CUDA RUNTIME THREADS\n");
00281   ::exit(0);
00282 #endif
00283 #endif
00284 #endif
00285 #ifdef NAMD_MIC
00286 #if 0 && CMK_MULTICORE
00287   CmiPrintf("EXITING ABNORMALLY TO AVOID HANGING MIC OFFLOAD THREADS\n");
00288 #pragma offload target(mic)
00289   {
00290     ::exit(0);
00291   }
00292 #endif
00293 #endif
00294   CkExit();
00295 }

void BackEnd::ExitSchedOn ( int  pe  )  [static]

Definition at line 67 of file BackEnd.C.

00068 {
00069   void* msg = CmiAlloc(CmiMsgHeaderSizeBytes);
00070   CmiSetHandler(msg,CkpvAccess(exitSchedHndlr));
00071   CmiSyncSendAndFree(pe,CmiMsgHeaderSizeBytes,(char *)msg);
00072 }

void BackEnd::init ( int  argc,
char **  argv 
) [static]

Definition at line 225 of file BackEnd.C.

References cuda_affinity_initialize(), master_init(), NAMD_die(), and slave_init().

Referenced by main().

00225                                         {
00226 
00227   gNAMDBinaryName = argv[0]+strlen(argv[0])-1;
00228   while(gNAMDBinaryName != argv[0]){
00229     if(*gNAMDBinaryName=='/' || *gNAMDBinaryName=='\\'){
00230       gNAMDBinaryName++;
00231       break;
00232     }
00233     gNAMDBinaryName--;
00234   }
00235 
00236 #if defined(NAMD_CUDA) || defined(NAMD_MIC)
00237   // look for but don't remove +idlepoll on command line
00238   int idlepoll = 0;
00239   for ( int i = 0; i < argc; ++i ) {
00240     if ( 0==strcmp(argv[i],"+idlepoll") ) {
00241       idlepoll = 1;
00242       break;
00243     }
00244   }
00245 #endif
00246 
00247 #ifdef NAMD_CUDA
00248   // launch CUDA runtime threads before affinity is set
00249   cuda_affinity_initialize();
00250 #endif
00251 
00252   ConverseInit(argc, argv, slave_init, 1, 1);  // calls slave_init on others
00253 
00254 // idlepoll only matters for non-smp UDP layer
00255 #if (defined(NAMD_CUDA) || defined(NAMD_MIC)) && CMK_NET_VERSION && CMK_SHARED_VARS_UNAVAILABLE && CMK_WHEN_PROCESSOR_IDLE_USLEEP && ! CMK_USE_IBVERBS && ! CMK_USE_TCP
00256   if ( ! idlepoll ) {
00257     NAMD_die("Please add +idlepoll to command line for proper performance.");
00258   }
00259 #endif
00260 
00261   master_init(argc, argv);
00262 }

void BackEnd::suspend ( void   )  [static]

Definition at line 298 of file BackEnd.C.

Referenced by barrier().

00298                           {
00299   CsdScheduler(-1);
00300 }


The documentation for this class was generated from the following files:
Generated on Thu Jun 21 01:17:18 2018 for NAMD by  doxygen 1.4.7