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 296 of file BackEnd.C.

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

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

00296                          {
00297   Node::Object()->enableExitScheduler();
00298 }

void BackEnd::barrier ( void   )  [static]

Definition at line 301 of file BackEnd.C.

References awaken(), and suspend().

00301                           {
00302   awaken();
00303   suspend();
00304 }

void BackEnd::exit ( void   )  [static]

Definition at line 260 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().

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

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 223 of file BackEnd.C.

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

Referenced by main().

00223                                         {
00224 
00225   gNAMDBinaryName = argv[0]+strlen(argv[0])-1;
00226   while(gNAMDBinaryName != argv[0]){
00227     if(*gNAMDBinaryName=='/' || *gNAMDBinaryName=='\\'){
00228       gNAMDBinaryName++;
00229       break;
00230     }
00231     gNAMDBinaryName--;
00232   }
00233 
00234 #if defined(NAMD_CUDA) || defined(NAMD_MIC)
00235   // look for but don't remove +idlepoll on command line
00236   int idlepoll = 0;
00237   for ( int i = 0; i < argc; ++i ) {
00238     if ( 0==strcmp(argv[i],"+idlepoll") ) {
00239       idlepoll = 1;
00240       break;
00241     }
00242   }
00243 #endif
00244 
00245   ConverseInit(argc, argv, slave_init, 1, 1);  // calls slave_init on others
00246 
00247 // idlepoll only matters for non-smp UDP layer
00248 #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
00249   if ( ! idlepoll ) {
00250     NAMD_die("Please add +idlepoll to command line for proper performance.");
00251   }
00252 #endif
00253 
00254   master_init(argc, argv);
00255 }

void BackEnd::suspend ( void   )  [static]

Definition at line 291 of file BackEnd.C.

Referenced by barrier().

00291                           {
00292   CsdScheduler(-1);
00293 }


The documentation for this class was generated from the following files:
Generated on Tue Nov 21 01:17:17 2017 for NAMD by  doxygen 1.4.7