Home

AliRoot

AliEn

Links

Meetings

How to Configure AliEn on musse, log in AliEn and perform simple actions on the AliEn shell

First things first :

  • Get a fully working Grid certificate following Peter's instructions here. This should provide you a ~/.globus/ directory with at least user_cert.pem and user_key.pem in it. Copy your .globus/ directory to the home directory on your account on musse. Use chmod to set the following permissions to the files in .globus :
  • pgros@musse:~/.globus> ls -l
    total 12
    -rw-r--r-- 1 pgros users 4574 2007-05-09 12:34 usercert.pem
    -rw------- 1 pgros users  963 2007-05-09 12:34 userkey.pem
    

    Configure your environment

  • Put the following lines in your ~/.cshrc :

    setenv alien_API_USER "pgros" put your Alien/CERN user name here
    setenv alien_HOME "/alice/cern.ch/user/p/pgros/" put your Alien/CERN user name here also
    
    setenv ALIEN_ROOT /home/alicesoft/august2007/alien
    setenv GSHELL_ROOT $ALIEN_ROOT/api
    setenv GSHELL_GCC `which gcc`
    setenv PATH ${GSHELL_ROOT}/bin:${ALIEN_ROOT}/bin:${PATH}
    setenv LD_LIBRARY_PATH ${ALIEN_ROOT}/globus/lib:${GSHELL_ROOT}/lib:${LD_LIBRARY_PATH}
    

    NB: You can get a standard .cshrc on musse:/home/alicesoft, and only modify alien_API_USER and alien_HOME.

    Get a token

  • To be able to do anything on AliEn, you first need a token which will be created from your cerificate. This token is valid for 24 hours.
  • alien-token-init alienusername
    
  • You should get the following output
  • username@musse:~> alien-token-init
    ---------------------------------------------------------------
    Setting central config:
    ===============================================================
    export alien_API_SERVER_LIST="pcapiserv04.cern.ch:10000|pcapiserv05.cern.ch:10000"
    export alien_API_PORT=10000
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GSHELL_ROOT/lib
    export TERMINFO=/usr/share/terminfo
    ===============================================================
    *********************************************************************************
    Attention: You don't have a valid grid proxy - doing grid-proxy-init for you ...
    *********************************************************************************
    Your identity: /O=Grid/O=NorduGrid/OU=hep.lu.se/CN=Your Name
    Enter GRID pass phrase for this identity: here you enter your password
    Creating proxy .................................... Done
    Your proxy is valid until: Tue Jul 10 23:53:18 2007
    => Trying to connect to Server [1] http://pcapiserv05.cern.ch:10000 as User pgros
    Your identity: alienusername
    Creating token ..................................... Done
    Your token is valid until: Wed Jul 11 11:53:11 2007
    
    

    NB : if your alien username is the same as your local username (whoami), you can omit it in the alien-token-init command.

    You can check if you already have a valid token with the command alien-token-info

    Open an AliEn shell

  • Once you have a valid token, you can open an AliEn shell with the command aliensh.
  • pgros@musse:~> aliensh
     [ aliensh 2.1.9 (C) ARDA/Alice: Andreas.Joachim.Peters@cern.ch/Derek.Feichtinger@cern.ch]
    ###############################################################
    # ALIEN Service Message:                                      #
    ###############################################################
    ===============================================================
    
    ---------------------------------------------------------------
    10 July 2007 - CASTOR2 upgrades at CERN from 08:00 to 11:00 CEST
                   User jobs requesting files from CERN MSS may fail
    
    ***************************************************************
    * Please report operational problems to Latchezar.Betev@cern.ch
    * Bug reports should be submitted via savannah.cern.ch
    * http://savannah.cern.ch/bugs/?group=alien&func=additem
    
    ###############################################################
    aliensh:[alice] [1] /alice/cern.ch/user/p/pgros/ >
    
  • Once in the AliEn shell, you can check the available functions with tab completion. You can also browse the directories, for example /alice/sim/ to find the available data. You can also edit text files with edit. You can define the editor with the variable $EDITOR (export EDITOR='emacs -nw' for example), the default editor is vi. You can have aliensh set the environment automatically by putting the command in a .alienshrc on your local home directory.

    Getting started : copy a file from AliEn

  • Just to start playing, you can try to download a file from and to AliEn. the command is simply cp, and you access your local directory by putting file: in front of your path. Be careful, the destination "." does not exist on the AliEn shell, but you can just put the name of the destination directory.
  • aliensh:[alice] [1] /alice/cern.ch/user/p/pgros/ >cp /alice/sim/2006/pp_minbias/412/999/rec.log file:.
    [xrootd] Total 0.08 MB  |====================| 100.00 % [0.1 Mb/s]
    aliensh:[alice] [2] /alice/cern.ch/user/p/pgros/ >cp file:rec.log ../pgros/
    [xrootd] Total 0.08 MB  |====================| 100.00 % [0.1 Mb/s]
    
    Congratulations ! You have made your first steps in an AliEn world.

    Another basic step : connect to AliEn through ROOT or AliRoot

    You can access AliEn from root. For this, you will of course need a recent enough version of ROOT. (The appropriate version of AliRoot is not available on musse yet). Then the environment must be configured specifically : this is partially done with the scripts alienroot and alienaliroot, but you also need some work manually.

    Just add the following in your .cshrc

    setenv ROOTSYS ${ALICE}/root
    setenv PATH ${ROOTSYS}/bin:${PATH}
    if ($?LD_LIBRARY_PATH) then
        setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${ROOTSYS}/lib
    else
        setenv LD_LIBRARY_PATH ${ROOTSYS}/lib
    endif
    
    setenv alien_API_USER "pgros" put your Alien/CERN user name here
    setenv alien_HOME "/alice/cern.ch/user/p/pgros/" put your Alien/CERN user name here also
    
    As usual, to be able to connect to AliEn, you will first need a token. Once you have ROOT running, you connect to AliEn with the function TGrid::Connect("alien://").

    N.B. : to be able to run on a remote shell, you must either activate X11 windows system in your ssh session (ssh -X musse or deactivate windowing in root (alienroot -b).

    musse users/pgros> alienroot -b
      *******************************************
      *                                         *
      *        W E L C O M E  to  R O O T       *
      *                                         *
      *   Version   5.15/08       30 May 2007   *
      *                                         *
      *  You are welcome to visit our Web site  *
      *          http://root.cern.ch            *
      *                                         *
      *******************************************
    
    Compiled on 29 June 2007 for linuxx8664gcc with thread support.
    
    CINT/ROOT C/C++ Interpreter version 5.16.19, March 16, 2007
    Type ? for help. Commands must be C++ statements.
    Enclose multiple statements between { }.
    root [0] TGrid::Connect("alien://")
    => Trying to connect to Server [1] http://pcapiserv05.cern.ch:10000 as User pgros
    ###############################################################
    # ALIEN Service Message:                                      #
    ###############################################################
    ===============================================================
    
    ---------------------------------------------------------------
    10 July 2007 - Normal operation
                   ----------------
    
    ***************************************************************
    * Please report operational problems to Latchezar.Betev@cern.ch
    * Bug reports should be submitted via savannah.cern.ch
    * http://savannah.cern.ch/bugs/?group=alien&func=additem
    
    ###############################################################
    (class TGrid*)0x9c8dd0
    root [1]  
    

    From here, you can now access files on the Grid simply by writing the command TFile::Open("alien://path")

    root [2] TFile::Open("alien:///alice/sim/2006/pp_minbias/421/999/AliESDs.root")
    Info in : Accessing image 1 of alien:///alice/sim/2006/pp_minbias/421/999/AliESDs.root in SE 
    XrdClientConn::GoToAnotherServer: log id: 0, streamid: 1
    Warning in : no dictionary for class AliFMDMap is available
    Warning in : no dictionary for class AliFMDFloatMap is available
    Warning in : no dictionary for class AliESD is available
    Warning in : no dictionary for class AliESDVertex is available
    Warning in : no dictionary for class AliVertex is available
    Warning in : no dictionary for class AliMultiplicity is available
    Warning in : no dictionary for class AliESDFMD is available
    Warning in : no dictionary for class AliESDtrack is available
    Warning in : no dictionary for class AliExternalTrackParam is available
    Warning in : no dictionary for class AliTrackPointArray is available
    Warning in : no dictionary for class AliESDHLTtrack is available
    Warning in : no dictionary for class AliESDMuonTrack is available
    Warning in : no dictionary for class AliESDPmdTrack is available
    Warning in : no dictionary for class AliESDTrdTrack is available
    Warning in : no dictionary for class AliESDv0 is available
    Warning in : no dictionary for class AliESDcascade is available
    Warning in : no dictionary for class AliESDkink is available
    Warning in : no dictionary for class AliESDV0MI is available
    Warning in : no dictionary for class AliESDCaloCluster is available
    (class TFile*)0x971fe0
    
    Last modified: September 20 2007.