HPC2N - Support - File systems: Environment variables

The Environment

 

HPC2N environment

Your home-directory is placed on an (Andrew File System) AFS. This file system is backed up regularly. AFS is a distributed networked file system, which was developed for security and scalability.

Most differences between AFS and traditional networked file systems (like NFS) are transparant for the user. Some important differences are:

  • AFS has single systems image. There is the same view of filestore from each client and server in a network of systems (like HPC2N). This means users can move between machines/workstations and still have the same view of filestore.
  • AFS makes use of Kerberos to authenticate users (it means you need to renew your ticket if you have been logged in for more than 24 hours. Use kinit). It also use access control lists (ACLs) to enable users to restrict access to their own directories.
  • Client caching to reduce network load
  • Special AFS Backup system means less system downtime (your files can be found in OldFiles/ after 24 hours).

Note that since ticket-forwarding to batch jobs does not work, the only AFS-access possible from batch jobs are to read files from your Public-directory which is world-wide readable (yes, the entire world) and from the parallel file system. Use the parallel file system for data management in conjunction with batch jobs.

See File systems and Storage for some more information about AFS and the parallel file system.

Environment variables

There are many environment variables. Some will be set automatically at login and some which you can change if needed. Many of the environment variables will be related to paths and storage locations, but there are also some which are set for specific applications (like compilers). These environment variables willl be set when you load the 'module' for the application in question. (Read more about modules in the section about them.)

You should use environment variables instead of actual paths whenever possible to avoid problems if the specific paths to any of these change. Some of the environment variables you should have are:

  • $HOME: path to your home directory
  • $PATH: all directories searched for commands/applications
  • $SHELL: your current shell (bash, tcsh, csh, ksh)
  • $KRB5CCNAME: path to your Kerberos ticket

You can find more about environment variables here.

All environment variables begin with the dollar sign ($) and are all uppercase. They may be used on the command line or in any scripts in place of and in combination with hard-coded values:

$ ls $HOME
...

You may find the value of any environment variable by using the echo command:

$ echo $SHELL
/bin/bash

You may list the values of all environment variables using the env command:

$ env
USER=myusername
HOME=/home/b/myusername
SHELL=/bin/bash
...

You may create or overwrite an environment variable using either export or setenv, depending on your shell:

  (for bash and sh)
$ export VARIABLE=value

  (for tcsh and csh)
% setenv VARIABLE value