Project
Loading...
Searching...
No Matches
o2sim.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include "../macro/o2sim.C"
13#include <SimConfig/SimConfig.h>
14#include <TStopwatch.h>
15#include <fairlogger/Logger.h>
16
17int main(int argc, char* argv[])
18{
19 TStopwatch timer;
20 timer.Start();
21 auto& conf = o2::conf::SimConfig::Instance();
22#ifdef SIM_RUN5
23 conf.setRun5();
24#endif
25 if (!conf.resetFromArguments(argc, argv)) {
26 return 1;
27 }
28
29 // customize the level of output
30 FairLogger::GetLogger()->SetLogScreenLevel(conf.getLogSeverity().c_str());
31 FairLogger::GetLogger()->SetLogVerbosityLevel(conf.getLogVerbosity().c_str());
32
33 // call o2sim "macro"
34 o2sim(false);
35
37
38 // print total time
39 LOG(info) << "Simulation process took " << timer.RealTime() << " s";
40
41 // We do this instead of return 0
42 // for the reason that we see lots of problems
43 // with TROOTs atexit mechanism often triggering double-free or delete symptoms.
44 // While this is not optimal ... I think it is for the moment
45 // better to have a stable simulation runtime in contrast to
46 // having to debug complicated "atexit" memory problems.
47 _exit(0);
48}
static SimConfig & Instance()
Definition SimConfig.h:111
static ShmManager & Instance()
Definition ShmManager.h:61
#define main
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"