From: jniedzie Date: Fri, 15 Aug 2014 08:34:02 +0000 (+0200) Subject: Checking Storage Manager state added to ED. Now GUI reacts depending on status of SM. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=0790c3e6c2ff934efeea35f3b8b02ee0dc3d33bb Checking Storage Manager state added to ED. Now GUI reacts depending on status of SM. --- diff --git a/EVE/EveBase/AliEveConfigManager.cxx b/EVE/EveBase/AliEveConfigManager.cxx index 75ab46ddfab..5058a3f1d66 100644 --- a/EVE/EveBase/AliEveConfigManager.cxx +++ b/EVE/EveBase/AliEveConfigManager.cxx @@ -244,6 +244,13 @@ const char *gPictureSaveAsTypes[] = {"PNG Image", "*.png", } +void AliEveConfigManager::ConnectEventManagerSignals() +{ + AliEveEventManager *manager = AliEveEventManager::GetCurrent(); + manager->Connect("StorageManagerOk()","AliEveConfigManager",this,"StorageManagerChangedState(=1)"); + manager->Connect("StorageManagerDown()","AliEveConfigManager",this,"StorageManagerChangedState(=0)"); +} + void AliEveConfigManager::AliEvePopupHandler(Int_t id) { // Handle user selections from AliEve popup. @@ -1035,33 +1042,31 @@ void AliEveConfigManager::AliEvePopupHandler(Int_t id) } */ - case kStorageListEvents: - { + case kStorageListEvents: + { #ifdef ZMQ - fListEventsWindow = - AliStorageAdministratorPanelListEvents::GetInstance(); - - fListEventsWindow->Connect("SelectedEvent()","AliEveConfigManager",this,"SetEventInEventManager()"); -#endif - - break; - - } - case kStorageMarkEvent: - { + fListEventsWindow = + AliStorageAdministratorPanelListEvents::GetInstance(); + + fListEventsWindow->Connect("SelectedEvent()","AliEveConfigManager",this,"SetEventInEventManager()"); +#endif + break; + + } + case kStorageMarkEvent: + { #ifdef ZMQ - AliStorageAdministratorPanelMarkEvent *markEventWindow = - AliStorageAdministratorPanelMarkEvent::GetInstance(); + AliStorageAdministratorPanelMarkEvent *markEventWindow = + AliStorageAdministratorPanelMarkEvent::GetInstance(); #endif - break; - - } - - default: - { - Warning(kEH, "Unknown menu entry."); - break; - } + break; + } + + default: + { + Warning(kEH, "Unknown menu entry."); + break; + } } } @@ -1077,7 +1082,20 @@ void AliEveConfigManager::SetEventInEventManager() manager->SetAutoLoad(kFALSE); manager->PrepareForNewEvent(event); } - +} + +void AliEveConfigManager::StorageManagerChangedState(int state) +{ + if (state == 0)// storage manager is down + { + fStoragePopup->DisableEntry(kStorageListEvents); + fStoragePopup->DisableEntry(kStorageMarkEvent); + } + else if(state == 1)// storage manager is alive + { + fStoragePopup->EnableEntry(kStorageListEvents); + fStoragePopup->EnableEntry(kStorageMarkEvent); + } } diff --git a/EVE/EveBase/AliEveConfigManager.h b/EVE/EveBase/AliEveConfigManager.h index 664c278ceec..fbbceb8da08 100644 --- a/EVE/EveBase/AliEveConfigManager.h +++ b/EVE/EveBase/AliEveConfigManager.h @@ -29,6 +29,9 @@ public: void AliEvePopupHandler(Int_t id); void SetEventInEventManager(); + void StorageManagerChangedState(int state); + + void ConnectEventManagerSignals(); protected: static AliEveConfigManager* fgMaster; // Main instance. diff --git a/EVE/EveBase/AliEveEventManager.cxx b/EVE/EveBase/AliEveEventManager.cxx index 3c86ce8d30b..6c9c6fa54e3 100644 --- a/EVE/EveBase/AliEveEventManager.cxx +++ b/EVE/EveBase/AliEveEventManager.cxx @@ -10,6 +10,8 @@ #include "AliEveEventManager.h" #include "AliEveEventSelector.h" #include "AliEveMacroExecutor.h" +#include "AliEveConfigManager.h" +#include "AliEveVSDCreator.h" #include #include @@ -119,87 +121,6 @@ Bool_t AliEveEventManager::fgUniformField = kFALSE; AliEveEventManager* AliEveEventManager::fgMaster = 0; AliEveEventManager* AliEveEventManager::fgCurrent = 0; -void AliEveEventManager::GetNextEvent() -{ -#ifdef ZMQ - AliStorageEventManager *eventManager = - AliStorageEventManager::GetEventManagerInstance(); - eventManager->CreateSocket(EVENTS_SERVER_SUB); - - fCurrentEvent[0]=0; - fCurrentEvent[1]=0; - fCurrentTree[0]=0; - fCurrentTree[1]=0; - AliESDEvent *tmpEvent = NULL; - TTree *tmpTree = NULL; - - while(1) - { - //if(tmpEvent){delete tmpEvent;tmpEvent=0;} - tmpEvent = eventManager->GetEvent(EVENTS_SERVER_SUB,-1,&tmpTree); - - if(tmpEvent) - { - if(tmpEvent->GetRunNumber()>=0) - { - fMutex.Lock(); - if(fEventInUse == 0){fWritingToEventIndex = 1;} - else if(fEventInUse == 1){fWritingToEventIndex = 0;} - cout<<"Writing to:"<Connect("Timeout()", "AliEveEventManager", this, "AutoLoadNextEvent()"); - fAutoLoadTimer->Connect("Timeout()", "AliEveEventManager", this, "Timeout()"); - - fExecutor = new AliEveMacroExecutor; - - fTransients = new TEveElementList("Transients", "Transient per-event elements."); - fTransients->IncDenyDestroy(); - gEve->AddToListTree(fTransients, kFALSE); - - fTransientLists = new TEveElementList("Transient Lists", "Containers of transient elements."); - fTransientLists->IncDenyDestroy(); - gEve->AddToListTree(fTransientLists, kFALSE); - - fPEventSelector = new AliEveEventSelector(this); - - fGlobal = new TMap; fGlobal->SetOwnerKeyValue(); -} - AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) : TEveEventManager(name, ""), fEventId(-1), @@ -232,8 +153,11 @@ AliEveEventManager::AliEveEventManager(const TString& name, Int_t ev) : #ifdef ZMQ cout<<"ZMQ FOUND. Starting subscriber thread."<Run(); + fEventListenerThread = new TThread("fEventListenerThread",DispatchEventListener,(void*)this); + fEventListenerThread->Run(); + + fStorageManagerWatcherThread = new TThread("fStorageManagerWatcherThread",DispatchStorageManagerWatcher,(void*)this); + fStorageManagerWatcherThread->Run(); #else cout<<"NO ZMQ FOUND. Online events not avaliable."<CreateSocket(EVENTS_SERVER_SUB); + + fCurrentEvent[0]=0; + fCurrentEvent[1]=0; + fCurrentTree[0]=0; + fCurrentTree[1]=0; + AliESDEvent *tmpEvent = NULL; + TTree *tmpTree = NULL; + + while(1) + { + //if(tmpEvent){delete tmpEvent;tmpEvent=0;} + tmpEvent = eventManager->GetEvent(EVENTS_SERVER_SUB,-1,&tmpTree); + + if(tmpEvent) + { + if(tmpEvent->GetRunNumber()>=0) + { + fMutex.Lock(); + if(fEventInUse == 0){fWritingToEventIndex = 1;} + else if(fEventInUse == 1){fWritingToEventIndex = 0;} + cout<<"Writing to:"<ConnectEventManagerSignals(); + + AliStorageEventManager *eventManager = AliStorageEventManager::GetEventManagerInstance(); + eventManager->CreateSocket(CLIENT_COMMUNICATION_REQ); + + struct clientRequestStruct *request = new struct clientRequestStruct; + request->messageType = REQUEST_CONNECTION; + + while (1) + { + if(eventManager->Send(request,CLIENT_COMMUNICATION_REQ,5000)) + { + StorageManagerOk(); + cout<<"WARNING -- Storage Manager is OK."<GetLong(CLIENT_COMMUNICATION_REQ); + cout<<"RESPONSE:"<Connect("Timeout()", "AliEveEventManager", this, "AutoLoadNextEvent()"); + fAutoLoadTimer->Connect("Timeout()", "AliEveEventManager", this, "Timeout()"); + + fExecutor = new AliEveMacroExecutor; + + fTransients = new TEveElementList("Transients", "Transient per-event elements."); + fTransients->IncDenyDestroy(); + gEve->AddToListTree(fTransients, kFALSE); + + fTransientLists = new TEveElementList("Transient Lists", "Containers of transient elements."); + fTransientLists->IncDenyDestroy(); + gEve->AddToListTree(fTransientLists, kFALSE); + + fPEventSelector = new AliEveEventSelector(this); + + fGlobal = new TMap; fGlobal->SetOwnerKeyValue(); +} + /******************************************************************************/ void AliEveEventManager::SetESDFileName(const TString& esd, EVisibleESDTrees shown) @@ -498,11 +534,15 @@ void AliEveEventManager::Open() } // Open RunLoader from galice.root +// fgGAliceFileName = "/Users/Jerus/galice.root"; // temp + TFile *gafile = TFile::Open(fgGAliceFileName); + cout<<"Opening galice"<Close(); delete gafile; + cout<<"SETTING RUN LOADER in Open()"<ProcessEvents(); - - //if(fGetEventThread){delete fGetEventThread;fGetEventThread=0;} + + /* + cout<<"VSD"<CreateVSD("myVSD.root"); + cout<<"PO"<(arg)->GetNextEvent();} + static void* DispatchEventListener(void *arg){static_cast(arg)->GetNextEvent();} + static void* DispatchStorageManagerWatcher(void *arg){static_cast(arg)->CheckStorageStatus();} void GetNextEvent(); - TThread *fGetEventThread; + void CheckStorageStatus(); + TThread *fEventListenerThread; + TThread *fStorageManagerWatcherThread; TMutex fMutex; AliESDEvent *fCurrentEvent[2]; TTree *fCurrentTree[2]; diff --git a/EVE/EveBase/AliEveEventManagerEditor.cxx b/EVE/EveBase/AliEveEventManagerEditor.cxx index f7ccefb9420..36c752a2fc1 100644 --- a/EVE/EveBase/AliEveEventManagerEditor.cxx +++ b/EVE/EveBase/AliEveEventManagerEditor.cxx @@ -177,12 +177,17 @@ AliEveEventManagerWindow::AliEveEventManagerWindow(AliEveEventManager* mgr) : fTrigSel->Select(-1,kFALSE); f->AddFrame(fTrigSel, new TGLayoutHints(kLHintsNormal, 10, 5, 0, 0)); fTrigSel->Connect("Selected(char*)", cls, this, "DoSetTrigSel()"); - } + fStorageStatus = MkLabel(f,"Storage: Waiting",0,8,8); + + } + fEventInfo = new TGTextView(this, 400, 600); AddFrame(fEventInfo, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY)); fM->Connect("NewEventLoaded()", cls, this, "Update()"); + fM->Connect("StorageManagerOk()",cls,this,"StorageManagerChangedState(=1)"); + fM->Connect("StorageManagerDown()",cls,this,"StorageManagerChangedState(=0)"); SetCleanup(kDeepCleanup); Layout(); @@ -320,6 +325,20 @@ void AliEveEventManagerWindow::Update() Layout(); } +void AliEveEventManagerWindow::StorageManagerChangedState(int state) +{ + if (state == 0) + { + fStorageStatus->SetText("Storage: DOWN"); + fMarkEvent->SetEnabled(false); + } + else if(state == 1) + { + fStorageStatus->SetText("Storage: OK"); + fMarkEvent->SetEnabled(true); + } +} + //------------------------------------------------------------------------------ // Protected methods //------------------------------------------------------------------------------ diff --git a/EVE/EveBase/AliEveEventManagerEditor.h b/EVE/EveBase/AliEveEventManagerEditor.h index b54f587aa1c..f15147954b3 100644 --- a/EVE/EveBase/AliEveEventManagerEditor.h +++ b/EVE/EveBase/AliEveEventManagerEditor.h @@ -83,6 +83,8 @@ public: void DoSetTrigSel(); void Update(); + + void StorageManagerChangedState(int state); protected: AliEveEventManager *fM; // Model object. @@ -101,6 +103,7 @@ protected: TEveGValuator *fAutoLoadTime; // Time for automatic loading of events TGComboBox *fTrigSel; // Trigger selection combo box + TGLabel *fStorageStatus; // Display status of Storage Manager TGTextView *fEventInfo; // Text box with event info diff --git a/MONITOR/alieventserver/AliEventServerUtil.h b/MONITOR/alieventserver/AliEventServerUtil.h index b9cc9a042d2..ae71ff78c46 100644 --- a/MONITOR/alieventserver/AliEventServerUtil.h +++ b/MONITOR/alieventserver/AliEventServerUtil.h @@ -7,11 +7,11 @@ //______________DEFAULT SETTINGS________________ #define DEFAULT_SERVER_HOST "tcp://*" #define DEFAULT_SERVER_PORT 5024 -#define DEFAULT_SERVER_SAVE_RECO_DIR "/opt/reco" -#define DEFAULT_CDB_STORAGE "local:///opt/OCDB/2013" -#define DEFAULT_CDB_SPEC_STORAGE_PATH1 "opt/reco/GRP/GRP/Data" +#define DEFAULT_SERVER_SAVE_RECO_DIR "/local/reco" +#define DEFAULT_CDB_STORAGE "local:///local/OCDB/2013" +#define DEFAULT_CDB_SPEC_STORAGE_PATH1 "/local/reco/GRP/GRP/Data" #define DEFAULT_CDB_SPEC_STORAGE_VALUE1 "" -#define DEFAULT_CDB_SPEC_STORAGE_PATH2 "opt/reco/GRP/CTP/Config" +#define DEFAULT_CDB_SPEC_STORAGE_PATH2 "/local/reco/GRP/CTP/Config" #define DEFAULT_CDB_SPEC_STORAGE_VALUE2 "" #define DEFAULT_CDB_SPEC_STORAGE_PATH3 "" #define DEFAULT_CDB_SPEC_STORAGE_VALUE3 "" diff --git a/MONITOR/alieventserver/alieventserver.rootrc b/MONITOR/alieventserver/alieventserver.rootrc index 0744efeeef6..1c7dca48b04 100644 --- a/MONITOR/alieventserver/alieventserver.rootrc +++ b/MONITOR/alieventserver/alieventserver.rootrc @@ -1,10 +1,10 @@ server.host: tcp://* server.port: 5024 -server.saveRecoDir: /opt/reco -cdb.defaultStorage: local:///opt/OCDB/2013 -cdb.specificStoragePath1: local:///opt/reco/GRP/GRP/Data +server.saveRecoDir: /local/reco +cdb.defaultStorage: local:///local/OCDB/2013 +cdb.specificStoragePath1: local:///local/reco/GRP/GRP/Data cdb.specificStorageValue1: -cdb.specificStoragePath2: local:///opt/reco/GRP/CTP/Config +cdb.specificStoragePath2: local:///local/reco/GRP/CTP/Config cdb.specificStorageValue2: cdb.specificStoragePath3: cdb.specificStorageValue3: diff --git a/MONITOR/alistoragemanager/alifakedisplay.cxx b/MONITOR/alistoragemanager/alifakedisplay.cxx index 7d556df2a30..d9f023b7ec1 100644 --- a/MONITOR/alistoragemanager/alifakedisplay.cxx +++ b/MONITOR/alistoragemanager/alifakedisplay.cxx @@ -20,7 +20,7 @@ using namespace std; // global variables: AliESDEvent *currentEvent[2]; TTree *currentTree[2]; -TMutex mutex; +TMutex myMutex; int eventInUse=1; int writingToEventIndex=0; bool isNewEventAvaliable=false; @@ -107,7 +107,7 @@ int main(int argc, char **argv) if(isNewEventAvaliable) { cout<<"new event"<GetRunNumber()>=0) { - mutex.Lock(); + myMutex.Lock(); if(eventInUse == 0){writingToEventIndex = 1;} else if(eventInUse == 1){writingToEventIndex = 0;} cout<<"Writing to:"<