Compiling on OnDemand
ATTENTION: OnDemand is in pre-production. View or subscribe to SDSC News for updates. To request access to this resource, contact consult@sdsc.edu.
Programming Models
The OnDemand cluster supports shared memory(OpenMP or Pthreads), message passing (MPI), and mixed mode (OpenMP + MPI) programming models. Shared memory programming is done within each node and message passing is done between nodes. Mixed mode programming is useful for those applications with a limited degree of task level parallelism.
Memory Usage Modes
The default OnDemand environment supports compilation in 64-bit addressing mode, but the environment can also support 32-bit application. It is recommended that users compile in 64-bit mode unless they have compatibility issues within their code.
Performance tip: Users are urged to monitor the amount of memory their programs use and keep it within the hardware memory limits. For both 64- and 32- bit applications, the actual amount of memory available on the node is a little less than the total stated memory, because space is reserved for the operating system. If an application allocates too much memory, paging to disk starts occurring, which will significantly decrease performance. Sufficiently large paging may exhaust paging space and thus cause system problems.
Serial Programs
It is preferable to compile your programs with the Intel 9.1 icc and ifort. If you have a porting issue with the Intel compilers, use gnu compilers.
| Command | Compiles |
| icc options file.c | C and C++ |
| ifort options file.f | Fortran 77 and 90 |
To list all the compiler options, use the compiler command (e.g. icc with - help. Man pages are available for these commands.
% icc -help
% ifort -help
Some of the frequently used options are:
| Option | Definition |
| -O3 | Optimization level 3. |
| -mp | Maintain floating-point precision (disables some optimizations). |
| -openmp | Enable the parallelizer to generate multi-threaded code based on the OpenMP* directives |
| -static | Prevent linking with shared libraries. |
Message Passing Programs
For message-passing programs, compile your programs with the default mpicc and mpif90 (these automatically link with the appropriate MPI libraries) installed at /share/apps/Intel/ibmpi/bin. These compilers are built with the Intel compilers and infiniband interconnection libraries. There is also mpi compilers built with the gnu compilers and infiniband interconnection libraries located at /usr/local/topspin/mpi/mpich/bin.
| Command | Compiles |
| mpicc options file.c | C and C++ |
| mpif90 options file.f | Fortran 77 and 90 |


