00001
00002
00003
00004 #include "GaudiKernel/SmartIF.h"
00005 #include "GaudiKernel/Bootstrap.h"
00006 #include "GaudiKernel/IAppMgrUI.h"
00007 #include "GaudiKernel/IProperty.h"
00008 #include "GaudiKernel/IJobOptionsSvc.h"
00009 #include "GaudiKernel/System.h"
00010
00011
00012
00013
00014
00015
00016
00025
00026 void setPriority();
00027
00028 int main( int argn, char** argc) {
00029
00030 std::string joboptions_file="src/jobOptions.txt";
00031
00032 const char* job = ::getenv("JOBOPTIONS");
00033
00034 if( argn>1 ) { joboptions_file = argc[1];}
00035 else if( job ) { joboptions_file = job; }
00036 std::cerr << "Starting Glast-Gaudi job with job options file "
00037 << joboptions_file << std::endl;
00038
00039
00040
00041 IInterface* iface = Gaudi::createApplicationMgr();
00042
00043 SmartIF<IProperty> propMgr ( IID_IProperty, iface );
00044 SmartIF<IAppMgrUI> appMgr ( IID_IAppMgrUI, iface );
00045
00046
00047 StatusCode status = StatusCode::SUCCESS;
00048 if ( iface && propMgr == iface ) {
00049 status = propMgr->setProperty( "JobOptionsPath", joboptions_file );
00050 }
00051 else return 2;
00052
00053
00054 if ( appMgr ) {
00055 #ifdef WIN32
00056 setPriority();
00057 #endif
00058 status = appMgr->run();
00059 }
00060 else return 3;
00061
00062 return (status.isFailure()? 1 : 0);
00063
00064 }