Compiling on/for the shark cluster

All nodes on the shark cluster share the home file system. Users can move therefore files to the front-end node without having to allocate a compute partition on shark. It is strongly recommended to compile on the front end node (shark).

The main compiler installed on shark is gcc-4.3. In order to compile an MPI application, please choose your favorite MPI library. Currently installed is only Open MPI 1.2.6. This library supports the InfiniBand network as well as the Gigabit Ethernet network. Please extend your PATH and your LD_LIBRARY_PATH to point to the according directories, e.g. for Open MPI 1.2.6

smith@shark01:~>export PATH=/opt/OpenMPI-1.2/bin:$PATH
smith@shark01:~>echo $PATH
/opt/OpenMPI-1.2/bin:...
smith@shark01:~>export LD_LIBRARY_PATH=/opt/OpenMPI-1.2/lib:$LD_LIBRARY_PATH
smith@shark01:~>echo $LD_LIBRARY_PATH
/opt/OpenMPI-1.2/lib:...

Please note, that the LD_LIBRARY_PATH for Open MPI is pointing to the lib and not to the lib64 directory. If your settings are not changing over a long period of time, its probably worth settings those variables into your .bashrc file. Please follow the instructions oulined in the Setting environment variables webpage You can now use the wrapper compiler provided by MPI, such as mpicc, mpif77, mpif90, mpiCC , e.g for a C code

smith@shark01:~>mpicc -o simplecode simplecode.c

If you ever have doubts, whether an executable has been built on shark or another system, you can use the file command to determine whether the executable is a 32bit or a 64 bit executable. The output for an executbale built on shark should look as follows:

 
smith@shark01:~>file simplecode 
simplecode: ELF 64-bit LSB executable, AMD x86-64, ....

In contrary to that, a 32 bit executable should produce roughly the following output:

 
smith@shark01:~>file simplecode 
simplecode: ELF 32-bit LSB executable, Intel 80386, ...

Once you generated an executable on shark, you can allocate the required number of nodes for your computation using the SLURM batch scheduler.