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.
- 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
hello_word.sh:
#!/bin/bash
echo "Hello World! Hello $1!" >> hello.txt
Then a submission script
hello_world.sub:
Universe=vanilla
Initial_dir=/disk/moose/lhcb/lhcb_bham_user/my_condor_output
Executable=/home/lhcb_bham_user/my_scripts/hello_world.sh
Error=/disk/moose/lhcb/lhcb_bham_user/my_condor_output/hello_world_$(process).err
Output=/disk/moose/lhcb/lhcb_bham_user/my_condor_output/hello_world_$(process).out
Log=/disk/moose/lhcb/lhcb_bham_user/my_condor_output/hello_world_$(process).log
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:
sl6
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