7.4 JUNO

7.4.1 For new users

7.4.1.1 Register Accounts

  1. Make sure you are already a member of JUNO collaboration.
  2. Register IHEP Single Sign On (SSO) and apply JUNO permission.
  3. If you need to work on the computing farm, apply AFS account:
  4. If you need to work with SVN/Trac, apply SVN/Trac account:

7.4.2 File sytems

7.4.2.1 User Directories

Each user has following personal directories, as listed in the table:

Directory name Quota/files Command
/afs/ihep.ac.cn/users/username 500MB/none fs listquota /afs/ihep.ac.cn/users/username
/workfs/juno/username 5GB/50k lfs quota -u username /workfs
/junofs/users/username 500GB/300k lfs quota -u username /junofs
/scratchfs/juno/username 500GB/200k (temp, 2 weeks) lfs quota -u username /scratchfs
/eos/juno/user/username 2TB/300w eos quota

Note: if the primary group is not JUNO, please refer to other experiments.

7.4.2.2 EOS instructions

EOS is a distributed file system for EB level data storage based on xrootd framework. More details, please refer to

3.3.5 EOS file storage

1) Access file in EOS

Please use Xrootd protocol to accesses EOS system in the following ways:

root://EOS_MGM_URL//filepath

Description:

  • Xrootd uses port 1094 by default

  • You need to use " / / " after the port

  • Filepath requires absolute path**

Here EOS_MGM_URL is the server address of the instance, and the server address of JUNO experiment is junoeos01 ihep. ac.cn, please set it through the following command:

$ export EOS_MGM_URL=root://junoeos01.ihep.ac.cn/

Reminder: Users can add EOS MGM URL environment variable to ~/.bash_profile, so that it will be loaded automatically every time you log in.

$ echo "export EOS_MGM_URL=root://junoeos01.ihep.ac.cn/" >> ~/.bash_profile

Note: Users can only access the /eos through the EOS command.

Comparison of EOS command and system command

Eos command(Recommend) Linux command(not available) Description
eos ls ls get file lists
eos cp cp copy file
eos mv eos file rename mv move file
eos cp /eos/user/myfile -|cat cat get file content
eos cp /eos/user/myfile -|tail tail get file content
eos mkdir mkdir make new directory
eos touch touch touch file
eos newfind -f /eos/mypath find a list of all files in a directory (including subdirectories)
eos newfind -d /eos/mypath find a list of all directories under a directory (including subdirectories)
eos ln ln create soft link
eos quota get quota info
eos stat -f judge whether the file exists. If it does not exist, the return value is null
eos file info stat view the modify time and change status change time of the filed

Among them, 'cat' and 'tail' commands can be replaced by corresponding commands of xrdfs. The domain name of EOS needs to be added after xrdfs:

  • View the entire contents of the file: xrdfs junoeos01 cat /eos/juno/user/username/myfile

  • View the contents of N bytes at the end of the file: xrdfs junoeos01 tail -c N /eos/juno/user/username/myfile

  • View the contents at the end of the file in real time: xrdfs junoeos01 tail -f /eos/juno/user/username/myfile

2) Access /eos in job

The premise of using xrootd to read and write files in the job is that the physical software supports xrootd protocol. For ROOT, xrootd mode has been supported, but it should be noted that there are three ways to generate TFile objects:

  • Declaration: TFile (pathname) -- not supported xrootd

  • New file: new TFile (pathname) -- not supported xrootd

  • Opening method: TFile::Open (pathname) -- supported xrootd

Example:

  • For files in root format, user can directly open them with TFile::Open:

    TFile *filein = TFile::Open("root://junoeos01.ihep.ac.cn//eos_absolute_path_filein_name.root")
    
  • For non root format files, user can also use TFile to read and write directly. It is needed to add a parameter "? Filetype = raw" after the file name. For example:

    void rawfile(){  
      int size;
      char buf[1024];
      TFile *rf = TFile::Open("root://junoeos01.ihep.ac.cn//eos/user/c/chyd/set.log?filetype=raw");
      size = rf->GetSize();
      printf("size is %d\n", size);
      memset(buf, 0, 1024);
      rf->ReadBuffer(buf, 1024);
      printf("%s\n", buf);
      rf->Close();
      }
    

    3) hadd supporting xrootd

    Hadd supports merging files through xrootd. User need to set environment and then use the 'histadd' command.

      $ source /cvmfs/lhaaso.ihep.ac.cn/anysw/slc5_ia64_gcc73/external/envd.sh
      $ histadd -h
        Function: An alternative "hadd" made by <zhiguo.yao@ihep.ac.cn>
        SYNOPSIS:
          histadd  [ -o outfile ]
          [ -topdir | +topdir ] [ -folder folder1 [ -folder folder2 ... ] ]
          [ -tree | +tree ]
          [ -list listfile1 [ -list listfile2 ... ] ]
          [ -inclhist histname1 [ -inclhist histname2 ... ] ]
          [ -exclhist histname1 [ -exclhist histname2 ... ] ]
          [ filename1 [ filename2 ... ] ]
    
        BRIEF EXPLANATIONS:
          -topdir: Add objects in the top directory of every root file (default).
          +topdir: Ignore all objects in the top directory.
          -folder folder: Activate adding the TFolder "folder".
          *** Note: Only folders specfied by option "-folder folder" are added.
          -tree: Add TTree objects (default).
          +tree: Ignore all TTree objects.
          -inclhist histname: include histname in the top directory. Default: all.
          -exclhist histname: exclude histname in the top directory. Default: nothing.
          -list listfile: Add every lines in "listfile" to the input list.
          *** Note: Lines with leading "#" will be ignored!
          filename: Add "filename" to the input list.
          *** Note: (Many) list files and file names can be specified simultanously.
          *** Note: EOS files will be automatically accessed via the xrootd protocol.
    

results matching ""

    No results matching ""