How do I run OpenMP programs on a Sunfire machine?
Unlike MPI programs, shared-memory parallel OpenMP programs do not need a special runtime environment to run in parallel. They only need to be instructed about the number of threads (or processes) that should be used. This is usually done by setting an environment variable. The default variable used on any system that is OpenMP enabled is OMP_NUM_THREADS. For instance, in a csh, the following sequence will cause the OpenMP program test_omp.exe to be executed with 16 threads: setenv OMP_NUM_THREADS 16; test_omp.exe An alternative variable that is specific to the Sun Solaris operating environment is PARALLEL. The following sequence when typed in a bash shell will cause our test program to run with 4 threads: export PARALLEL=4; test_omp.exe Incidentally, the number of threads may also be set from inside the program by means of a function call. The line call omp_set_num_threads(16) inside the program test_omp.f90 will have the same effect as setting the environment variable. This will take