]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes from Martin: prepare new options field for handling big output in PROOF....
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Nov 2012 08:57:58 +0000 (08:57 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Nov 2012 08:57:58 +0000 (08:57 +0000)
ANALYSIS/AliAnalysisAlien.cxx
ANALYSIS/AliAnalysisAlien.h
ANALYSIS/AliAnalysisGrid.h
ANALYSIS/AliAnalysisManager.cxx

index e5a3323a28f1edd8908af46a1c5fb7f836373d3e..70056ef16d74721f4759fa9a6663a986d2bb38bc 100644 (file)
@@ -133,11 +133,13 @@ AliAnalysisAlien::AliAnalysisAlien()
                   fFileForTestMode(),
                   fRootVersionForProof(),
                   fAliRootMode(),
+                  fProofProcessOpt(),
                   fMergeDirName(),
                   fInputFiles(0),
                   fPackages(0),
                   fModules(0),
-                  fProofParam()
+                  fProofParam(),
+                  fDropToShell(true)
 {
 // Dummy ctor.
    SetDefaults();
@@ -206,11 +208,13 @@ AliAnalysisAlien::AliAnalysisAlien(const char *name)
                   fFileForTestMode(),
                   fRootVersionForProof(),
                   fAliRootMode(),
+                  fProofProcessOpt(),
                   fMergeDirName(),
                   fInputFiles(0),
                   fPackages(0),
                   fModules(0),
-                  fProofParam()
+                  fProofParam(),
+                  fDropToShell(true)
 {
 // Default ctor.
    SetDefaults();
@@ -279,11 +283,13 @@ AliAnalysisAlien::AliAnalysisAlien(const AliAnalysisAlien& other)
                   fFileForTestMode(other.fFileForTestMode),
                   fRootVersionForProof(other.fRootVersionForProof),
                   fAliRootMode(other.fAliRootMode),
+                  fProofProcessOpt(other.fProofProcessOpt),
                   fMergeDirName(other.fMergeDirName),
                   fInputFiles(0),
                   fPackages(0),
                   fModules(0),
-                  fProofParam()
+                  fProofParam(),
+                  fDropToShell(other.fDropToShell)
 {
 // Copy ctor.
    fGridJDL = (TGridJDL*)gROOT->ProcessLine("new TAlienJDL()");
@@ -394,7 +400,9 @@ AliAnalysisAlien &AliAnalysisAlien::operator=(const AliAnalysisAlien& other)
       fFileForTestMode         = other.fFileForTestMode;
       fRootVersionForProof     = other.fRootVersionForProof;
       fAliRootMode             = other.fAliRootMode;
+      fProofProcessOpt         = other.fProofProcessOpt;
       fMergeDirName            = other.fMergeDirName;
+      fDropToShell             = other.fDropToShell;
       if (other.fInputFiles) {
          fInputFiles = new TObjArray();
          TIter next(other.fInputFiles);
@@ -3450,10 +3458,16 @@ Bool_t AliAnalysisAlien::StartAnalysis(Long64_t /*nentries*/, Long64_t /*firstEn
       if (!Submit()) return kFALSE;
    }   
          
-   Info("StartAnalysis", "\n#### STARTING AN ALIEN SHELL FOR YOU. EXIT WHEN YOUR JOB %s HAS FINISHED. #### \
-   \n You may exit at any time and terminate the job later using the option <terminate> \
-   \n ##################################################################################", jobID.Data());
-   gSystem->Exec("aliensh");
+   if (fDropToShell) {
+      Info("StartAnalysis", "\n#### STARTING AN ALIEN SHELL FOR YOU. EXIT WHEN YOUR JOB %s HAS FINISHED. #### \
+      \n You may exit at any time and terminate the job later using the option <terminate> \
+      \n ##################################################################################", jobID.Data());
+      gSystem->Exec("aliensh");
+   } else {
+      Info("StartAnalysis", "\n#### SUBMITTED JOB %s TO ALIEN QUEUE #### \
+      \n Remember to terminate the job later using the option <terminate> \
+      \n ##################################################################################", jobID.Data());
+   }   
    return kTRUE;
 }
 
@@ -3621,12 +3635,20 @@ Bool_t AliAnalysisAlien::SubmitMerging()
       if (!fRunNumbers.Length() && !fRunRange[0]) break;
    }
    if (!ntosubmit) return kTRUE;
-   Info("StartAnalysis", "\n #### STARTING AN ALIEN SHELL FOR YOU. You can exit any time or inspect your jobs in a different shell.##########\
-                          \n Make sure your jobs are in a final state (you can resubmit failed ones via 'masterjob <id> resubmit ERROR_ALL')\
-                          \n Rerun in 'terminate' mode to submit all merging stages, each AFTER the previous one completed. The final merged \
-                          \n output will be written to your alien output directory, while separate stages in <Stage_n>. \
-                          \n ################################################################################################################");
-   gSystem->Exec("aliensh");
+   if (fDropToShell) {
+      Info("StartAnalysis", "\n #### STARTING AN ALIEN SHELL FOR YOU. You can exit any time or inspect your jobs in a different shell.##########\
+                             \n Make sure your jobs are in a final state (you can resubmit failed ones via 'masterjob <id> resubmit ERROR_ALL')\
+                             \n Rerun in 'terminate' mode to submit all merging stages, each AFTER the previous one completed. The final merged \
+                             \n output will be written to your alien output directory, while separate stages in <Stage_n>. \
+                             \n ################################################################################################################");
+      gSystem->Exec("aliensh");
+   } else {
+      Info("StartAnalysis", "\n #### STARTED MERGING JOBS FOR YOU #### \
+                             \n Make sure your jobs are in a final state (you can resubmit failed ones via 'masterjob <id> resubmit ERROR_ALL') \
+                             \n Rerun in 'terminate' mode to submit all merging stages, each AFTER the previous one completed. The final merged \
+                             \n output will be written to your alien output directory, while separate stages in <Stage_n>. \
+                             \n ################################################################################################################");   
+   }   
    return kTRUE;
 }
 
index dabba50daef833412194e8e4b9142ca5e5fa7f5c..9152175d239cc3bdcce57c421ab1eb2322d23f39 100644 (file)
@@ -95,6 +95,7 @@ public:
    virtual void        SetOutputSingleFolder(const char *folder)         {fOutputSingle = folder; fSplitMode="file"; fSplitMaxInputFileNumber=1;}
    virtual void        SetFastReadOption(Bool_t on=kTRUE)                {fFastReadOption = on ? 1 : 0;}
    virtual void        SetOverwriteMode(Bool_t on=kTRUE)                 {fOverwriteMode = on ? 1 : 0;}
+   virtual void        SetDropToShell(Bool_t drop=true)                  {fDropToShell = drop;}
 
    TGridJDL           *GetGridJDL() const {return fGridJDL;}
    TGridJDL           *GetMergingJDL() const {return fMergingJDL;}
@@ -147,6 +148,8 @@ public:
    virtual void        SetNproofWorkersPerSlave(Int_t nworkers)          {fNproofWorkersPerSlave = nworkers;}
    virtual void        SetRootVersionForProof(const char *version)       {fRootVersionForProof = version;}
    virtual void        SetAliRootMode(const char *mode)                  {fAliRootMode = mode;}
+   virtual void        SetProofProcessOpt(const char *proofOpt="")       {fProofProcessOpt = proofOpt;}
+   virtual TString     GetProofProcessOpt()                              {return fProofProcessOpt;}
    // .txt file containing the list of files to be chained in test mode
    virtual void        SetFileForTestMode(const char *filename)          {fFileForTestMode = filename;}
    virtual TChain     *GetChainForTestMode(const char *treeName) const;
@@ -228,12 +231,14 @@ private:
    TString          fFileForTestMode; // .txt file for the chain to be used in PROOF test mode
    TString          fRootVersionForProof; // ROOT version to be used in PROOF mode. The default one taken if empty.
    TString          fAliRootMode;     // AliRoot mode among the list supported by the proof cluster
+   TString          fProofProcessOpt; // Option passed to proof process
    TString          fMergeDirName;    // Name of the directory that should be added to the output directory
    TObjArray       *fInputFiles;      // List of input files to be processed by the job
    TObjArray       *fPackages;        // List of packages to be used
    TObjArray       *fModules;         // List of AliAnalysisTaskCfg modules
    TMap             fProofParam;      // Key-value pairs for proof mode
+   Bool_t           fDropToShell;     // If true, execute aliensh on start
    
-   ClassDef(AliAnalysisAlien, 20)   // Class providing some AliEn utilities
+   ClassDef(AliAnalysisAlien, 21)   // Class providing some AliEn utilities
 };
 #endif
index 3e2ff0db32f74d410d5b31a49081018cd7969854..62105a273fa27fc6d28dd862cb9e92ac439d4c8a 100644 (file)
@@ -139,6 +139,8 @@ enum EPluginBits {
    virtual void        SetNproofWorkersPerSlave(Int_t nworkers)          = 0;
    virtual void        SetRootVersionForProof(const char *version)       = 0;
    virtual void        SetAliRootMode(const char *mode)                  = 0;
+   virtual void        SetProofProcessOpt(const char *proofOpt="")       = 0;
+   virtual TString     GetProofProcessOpt()                              = 0;
    // .txt file containing the list of files to be chained in test mode
    virtual void        SetFileForTestMode(const char *filename)          = 0;
    virtual TChain     *GetChainForTestMode(const char *treeName) const   = 0;
index f0e09650fbdcb46b7aedc4ad25c0a6249047295e..4269e4555af1934dd5c97d7321e41ef5e83772f2 100644 (file)
@@ -1947,6 +1947,7 @@ Long64_t AliAnalysisManager::StartAnalysis(const char *type, const char *dataset
    }   
    fMode = kProofAnalysis;
    TString line;
+   TString proofProcessOpt;
    SetEventLoop(kTRUE);
    // Set the dataset flag
    TObject::SetBit(kUseDataSet);
@@ -1963,6 +1964,8 @@ Long64_t AliAnalysisManager::StartAnalysis(const char *type, const char *dataset
       } else {
          dataset = fGridHandler->GetProofDataSet();
       }
+
+      proofProcessOpt = fGridHandler->GetProofProcessOpt();
    }   
 
    if (!gROOT->GetListOfProofs() || !gROOT->GetListOfProofs()->GetEntries()) {
@@ -1976,8 +1979,8 @@ Long64_t AliAnalysisManager::StartAnalysis(const char *type, const char *dataset
    line = Form("gProof->AddInput((TObject*)%p);", this);
    gROOT->ProcessLine(line);
    Long_t retv;
-   line = Form("gProof->Process(\"%s\", \"AliAnalysisSelector\", \"\", %lld, %lld);",
-               dataset, nentries, firstentry);
+   line = Form("gProof->Process(\"%s\", \"AliAnalysisSelector\", \"%s\", %lld, %lld);",
+               dataset,proofProcessOpt.Data(), nentries, firstentry);
    cout << "===== RUNNING PROOF ANALYSIS " << GetName() << " ON DATASET " << dataset << endl;
    retv = (Long_t)gROOT->ProcessLine(line);
    return retv;