BackEnd Class Reference

#include <BackEnd.h>

List of all members.

Static Public Member Functions

static void init (int argc, char **argv)
static void exit (int status=0)
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 309 of file BackEnd.C.

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

Referenced by barrier().

00309                          {
00310   Node::Object()->enableExitScheduler();
00311 }

void BackEnd::barrier ( void   )  [static]

Definition at line 314 of file BackEnd.C.

References awaken(), and suspend().

00314                           {
00315   awaken();
00316   suspend();
00317 }

void BackEnd::exit ( int  status = 0  )  [static]

Definition at line 269 of file BackEnd.C.

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

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

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

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

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

Referenced by main().

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

void BackEnd::suspend ( void   )  [static]

Definition at line 304 of file BackEnd.C.

Referenced by barrier().

00304                           {
00305   CsdScheduler(-1);
00306 }


The documentation for this class was generated from the following files:

Generated on 4 Jun 2020 for NAMD by  doxygen 1.6.1