Run_Simple_Test.C

Go to the documentation of this file.
00001 // $Id: Run_Simple_Test.C,v 1.5 2005/02/12 02:14:54 rdm Exp $
00002 //
00003 //
00004 
00005 // Preparation:
00006 // - configure authentication
00007 // - configure $ROOTSYS/proof/etc/proof.conf (use full domain name)
00008 // - optional: change the data directory below (needs 350 Mb)
00009 // - start xrootd with proof
00010 
00011 #include "TSystem.h"
00012 #include "TEnv.h"
00013 #include "TProof.h"
00014 #include "TDSet.h"
00015 #include "TDrawFeedback.h"
00016 #include "TList.h"
00017 
00018 #include "make_event_trees.C"
00019 #include "make_tdset.C"
00020 
00021 const bool show_feedback = true;
00022 const bool show_stats = true;
00023 const int  files_per_node = 10;
00024 const int  max_files_per_slave = 1;
00025 
00026 void Run_Simple_Test(char *host, const char *data_dir = "/var/tmp", Int_t dbg = 0)
00027 {
00028 
00029    if (gSystem->AccessPathName("../libEvent.so")) {
00030       gSystem->Exec("cd $ROOTSYS/test; make libEvent.so");
00031       gSystem->Exec("./make_event_par.sh");
00032       gSystem->Exec("ln -s ../Event.h");
00033       gSystem->Load("../libEvent.so");
00034    }
00035 
00036    TProof *p = 0;
00037    if (dbg > 0) {
00038       p = TProof::Open(host, "", "", dbg);
00039    } else {
00040       p = TProof::Open(host);
00041    }
00042    if (!p || !p->IsValid()) {
00043       cout << "Could not start the PROOF session - exit "<<endl;
00044       return;
00045    }
00046    if (dbg > 0) p->SetLogLevel(dbg);
00047 
00048    p->UploadPackage("event");
00049    p->EnablePackage("event");
00050 
00051    make_event_trees(data_dir, 100000, files_per_node);
00052 
00053    TDSet *d = make_tdset(data_dir, files_per_node);
00054 
00055    d->Print("a");
00056 
00057    if (show_stats) gEnv->SetValue("Proof.StatsHist", 1);
00058 
00059    TDrawFeedback *fb(0);
00060    if (show_feedback) {
00061       if (show_stats) {
00062          p->AddFeedback("PROOF_ProcTimeHist");
00063          p->AddFeedback("PROOF_LatencyHist");
00064          p->AddFeedback("PROOF_EventsHist");
00065       }
00066 
00067       p->AddFeedback("pt_dist");
00068 
00069       fb = new TDrawFeedback(p);
00070    }
00071 
00072    // We load the selector before execution to avoid a problem affecting some versions
00073    // (in particular 5.22/00 and 5.22/00a); with problem-free versions this is equivalent
00074    // to direct processing via d->Process("EventTree_Proc.C+","")
00075    p->Load("EventTree_Proc.C+");
00076    d->Process("EventTree_Proc");
00077 
00078    if (fb) delete fb;
00079 }

Generated on Tue Jul 5 15:15:07 2011 for ROOT_528-00b_version by  doxygen 1.5.1