Root macro with batch job LSF

Hi,

I tried to submit a macro with batch job as described in the below link because the root file i am analyzing is containing a huge no. of events and i couldn’t compile it interactively because the pipe got broken and lxplus freezes

https://root.cern.ch/root/roottalk/roottalk98/0550.html

And the output STDOUT(*) file is indicated below, i just need to understand is the job successfully finished or it is missing something because i didn’t get an output however i fixed the error that arises while trying.

And the run.sh file i used is include just 2 lines:

cd /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000
root -b -q run.C

and run.C includes the below lines:

{
gROOT->LoadMacro("Data_Histograms.C+");
}



(*)

@(#)CERN job starter $Date: 2010/06/23 14:22:16 $
Working directory is </pool/lsf/melsawy/143456480> on <b6d0f65222.cern.ch>

  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/36      5 April 2016   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.34/36 (heads/v5-34-00-patches@v5-34-34-76-g57bae4c, Apr 08 2016, 12:05:00 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Processing run.C...

Job finished at Wed Feb 14 20:49:46 CET 2018 on node
 under linux version Scientific Linux CERN SLC release 6.9 (Carbon)

CERN statistics: This process used approximately : 0:00:01 KSI2K hours (1 KSI2K seconds)
                 This process corresponds to     : 0:00:06 HS06  hours (6 HS06  seconds)

thanks,
Mai

Hi Mai,
something is definitely wrong: your job only took 1 second to run. Mostly likely it started and then crashed just right after.

how can i learn to write a batch script file to work on root macros?

thanks,

mai

Why do you need this intermediate run.C macro which only loads your real macro and does not execute it ?
Why not simply doing:

root -b -q Data_Histograms.C+

my main problem is when i work interactive the internet connection cut before getting my output.root because the no. of events is large.

I tried the command

root -b -q Data_Histograms.C+

but i didnt see output, is it running offline?? or how can i know that i am doing the right step?

[melsawy@lxplus006 src]$ root -b -q Data_Histograms.C+
   ------------------------------------------------------------
  | Welcome to ROOT 6.06/01                http://root.cern.ch |
  |                               (c) 1995-2014, The ROOT Team |
  | Built for linuxx8664gcc                                    |
  | From tag , 9 December 2015                                 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

root [0] 
Processing Data_Histograms.C+...
Info in <TUnixSystem::ACLiC>: creating shared library /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000/CMSSW_8_0_28_patch1/src/./Data_Histograms_C.so
(Data_Histograms) @0x2e82cc0

The option -b you pass to root does not mean you submit a batch job. It simply means no graphics window will be opened when you will draw something which is convenient when you submit a root script in a batch queue But you should submit your job using root in a batch queue and this is not done by root itself. You should use the lxplus batch queuing system to submit your job.

This was my first message above. when i used LSF batch job my process ends in 1 sec and i got no output. i think i am missing something in the script.sh itself but i am trying to search for a script working on root macros and i failed. i only find scripts to work in CMSSW environment with python files.

thanks,

Mai

Yes that’s is what I said your run.C macro just load the macro Data_Histograms.C but does not execute it. That’s why it is so quick. You should submit to LSF a shell executing your macro. For instance a script containing the line:

root -b -q Data_Histograms.C+

which will compile and execute your macro.

Hi,
I tried again with your suggestion and the process took longer than than last time but still have no output… the output of the LSF job is not indicating the problem , as i understood. please have a look the output of the submitting job below (*).

I wonder is it enough to write in the sh scrip (run.sh) only two lines: or this question not related to root forum.


cd /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000
root -b -q Data_Histograms.C+

(*)
@(#)CERN job starter $Date: 2010/06/23 14:22:16 $
Working directory is </pool/lsf/melsawy/144225009> on <p05792984w43974.cern.ch>

  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/36      5 April 2016   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.34/36 (heads/v5-34-00-patches@v5-34-34-76-g57bae4c, Apr 08 2016, 12:05:00 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Processing Data_Histograms.C+...
Info in <TUnixSystem::ACLiC>: creating shared library /eos/cms/store/group/phys_exotica/Monopole_2017/$
In file included from /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/$
                 from /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/$
                 from /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/$
/eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000/./Data_Histograms$
(class Data_Histograms)24932208

Job finished at Sat Feb 17 07:26:19 CET 2018 on node
 under linux version Scientific Linux CERN SLC release 6.9 (Carbon)

CERN statistics: This process used approximately : 0:00:15 KSI2K hours (15 KSI2K seconds)
                 This process corresponds to     : 0:01:01 HS06  hours (61 HS06  seconds)

Your “run.sh” shell script is fine.
The long output lines (which you show) were cut so one cannot see the reported errors.

BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your post has been edited above).


@(#)CERN job starter $Date: 2010/06/23 14:22:16 $
Working directory is </pool/lsf/melsawy/144225009> on <p05792984w43974.cern.ch>


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/36 5 April 2016 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/36 (heads/v5-34-00-patches@v5-34-34-76-g57bae4c, Apr 08 2016, 12:05:00 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Processing Data_Histograms.C+…
Info in TUnixSystem::ACLiC: creating shared library /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000/./Data_Histograms_C.so
In file included from /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000/./Data_Histograms.C:2,
from /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000/Data_Histograms_C_ACLiC_dict.h:34,
from /eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000/Data_Histograms_C_ACLiC_dict.cxx:17:
/eos/cms/store/group/phys_exotica/Monopole_2017/MET/CRAB3_METD_v1/171125_053022/0000/./Data_Histograms.h:990: warning: unused parameter ‘entry’
(class Data_Histograms)24932208

Job finished at Sat Feb 17 07:26:19 CET 2018 on node
under linux version Scientific Linux CERN SLC release 6.9 (Carbon)

CERN statistics: This process used approximately : 0:00:15 KSI2K hours (15 KSI2K seconds)
This process corresponds to : 0:01:01 HS06 hours (61 HS06 seconds)


I hope it looks fine now.

Mai

Hi ,

by the way when i did interactively the below command i didnt get any output file.

root -b -q Data_Histograms.C+
I got:


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/36 5 April 2016 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/36 (heads/v5-34-00-patches@v5-34-34-76-g57bae4c, Apr 08 2016, 12:05:00 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0]
Processing Data_Histograms.C+…
(class Data_Histograms)14813696


When i did

root -l
root [ ].L Data_Histograms.C+
root [ ]Data_Histograms m
root [ ]m.Loop()

I got then the output.root file with the histograms i waned to plot

so i think i should change what is written in the sh script "root -b -q Data_Histograms.C+"
to something else… can you please advice.

thanks,

Mai

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.