Tips

Hartree Centre Logo

Back to Contents Page

Tips and tricks

Some random things that we have found useful.

Using .profile and .bashrc

There is a system wide profile in /etc/profile which is read when you log in. This sets various paths and defaults.

You can add other defaults as follows:

  1. $HOME/.profile - general environment variables and setting not specific to he bash shell. This is normally read after /etc/profile so settings can over-ride the system defaults.
  2. $HOME/.bashrc - this is read when a new bash shell is invoked. Here's a useful guide: external link: http://www.novell.com/coolsolutions/tools/17142.html
  3. $HOME/.bashrc_profile - this is required to load both .profile and .bashrc at login (unless you have changed your shell). It will typically contain the following:
OS=`uname -m`
# test if we are on Blue Joule
if [ "${OS}" = "ppc64" ]
        then
export mydir=$HOME/bgq
# test if we are on Blue Wonder
elif [ "${OS}" = "x86_64" ]
        then
export mydir=$HOME/idplx
fi

# read the other default settings if they exist
#test -e ~/.profile && . ~/.profile # see below
test -e ~/.bashrc && . ~/.bashrc

Note: Our systems do not read .bashrc_profile so you will need to put the above into .profile and miss out the first test.

Using X11 forwarding

The Hartree systems are set up to enable X11 forwarding. If you are running an X server on your work station you will be able to open an X window or GUI interface. To do this you will need to log on using X11 forwarding. From Linux this can be done with "ssh -X" or "ssh -Y" From Windows this can be done using PUTTY. Choose SSH/ Tunnels and click on "Enable X11 forwarding".

What is the difference between -X and -Y ? -X enables X11 forwarding from a non-trusted client. -Y enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 security extension controls. On our systems both will work but using -Y suggests that you are always trusting the client machine. We therefore recommend using -X.

When using X11 forwarding your work station is acting as the X server which does the rendering and the remote client sends X11 commands to it. This will be sufficient for most purposes, but will not support intensive visualisation jobs. For more information see visualisation page.

Using private modules

Environment modules are explained here: external link: http://modules.sourceforge.net .

You can create your own set of modules, perhaps loading your favourite ones plus a few other environment definitions. The syntax is explained here: external link: http://modules.sourceforge.net/man/modulefile.html .

You should put your module files in a directory called $HOME/privatemodules and then do "module load use.own".

Using tail on the Blue Gene/Q

"tail -f" doesn't properly update. You need to use:

"tail -f ---disable-inotify <filename>" (Note: three hyphens)

Linking against netcdf4

After loading the module one can run:

"nc-config --all"

and it gives you all the information you need in order to correctly link your program to it.

Human readable stack trace

You can generate a human-readable stack trace from a BG/Q core file by doing:

Joule $ `awk '/Saved Link Reg/{getline;while($1 !=

"---STACK"){printf("addr2line -e my_executable %sn",$2);getline;}}'

my_core_file`

Back to Contents Page