|
ATLAS Offline Software
|
#include <VP1ExecutionScheduler.h>
|
static VP1ExecutionScheduler * | init (StoreGateSvc *eventStore, StoreGateSvc *detStore, ISvcLocator *svcLocator, IToolSvc *toolSvc, QStringList joboptions, QString initialCruiseMode="NONE", unsigned initialCruiseSeconds=10, QString singleEventSource="", QString singleEventLocalTmpDir="", unsigned localFileCacheLimit=10, QStringList availableLocalInputDirectories=QStringList()) |
|
static void | cleanup (VP1ExecutionScheduler *) |
|
Definition at line 42 of file VP1ExecutionScheduler.h.
◆ CruiseMode
◆ VP1ExecutionScheduler()
VP1ExecutionScheduler::VP1ExecutionScheduler |
( |
QObject * |
parent, |
|
|
StoreGateSvc * |
eventStore, |
|
|
StoreGateSvc * |
detStore, |
|
|
ISvcLocator * |
svcLocator, |
|
|
IToolSvc * |
toolSvc, |
|
|
VP1AvailEvents * |
availEvents |
|
) |
| |
Definition at line 233 of file VP1ExecutionScheduler.cxx.
269 connect(
m_d->
mainwindow->
tabManager(),SIGNAL(visibleChannelsChanged(
const QSet<IVP1ChannelWidget*>&,
const QSet<IVP1ChannelWidget*>&,
const double&)),
270 m_d->
prioritiser,SLOT(visibleChannelsChanged(
const QSet<IVP1ChannelWidget*>&,
const QSet<IVP1ChannelWidget*>&,
const double&)));
279 qDebug() <<
"VP1ExecutionScheduler:: Do we run in 'batch' mode?" << batchMode;
307 #if defined BUILDVP1LIGHT
313 if (checkDisplayMouseClicks) {
325 connect(
auth,SIGNAL(authenticationSuccessful(QNetworkAccessManager*)),
326 availEvtsHttps,SLOT(
start(QNetworkAccessManager*)));
327 connect(availEvtsHttps,SIGNAL(freshEventsChanged()),
◆ ~VP1ExecutionScheduler()
VP1ExecutionScheduler::~VP1ExecutionScheduler |
( |
| ) |
|
|
virtual |
◆ actualUncreateAndDelete()
Definition at line 1112 of file VP1ExecutionScheduler.cxx.
1115 cw->setUpdatesEnabled(
false);
1119 for (itsys = cw->
systems().begin();itsys!=itsysE;++itsys) {
1120 (*itsys)->blockSignals(
true);
1121 disconnect(*itsys,0,0,0);
1123 cw->blockSignals(
true);
1124 disconnect(cw,0,0,0);
1127 for (itsys = cw->
systems().begin();itsys!=itsysE;++itsys) {
1134 for (itsys = cw->
systems().begin();itsys!=itsysE;++itsys) {
1136 (*itsys)->uncreate();
◆ bringFromConstructedToReady()
Definition at line 1071 of file VP1ExecutionScheduler.cxx.
1078 for (itsys = cw->
systems().begin();itsys!=itsysE;++itsys) {
1080 connect((*itsys),SIGNAL(sysmessage(
const QString&)),
m_d->
mainwindow,SLOT(systemAddToMessageBox(
const QString&)));
1083 for (itsys = cw->
systems().begin();itsys!=itsysE;++itsys) {
1084 (*itsys)->setCanRegisterController(
true);
1086 (*itsys)->setCanRegisterController(
false);
◆ channelCreated
Definition at line 767 of file VP1ExecutionScheduler.cxx.
769 std::set<IVP1System*>::const_iterator
it,
itE = cw->
systems().end();
771 qInfo() <<
"System name:" << (*it)->name();
776 #endif // BUILDVP1LIGHT
◆ channelUncreated
◆ cleanup()
Definition at line 506 of file VP1ExecutionScheduler.cxx.
508 #if defined BUILDVP1LIGHT
515 QMessageBox::information(0,
"End of job reached",Qt::convertFromPlainText(
"Job about to end.\n\nThis is most"
516 " likely since there are no more available events to process."),QMessageBox::Ok,QMessageBox::Ok);
521 qApp->processEvents();
533 const QString quickExitEnv(
"VP1_HARD_EXIT_AT_END");
535 #if defined BUILDVP1LIGHT
541 if (checkHardExitAtEnd) {
542 VP1Msg::message(
"Hard job exit (unset "+quickExitEnv+
" to disable this behaviour).");
◆ eraseSystem()
void VP1ExecutionScheduler::eraseSystem |
( |
IVP1System * |
s | ) |
|
|
private |
Definition at line 713 of file VP1ExecutionScheduler.cxx.
719 assert(!
s->isRefreshing());
721 QString
base = QString(
s->name())+
" from channel "+
s->channel()->unique_name();
725 s->disallowUpdateGUI();
728 m_d->
mainwindow->statusBar()->showMessage(
"Post-erase update to channel ["+
base+
"]" );
729 s->channel()->systemErased(
s);
◆ executeNewEvent()
bool VP1ExecutionScheduler::executeNewEvent |
( |
const int & |
runnumber, |
|
|
const unsigned long long & |
eventnumber, |
|
|
const unsigned & |
triggerType = 0 , |
|
|
const unsigned & |
time = 0 |
|
) |
| |
Definition at line 590 of file VP1ExecutionScheduler.cxx.
596 #if defined BUILDVP1LIGHT
598 if ( !firstlaunch ) {
599 if ( (getEvtNr() >= 0) && (getEvtNr() < m_totEvtNr) ) {
604 if((*itsys)->name()==
"Analysis"){
609 else if ( (getEvtNr() < 0) && (getEvtNr() >= m_totEvtNr) ) {
611 msgBox.setWindowTitle(
"No more events");
612 msgBox.setText(
"There are no more events in this file. Returning to previous event.");
613 msgBox.setIcon(QMessageBox::Icon::Information);
640 qApp->processEvents();
652 VP1Msg::messageDebug(
"User chose 'batch' and 'batch-random-config'. So we now replace the configuration with a random one from the input set...");
674 m_d->
mainwindow->groupBox_channelcontrols->setEnabled(
false);
693 qApp->processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers);
702 cw->goingToNextEvent();
705 qApp->processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers);
◆ hasAllActiveSystemsRefreshed()
bool VP1ExecutionScheduler::hasAllActiveSystemsRefreshed |
( |
IVP1ChannelWidget * |
cw | ) |
const |
Definition at line 1188 of file VP1ExecutionScheduler.cxx.
1192 std::set<IVP1System*>::const_iterator
it,
itE = cw->
systems().end();
1201 QString
name = QString((*it)->name());
1204 std::cout <<
i <<
" - name: " <<
name.toStdString() <<
" - active: " <<
active.toStdString() <<
" - refreshed: " << state.toStdString() << std::endl;
◆ init()
VP1ExecutionScheduler * VP1ExecutionScheduler::init |
( |
StoreGateSvc * |
eventStore, |
|
|
StoreGateSvc * |
detStore, |
|
|
ISvcLocator * |
svcLocator, |
|
|
IToolSvc * |
toolSvc, |
|
|
QStringList |
joboptions, |
|
|
QString |
initialCruiseMode = "NONE" , |
|
|
unsigned |
initialCruiseSeconds = 10 , |
|
|
QString |
singleEventSource = "" , |
|
|
QString |
singleEventLocalTmpDir = "" , |
|
|
unsigned |
localFileCacheLimit = 10 , |
|
|
QStringList |
availableLocalInputDirectories = QStringList() |
|
) |
| |
|
static |
Definition at line 350 of file VP1ExecutionScheduler.cxx.
369 if (alternative.isEmpty()) {
370 VP1Msg::message(
"ERROR: The DISPLAY environment variable is "+QString(unset?
"not set":
"empty")+
".");
371 VP1Msg::message(
"This might be because something else in Athena has disabled it.");
373 "the DISPLAY_ORIG environment variable to the contents of DISPLAY before launching your job.");
377 VP1Msg::message(
"For the current job, I will try with DISPLAY=\":0.0\", which is the correct value when running locally.");
380 VP1Msg::message(
"WARNING: The DISPLAY environment variable is "+QString(unset?
"not set":
"empty")+
". Setting to value found in DISPLAY_ORIG");
382 VP1Msg::message(
"WARNING: Setting DISPLAY variable to '"+alternative+
"'");
388 QCoreApplication::setOrganizationName(
"ATLAS");
389 #if defined BUILDVP1LIGHT
390 QCoreApplication::setApplicationName(
"VP1Light");
392 QCoreApplication::setApplicationName(
"VP1");
394 QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
400 VP1Msg::message(
"VP1ExecutionScheduler::init ERROR: QApplication already initialized. Expect problems!!!");
404 static char execpath[] =
"/some/fake/executable/vp1";
405 static char *
argv[2];
419 if (!singleEventSource.isEmpty()&&!singleEventLocalTmpDir.isEmpty()) {
420 const bool httpmode = singleEventSource.startsWith(
"http://");
421 const bool httpsmode = singleEventSource.startsWith(
"https://");
424 availEvents =
new VP1AvailEvtsHttp(singleEventSource, 60, 30*60, singleEventLocalTmpDir,localFileCacheLimit);
425 }
else if(httpsmode) {
426 availEvents =
new VP1AvailEvtsHttps(singleEventSource, 1000, 30*60, singleEventLocalTmpDir,localFileCacheLimit);
429 singleEventLocalTmpDir,localFileCacheLimit);
430 static_cast<VP1AvailEvtsLocalDir*
>(availEvents)->setAvailableSourceDirectories(availableLocalInputDirectories);
439 if (joboptions.empty()) {
442 qDebug() <<
"config files: " << joboptions;
443 for (QString
opt : joboptions)
448 if (joboptions.size() != 0 ) {
453 if (batchNevents > 0 ) {
460 if (scheduler->
m_d->
mainwindow->tabWidget_central->count()<=1) {
461 if (initialCruiseMode==
"TAB") {
462 VP1Msg::message(
"ERROR: Can not start in cruisemode TAB unless there are at least 2 tabs loaded from initial .vp1 files. Reverting to cruise mode NONE.");
463 initialCruiseMode=
"NONE";
464 }
else if (initialCruiseMode==
"BOTH") {
465 VP1Msg::message(
"ERROR: Can not start in cruisemode BOTH unless there are at least 2 tabs loaded from initial .vp1 files. Reverting to cruise mode EVENT.");
466 initialCruiseMode=
"EVENT";
471 if (initialCruiseMode==
"EVENT") {
473 scheduler->
m_d->
mainwindow->radioButton_cruise_event->setChecked(
true);
474 scheduler->
m_d->
mainwindow->pushButton_cruise->setChecked(
true);
476 }
else if (initialCruiseMode==
"TAB") {
478 scheduler->
m_d->
mainwindow->radioButton_cruise_tab->setChecked(
true);
479 scheduler->
m_d->
mainwindow->pushButton_cruise->setChecked(
true);
480 }
else if (initialCruiseMode==
"BOTH") {
482 scheduler->
m_d->
mainwindow->radioButton_cruise_both->setChecked(
true);
483 scheduler->
m_d->
mainwindow->pushButton_cruise->setChecked(
true);
485 if (initialCruiseMode!=
"NONE")
486 VP1Msg::message(
"ERROR: unknown initial cruise mode "+initialCruiseMode+
" (valid are NONE/EVENT/TAB/BOTH). Assuming NONE.");
488 scheduler->
m_d->
mainwindow->radioButton_cruise_event->setChecked(
true);
489 scheduler->
m_d->
mainwindow->pushButton_cruise->setChecked(
false);
494 int cruisesecs = ( initialCruiseSeconds == 0 ? 0 :
497 static_cast<int>(initialCruiseSeconds))));
499 scheduler->
m_d->
mainwindow->spinBox_cruise->setValue(cruisesecs);
◆ isRefreshing()
bool VP1ExecutionScheduler::isRefreshing |
( |
| ) |
const |
◆ nextRequestedEventFile()
QString VP1ExecutionScheduler::nextRequestedEventFile |
( |
| ) |
const |
◆ performCruise
void VP1ExecutionScheduler::performCruise |
( |
| ) |
|
|
privateslot |
Definition at line 1329 of file VP1ExecutionScheduler.cxx.
1344 assert(0&&
"should never happen");
1362 assert(0&&
"Not implemented");
1366 assert(0&&
"UNKNOWN CRUISE MODE");
◆ processSystemForRefresh
void VP1ExecutionScheduler::processSystemForRefresh |
( |
| ) |
|
|
privateslot |
◆ refreshingStatusChanged
void VP1ExecutionScheduler::refreshingStatusChanged |
( |
bool |
| ) |
|
|
signal |
◆ refreshSystem()
void VP1ExecutionScheduler::refreshSystem |
( |
IVP1System * |
s | ) |
|
|
private |
Definition at line 804 of file VP1ExecutionScheduler.cxx.
806 QString sysname =
s->name();
818 QString
base = QString(
s->name())+
" from channel "+
s->channel()->unique_name();
822 s->setRefreshing(
true);
824 s->channel()->emitRefreshInfoChanged();
827 s->setRefreshing(
false);
828 s->disallowUpdateGUI();
830 m_d->
mainwindow->statusBar()->showMessage(
"Post-refresh update to channel ["+
base+
"]" );
831 s->channel()->systemRefreshed(
s);
840 s->channel()->emitRefreshInfoChanged();
846 s->channel()->lastOfActiveSystemsRefreshed();
915 QApplication::quit();
926 QApplication::quit();
◆ saveSnaphsotToFile()
QString VP1ExecutionScheduler::saveSnaphsotToFile |
( |
IVP1System * |
s, |
|
|
bool |
batch = false |
|
) |
| |
Definition at line 944 of file VP1ExecutionScheduler.cxx.
946 QString chnlname =
s->name().toLower();
947 VP1Msg::messageDebug(
"VP1ExecutionScheduler::saveSnaphsotToFile() - taking the snapshot of the channel " + chnlname );
962 if ( ! (batchOutFolder ==
"") ) {
991 struct tm human_evtimestamp;
992 localtime_r(&t_evttimestamp, &human_evtimestamp);
994 std::ostringstream h_evtimestamp_ostri;
995 h_evtimestamp_ostri << 1900 + human_evtimestamp.tm_year
996 <<
"-" << 1 + human_evtimestamp.tm_mon
997 <<
"-" << human_evtimestamp.tm_mday
998 <<
"T" << human_evtimestamp.tm_hour <<
"-" << human_evtimestamp.tm_min <<
"-" << human_evtimestamp.tm_sec <<
"CEST";
1000 std::string h_evtimestamp_str = h_evtimestamp_ostri.str();
1001 QString h_evtimestamp = QString::fromStdString(h_evtimestamp_str);
1005 time_t t_timestamp =
time(0);
1007 localtime_r(&t_timestamp, <m);
1015 std::ostringstream ostri_unix;
1016 ostri_unix << t_timestamp;
1018 std::ostringstream ostri;
1019 ostri << 1900 + ltm.tm_year
1020 <<
"-" << 1 + ltm.tm_mon
1021 <<
"-" << ltm.tm_mday
1022 <<
"T" << ltm.tm_hour <<
"-" << ltm.tm_min <<
"-" << ltm.tm_sec <<
"CEST";
1024 std::string unixTimestamp = ostri_unix.str();
1025 std::string humanTimestamp = ostri.str();
1026 QString q_unixTimestamp = QString::fromStdString(unixTimestamp);
1027 QString q_humanTimestamp = QString::fromStdString(humanTimestamp);
1037 QString
filename =
folder +
"vp1_batch_snapshot_r" + runnumb +
"_ev" + evnumb +
"_evtime_H" + h_evtimestamp +
"_U" + evtimestamp +
"___imgtime_H" + q_humanTimestamp +
"_U" + q_unixTimestamp +
".png";
1040 QPixmap pm =
s->channel()->getSnapshot();
1050 QString latestImageFileName = currentsaveimagepath + QString(
"latest_vp1image");
1051 QFile latestImage(latestImageFileName);
1052 if(latestImage.exists() && !latestImage.remove())
1053 throw std::runtime_error(
"Unable to overwrite the existing latest image file");
1054 if(!latestImage.open(QIODevice::WriteOnly | QIODevice::Text))
1055 throw std::runtime_error(
"Unable to create new latest image file");
1056 latestImage.write(
filename.toStdString().c_str());
1057 latestImage.close();
◆ setCruiseMode()
◆ setNextRequestedEventFile()
void VP1ExecutionScheduler::setNextRequestedEventFile |
( |
const QString & |
f | ) |
|
◆ startRefreshQueueIfAppropriate
void VP1ExecutionScheduler::startRefreshQueueIfAppropriate |
( |
| ) |
|
|
privateslot |
◆ systemNeedErase
void VP1ExecutionScheduler::systemNeedErase |
( |
| ) |
|
|
privateslot |
◆ uncreateAndDelete()
◆ updateProgressBarDuringRefresh
void VP1ExecutionScheduler::updateProgressBarDuringRefresh |
( |
| ) |
|
|
privateslot |
◆ userRequestedFiles()
QStringList VP1ExecutionScheduler::userRequestedFiles |
( |
| ) |
|
◆ m_d
Imp* VP1ExecutionScheduler::m_d |
|
private |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
void refreshSystem(IVP1System *)
static void setEnvironmentVariable(const QString &name, const QString &content)
IVP1System * nextErasedActiveSystemByPriority()
QList< IVP1System * > getSystemsToEraseByPriority()
VP1MainWindow * mainwindow
static void warnIfWidgetsAlive()
bool batchModeRandomConfig
void actualUncreateAndDelete(IVP1ChannelWidget *)
StatusCode accept(const xAOD::Muon *mu)
void replaceConfigurationFile(QString file)
unsigned long long getEventNumber()
void refreshingStatusChanged(bool)
VP1AvailEvents * availEvents
QString saveSnaphsotToFile(IVP1System *s, bool batch=false)
static void messageWarningAllRed(const QString &str, IVP1System *sys=0)
QString fileinfoLocation()
void channelCreated(IVP1ChannelWidget *)
bool eraseJustAfterRefresh
static void setPointers(StoreGateSvc *eventStore, StoreGateSvc *detectorStore, ISvcLocator *, IToolSvc *)
VP1ExecutionScheduler * scheduler
void performPostRefreshCruiseActions(IVP1ChannelWidget *cw)
VP1TabManager * tabManager() const
static QString environmentVariableValue(const QString &name)
void updateProgressBarDuringRefresh()
void processSystemForRefresh()
bool allVisibleRefreshed() const
void loadConfigurationFromFile(QString file)
VP1BatchUtilities * batchUtilities
static QString defaultFileSelectDirectory()
void request_cruisemodechange()
static bool environmentVariableIsOn(const QString &name)
VP1Prioritiser * prioritiser
bool okToProceedToNextEvent() const
static void warnUndeletedInstances()
double endTiming_Refresh()
static bool environmentVariableIsSet(const QString &name)
IVP1System * currentsystemrefreshing
static bool expertSettingIsOn(const QString &type, const QString &name)
void channelUncreated(IVP1ChannelWidget *)
IVP1ChannelWidget * selectedChannelWidget() const
QList< IVP1ChannelWidget * > allChannels() const
VP1ChannelManager * channelManager() const
GlobalEventFilter * globalEventFilter
QString nextRequestedEvent
static StoreGateSvc * eventStore()
double currentrefreshsystemestimate
double beginTiming_Refresh(IVP1System *)
QProgressBar * progressbar
def init(v_theApp, v_rootStream=None)
IVP1ChannelWidget * postponedUncreateAndDeleteCW
void startRefreshQueueIfAppropriate()
bool hasAllActiveSystemsRefreshed(IVP1ChannelWidget *) const
static void messageDebug(const QString &)
std::vector< std::string > qstringlistToVecString(QStringList list)
double elapsedTiming_Refresh()
def time(flags, cells_name, *args, **kw)
static void message(const QString &, IVP1System *sys=0)
void setTabCruiseMode(const bool &)
bool allSoonVisibleRefreshed() const
void setRunEvtNumber(const int &runnumber, const unsigned long long &eventnumber, const unsigned &triggerType=0, const unsigned &time=0, const bool &printmessage=true)
void eraseSystem(IVP1System *)
VP1ExecutionScheduler(QObject *parent, StoreGateSvc *eventStore, StoreGateSvc *detStore, ISvcLocator *svcLocator, IToolSvc *toolSvc, VP1AvailEvents *availEvents)
QStringList userRequestedFiles()
static void messageWarningRed(const QString &str, IVP1System *sys=0)
static StoreGateSvc * detectorStore()
std::string getRandomConfigFile()
bool cruisetab_waitingtoproceed