Skip to content

Latest commit

 

History

History
86 lines (58 loc) · 3.63 KB

File metadata and controls

86 lines (58 loc) · 3.63 KB

Step 6

Is your pion analysis running smoothly on your laptop? If yes, then it is time to 'scale things up' a bit. We will run your task on the GRID.

The macro

runAnalysis.C

that you used in the previous exercises already contains all the information that you need for running on the GRID. In fact, all that you have to do is open it, and make a minor change at the start of the macro

void runAnalysis()
{
    // set if you want to run the analysis locally (kTRUE), or on grid (kFALSE)
    Bool_t local = kFALSE;
    // if you run on grid, specify test mode (kTRUE) or full grid model (kFALSE)
    Bool_t gridTest = kTRUE;
    

Note that we will first test if our code is actually 'grid compatible', by simulating a GRID node on our computer. Before you launch this test, browse through the runAnalysis.C macro and try to convince yourself of the fact that you understand the logic, and whether or not the configuration makes sense.

Running a GRID test

If you think everything is OK, initialize a token

alien-token-init <username>

and run the GRID test by simply launching the runAnalysis macro

aliroot runAnalysis.C

You will notice that the running time for the task is now probably a bit longer, as we have to wait for data to be retrieved. Does your analysis run fine? If it exits without problems, make sure to check your histograms and see if the output is as you expected it to be !

Launching your job on GRID

If the GRID test was successful, you can launch your analysis on GRID. Set the flag ’gridTest’ in your macro to kFALSE,

void runAnalysis()
{
    // set if you want to run the analysis locally (kTRUE), or on grid (kFALSE)
    Bool_t local = kFALSE;
    // if you run on grid, specify test mode (kTRUE) or full grid model (kFALSE)
    Bool_t gridTest = kFALSE;

and relaunch your analysis.

Monitoring your jobs

Once you have submitted your job to GRID, you can track the progress at https://alimonitor.cern.ch/users/jobs.jsp.

Merging your job's output

Once your jobs are all in done, it is time to merge the output files that were generated on the independent GRID nodes into one output file that is on your laptop. We will do this in two stages

  1. Merge all the output files that were generated by one masterjob into one output file that is still stored on the GRID
  2. Merge these 'master' output files into one output file on your laptop.

Note that, since we only launched one masterjob, these two steps may seem a bit silly here. However, if you launch multiple masterjobs, this approach is very useful.

Merging: step 1

To perform step 1 of the merging, open the runAnalysis.C macro again, and change the argument of SetRunMode() into terminate

alienHandler->SetRunMode("terminate")

after you have made this change, you have to launch your job again. The job that you are now launching is a merging job: an instruction send to the grid nodes to combine the independent AnalysisResults.root files of sub-jobs into one merged file per master-job.

Just as with a normal job, you can monitor the progress of the merging job via https://alimonitor.cern.ch/users/jobs.jsp.

Merging: step 2

Once the merging job is finished, you will need to retrieve the final output on your laptop. One more change to your runAnalysis.C macro needs to be made. Open the file, and set

alienHandler->SetMergeViaJDL(kFALSE);

Then, launch the macro again. If all goes well, it should proceed to merge the output of the merging jobs into one final output file on your laptop.

Happy analyzing !