Project
Loading...
Searching...
No Matches
O2SimDeviceRunner.cxx File Reference
#include "O2SimDevice.h"
#include "SimSetup/SimSetup.h"
#include <SimConfig/SimConfig.h>
#include <Steer/O2MCApplication.h>
#include <TVirtualMC.h>
#include <thread>
#include <fairmq/DeviceRunner.h>
#include <boost/program_options.hpp>
#include <memory>
#include <string>
#include <fairmq/Channel.h>
#include <mutex>
#include <vector>
#include <fairlogger/Logger.h>
#include <fairmq/Parts.h>
#include <fairmq/TransportFactory.h>
#include <TStopwatch.h>
#include <sys/wait.h>
#include <pthread.h>
#include <cmath>
#include <csignal>
#include <unistd.h>
#include "SimPublishChannelHelper.h"
#include "DetectorsBase/MTWorkerHooks.h"
#include <SimulationDataFormat/PrimaryChunk.h>
#include <TROOT.h>
#include <atomic>
#include "rapidjson/document.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/filereadstream.h"
#include <SimSetup/StaticTLSReserve.h>

Go to the source code of this file.

Classes

struct  KernelSetup
 
struct  MTChannels
 

Functions

void sigaction_handler (int signal, siginfo_t *signal_info, void *)
 
void addCustomOptions (bpo::options_description &options)
 
void CustomCleanup (void *data, void *hint)
 
bool initializeSim (std::string transport, std::string address, std::unique_ptr< FairRunSim > &simptr)
 
o2::devices::O2SimDevice * getDevice ()
 
fair::mq::Device * getDevice (const fair::mq::ProgOptions &config)
 
int initAndRunDevice (int argc, char *argv[])
 
KernelSetup initSim (std::string transport, std::string primaddress, std::string primstatusaddress, std::string mergeraddress, int workerID)
 
int runSim (KernelSetup setup)
 
void pinToCPU (unsigned int cpuid)
 
bool waitForControlInput (int workerID)
 
fair::mq::Channel * makeWorkerChannel (std::unique_ptr< fair::mq::Channel > &owner, char const *name, char const *type, std::string const &address)
 
void closeMTChannels ()
 
void installMTWorkerHooks (std::string const &serveraddress, std::string const &mergeraddress)
 
void runMT (std::string const &serveraddress, std::string const &mergeraddress, fair::mq::Channel &pubchannel)
 
int main (int argc, char *argv[])
 

Variables

std::vector< int > gChildProcesses
 
int gMasterProcess = -1
 
int gDriverProcess = -1
 
std::atomic< bool > gServerDone {false}
 
std::atomic< int > gNextWorkerID {0}
 
std::atomic< int > gChunkRequests {0}
 
MTChannels gMTChannels
 

Function Documentation

◆ addCustomOptions()

void addCustomOptions ( bpo::options_description &  options)

Definition at line 94 of file O2SimDeviceRunner.cxx.

◆ closeMTChannels()

void closeMTChannels ( )

Definition at line 302 of file O2SimDeviceRunner.cxx.

◆ CustomCleanup()

void CustomCleanup ( void *  data,
void *  hint 
)

Definition at line 98 of file O2SimDeviceRunner.cxx.

◆ getDevice() [1/2]

o2::devices::O2SimDevice * getDevice ( )

Definition at line 113 of file O2SimDeviceRunner.cxx.

◆ getDevice() [2/2]

fair::mq::Device * getDevice ( const fair::mq::ProgOptions &  config)

Definition at line 124 of file O2SimDeviceRunner.cxx.

◆ initAndRunDevice()

int initAndRunDevice ( int  argc,
char *  argv[] 
)

Definition at line 129 of file O2SimDeviceRunner.cxx.

◆ initializeSim()

bool initializeSim ( std::string  transport,
std::string  address,
std::unique_ptr< FairRunSim > &  simptr 
)

Definition at line 102 of file O2SimDeviceRunner.cxx.

◆ initSim()

KernelSetup initSim ( std::string  transport,
std::string  primaddress,
std::string  primstatusaddress,
std::string  mergeraddress,
int  workerID 
)

Definition at line 167 of file O2SimDeviceRunner.cxx.

◆ installMTWorkerHooks()

void installMTWorkerHooks ( std::string const &  serveraddress,
std::string const &  mergeraddress 
)

Definition at line 313 of file O2SimDeviceRunner.cxx.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 402 of file O2SimDeviceRunner.cxx.

◆ makeWorkerChannel()

fair::mq::Channel * makeWorkerChannel ( std::unique_ptr< fair::mq::Channel > &  owner,
char const *  name,
char const *  type,
std::string const &  address 
)

Definition at line 291 of file O2SimDeviceRunner.cxx.

◆ pinToCPU()

void pinToCPU ( unsigned int  cpuid)

Definition at line 201 of file O2SimDeviceRunner.cxx.

◆ runMT()

void runMT ( std::string const &  serveraddress,
std::string const &  mergeraddress,
fair::mq::Channel &  pubchannel 
)

Definition at line 350 of file O2SimDeviceRunner.cxx.

◆ runSim()

int runSim ( KernelSetup  setup)

Definition at line 191 of file O2SimDeviceRunner.cxx.

◆ sigaction_handler()

void sigaction_handler ( int  signal,
siginfo_t *  signal_info,
void *   
)

Definition at line 56 of file O2SimDeviceRunner.cxx.

◆ waitForControlInput()

bool waitForControlInput ( int  workerID)

Definition at line 238 of file O2SimDeviceRunner.cxx.

Variable Documentation

◆ gChildProcesses

std::vector<int> gChildProcesses
Author
Sandro Wenzel

Definition at line 51 of file O2SimDeviceRunner.cxx.

◆ gChunkRequests

std::atomic<int> gChunkRequests {0}

Definition at line 279 of file O2SimDeviceRunner.cxx.

◆ gDriverProcess

int gDriverProcess = -1

Definition at line 53 of file O2SimDeviceRunner.cxx.

◆ gMasterProcess

int gMasterProcess = -1

Definition at line 52 of file O2SimDeviceRunner.cxx.

◆ gMTChannels

MTChannels gMTChannels

Definition at line 289 of file O2SimDeviceRunner.cxx.

◆ gNextWorkerID

std::atomic<int> gNextWorkerID {0}

Definition at line 278 of file O2SimDeviceRunner.cxx.

◆ gServerDone

std::atomic<bool> gServerDone {false}

Definition at line 277 of file O2SimDeviceRunner.cxx.