TWiki> LHCb Web>TipsAndTricks (revision 4)EditAttach

Tips and Tricks

Running lxplus in a Screen Session

To run a screen session on lxplus the simplest way is to add the following line to your bashrc and then use the newly created krb5screen command :

alias krb5screen="pagsh.krb -c 'kinit && screen'" 

This will prompt you for your password and then open a screen session. By default running screen on lxplus will lead to a timeout and your progress will be lost, you will no longer have write access within the session.
Don't forget to make a note of the node you are using (e.g. lxplus012) so you can return to it later.

Running Software without Knowing the Platform

If you are unsure what platform an application has been built on you can state the option "best" when choosing which to use:

lb-run -c best LHCbDirac/prod bash

this is especially useful for applications such as Dirac where, for example, we do not care necessarily version details, we just want to download files from bookkeeping.

Using the Local Batch System

At HEP Birmingham the local batch is run under the Condor system, to submit jobs to Condor you need to first create a script to be run and then create a submission script.
The submission script contains a set of parameters:

  • Universe: What style of job (usually set to "vanilla").
  • Initial_dir: The directory from which to start the job from (this is where any output files produced will be sent).
  • Executable: The script to run.
  • Error: Name and location of the error log file.
  • Output: Name and location of the job command output log file.
  • Log: Name and location of the job condor log.
  • stream_output: send the stdout live to the output file, True/False (as opposed to at the end of the job, default is False).
  • stream_error: send the stderror live to the error file, True/False (as opposed to at the end of the job, default is False).
  • should_transfer_files: Optional argument, if "YES" then files are downloaded to the Initial_dir location.
  • when_to_transfer_output: When the files should be downloaded (usually when the job is finished so "ON_EXIT").
  • arguments: Any arguments to pass to the script.
  • Queue: The number of subjobs to run.

As a simple example if we wanted to create a text file containing "Hello World!" 50 times in parallel (not recommended!), we would create a bash script

echo "Hello World! Hello $1!" >> hello.txt
Then a submission script hello_world.sub:
should_transfer_files = YES 
when_to_transfer_files = ON_EXIT 
arguments = "LHCb Bham User" 
Queue 50

Note the use of the variable $(process) which returns the job number. To submit this job to condor first access the slc6 environment:

condor_submit hello_world.sub 

We can then list our jobs using condor_q, and view the output live using condor_tail -f .

Adding/Removing Content to EOS on Lxplus

You can mount eos on the lxplus system to easily modify files, to mount it to your home directory:

eos -b fuse mount ~/eos 

Now you can access content for the mounted location and add/remove files, when you have finished remember to unmount after:

eos -b fuse unmount ~/eos

-- KristianAlexanderZarebski? - 29 Oct 2018

Edit | Attach | Watch | Print version | History: r8 | r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r4 - 20 Nov 2018 - _47DC_61ch_47DC_61cern_47OU_61Organic_32Units_47OU_61Users_47CN_61kzarebsk_47CN_61763242_47CN_61Kristian_32Alexander_32Zarebski?
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback