/******************************************************************* * * DESCRIPTION: main * * DATE: 12/11/99 * DATE: 30/08/2000 (v3) * *******************************************************************/ /** include files **/ #include #include #include "strutil.h" // isNumeric #include "stdaload.h" // class StandAloneLoader #include "netload.h" // class NetLoader #include "parsimu.h" // class ParallelMainSimulator #include "pmodeladm.h" // class SingleParallelModelAdm #include "JackyDebugStream.h" #ifdef JACKY_DEBUG #include //sleep() #endif int main( int argc, char *argv[] ) { //for debugging on one machine, uncomment the following block to allow time //for the DDD or GDB to attach to this program /* #ifdef JACKY_DEBUG //$$$jacky: using sleep to hold on the execution cout << "Sleep 30 seconds, please attach GDB to this processID now..." << endl; sleep(30); cout << "PCD resumed!!!" << endl; #endif */ #ifdef JACKY_STATISTICS //[2006-04-02] BasicTimeWarp::initializationWatch.start(); #endif //end JACKY_STATISTICS //[2006-04-02] SimLoader *loader = NULL; try { #ifndef __unix__ loader = new StandAloneLoader(argc, argv); #else #ifdef __ONLY_STAND_ALONE_MODE__ loader = new StandAloneLoader(argc, argv); #else if( argc == 1 ) { cout << "PCD++" << endl; cout << "The network loader is not currently supported" << endl; cout << endl << "Please run pcd -h for help" << endl; return 0; //loader = new NetworkLoader(argc, argv); } else { loader = new StandAloneLoader(argc, argv) ; } #endif #endif ParallelMainSimulator::Instance().loader( loader ); ParallelMainSimulator::Instance().run(); } catch( const MException &e ) { e.print(cerr); if (loader != NULL) { cerr << "1. main.cpp calles loader->closeComm()" << endl; loader->closeComm(); } } catch( ... ) { cerr << "Unknown Exception!!! " << endl; if (loader != NULL) { cerr << "1. main.cpp calles loader->closeComm()" << endl; loader->closeComm(); } } if (loader != NULL) { //cerr << "main.cpp delete loader!" << endl; delete loader; } return 0; }