From: zampolli Date: Thu, 3 Apr 2008 12:52:22 +0000 (+0000) Subject: Method for touching a file on the grid after processing a run in case of shuttle... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=503ff24f80aee44d52512cca02556325ad806587 Method for touching a file on the grid after processing a run in case of shuttle done --- diff --git a/SHUTTLE/AliShuttle.cxx b/SHUTTLE/AliShuttle.cxx index 16bc3c65d74..a40805b6565 100644 --- a/SHUTTLE/AliShuttle.cxx +++ b/SHUTTLE/AliShuttle.cxx @@ -57,6 +57,7 @@ #include #include #include +#include #include @@ -2584,15 +2585,21 @@ Bool_t AliShuttle::UpdateShuttleLogbook(const char* detector, const char* status if (detName == "shuttle_done") { - // Send the information to ML - TMonaLisaText mlStatus("SHUTTLE_status", "Done"); + if (TouchFile()==kTRUE){ + //Send the information to ML + TMonaLisaText mlStatus("SHUTTLE_status", "Done"); - TList mlList; - mlList.Add(&mlStatus); - - TString mlID; - mlID.Form("%d", GetCurrentRun()); - fMonaLisa->SendParameters(&mlList, mlID); + TList mlList; + mlList.Add(&mlStatus); + + TString mlID; + mlID.Form("%d", GetCurrentRun()); + fMonaLisa->SendParameters(&mlList, mlID); + } + else{ + return kFALSE; + } + } } else { TString statusStr(status); @@ -3211,3 +3218,49 @@ void AliShuttle::SetShuttleLogDir(const char* logDir) fgkShuttleLogDir = gSystem->ExpandPathName(logDir); } +//______________________________________________________________________________________________ +Bool_t AliShuttle::TouchFile() +{ + // + // touching a file on the grid if run has been DONE + // + + if (!gGrid) + { + Log("SHUTTLE",Form("No TGrid connection estabilished!")); + Log("SHUTTLE",Form("Could not touch file for run %i",GetCurrentRun())); + return kFALSE; + } + + TString command; + command.Form("touch /alice/data/%d/%s/SHUTTLE_DONE/shuttle_done_%i", GetCurrentYear(), GetLHCPeriod(),GetCurrentRun()); + TGridResult *resultTouch = dynamic_cast(gGrid->Command(command)); + if (resultTouch){ + TMap *mapTouch = dynamic_cast(resultTouch->At(0)); + if (mapTouch){ + TObjString *valueTouch = dynamic_cast(mapTouch->GetValue("__result__")); + if (valueTouch){ + if (valueTouch->GetString()=="1"){ + return kTRUE; + } + else { + Log("SHUTTLE",Form("No value for __result__ key set in the map for touching command")); + } + } + else { + Log("SHUTTLE",Form("No value set in the map for touching command")); + } + } + else { + Log("SHUTTLE",Form("No map for touching command")); + } + } + + else { + Log("SHUTTLE",Form("No result for touching command")); + } + Log("SHUTTLE",Form("Could not touch file for run %i",GetCurrentRun())); + return kFALSE; +} + + diff --git a/SHUTTLE/AliShuttle.h b/SHUTTLE/AliShuttle.h index 583d1358030..643168e4c6b 100644 --- a/SHUTTLE/AliShuttle.h +++ b/SHUTTLE/AliShuttle.h @@ -130,6 +130,7 @@ private: void SendAlive(); void SendMLInfo(); + virtual Bool_t TouchFile(); const AliShuttleConfig* fConfig; // pointer to configuration object