# ATLAS environment setup wrapper. 
# UPDATED: 
#  December 18 2009. B. Caron - fix for dcap access from WNs
#     March 27 2010. B. Caron - update for SL5 WNs
# September 8, 2010. B. Caron - update to remove NFS dependence of PRIMARYGRP check

# Jan,2013 Erming Pei - setup for EMI2 version WNs

# global configuration
	    
            export BASEDIR=/opt/exp_software/atlas.glite/emi-WN_latest/

# local configuration

            export LCG_LOCATION=${BASEDIR}/usr
	    export GLITE_LOCATION=${BASEDIR}/usr
            export GLITE_LOCATION_VAR=/var
            export SRM_PATH=${BASEDIR}/usr/share/srm
            export GT_PROXY_MODE=old

	    export LCG_JAVA_HOME=$JAVA_HOME
	    export JAVA_INSTALL_PATH=$JAVA_HOME
            
            # link or copy from other places, e.g. glite-WN_latest
	    export X509_CERT_DIR=${BASEDIR}/etc/grid-security/certificates
	    export X509_VOMS_DIR=${BASEDIR}/etc/grid-security/vomsdir
            export VOMS_USERCONF=${BASEDIR}/etc/vomses

	    export EDG_WL_SCRATCH=/scratch/atlas
	    export OUTPUT_STORAGE=/tmp/jobOutput
            
            export TMPDIR=${EDG_WL_SCRATCH}
# multiple top-level BDII queries

            export LCG_GFAL_INFOSYS="lcg-bdii.cern.ch:2170,top-bdii.triumf.ca:2170"
            export BDII_LIST="lcg-bdii.cern.ch:2170,top-bdii.triumf.ca:2170"
            export MYPROXY_SERVER=myproxy.cern.ch
            export SITE_NAME=CA-ALBERTA-WESTGRID-T2

# Script env, e.g. python, perl,...

            export LD_LIBRARY_PATH=${BASEDIR}/lib64:${BASEDIR}/lib:${BASEDIR}/usr/lib64:${BASEDIR}/usr/lib:${LD_LIBRARY_PATH}
            export PATH=${BASEDIR}/bin:${BASEDIR}/usr/bin:${BASEDIR}/usr/sbin:$PATH
            export MANPATH=${BASEDIR}/usr/share/man:${MANPATH}
            export PERL5LIB=${BASEDIR}/usr/lib64/perl5/vendor_perl:${PERL5LIB}
	    export PYTHONPATH=${BASEDIR}/site-python:${PYTHONPATH}

# Experiment software

	    export VO_ATLAS_DEFAULT_SE=sehn02.atlas.ualberta.ca
	    export VO_DTEAM_DEFAULT_SE=sehn02.atlas.ualberta.ca
	    export   VO_OPS_DEFAULT_SE=sehn02.atlas.ualberta.ca

	    export VO_ATLAS_SW_DIR=/opt/exp_software/atlas
	    export VO_DTEAM_SW_DIR=/opt/exp_software/dteam
	    export   VO_OPS_SW_DIR=/opt/exp_software/ops

# ATLAS COOL dataBASEDIR replica domain
	    
	    export ATLAS_CONDDB='ca'

# configure for WN dcap access to dCache pools.
# The host checkers.westgrid.ca is the NAT box.

            export DCACHE_CLIENT_ACTIVE=1
            export DCACHE_REPLY=checkers.westgrid.ca
            alias dccp='dccp -A'

# Set LFC ENV to cope with LFC issues, 2012/06/18
            LFC_CONNTIMEOUT=10
            LFC_CONRETRY=2
            LFC_CONRETRYINT=5 

# release BASEDIR
  unset BASEDIR

# END