As of Fall 2006, the version of the GNU compilers installed on the lab machines includes support for the OpenMP extensions, so you should be able to compile and run OpenMP programs on any of our machines. Whether multithreading helps performance will depend on the program and the hardware configuration (with hyperthreading giving some potential for speedup, and more than one processor giving more potential for speedup). You can find out information about processors by looking at the pseudofile /proc/cpuinfo (looks like a text file).
Use the command gcc with the -fopenmp flag to compile C programs with OpenMP extensions. Typical usage:
gcc -fopenmp -o foo foo.c
To execute the compiled program, just type the name of the executable. By default, the number of threads is set to the number of processors (with each hyperthreaded processor counting as two). You can override this by setting the environment variable OMP_NUM_THREADS. With some compilers, using schedule(runtime) in your program will result in the runtime environment picking what it thinks is the best schedule. This does not seem to work with gcc. Either specify the type of thread scheduling in your program, or use schedule(runtime) and set the environment variable OMP_SCHEDULE. Example usages:
foo
foo arg1 arg2
OMP_NUM_THREADS=10 foo
OMP_SCHEDULE=static OMP_NUM_THREADS=10 foo