HELLO is a simple program that says "Hello", but also demonstrates a few simple things about OpenMP programs, including
To use the program, you will also need to figure out the appropriate compiler switches to use, and how to set the enviroment variable OMP_NUM_THREADS to the number of threads you want.
To run the HELLO program, you first need to copy one of these source code files, compile it using the appropriate compiler switches, and be sure to name the executable hello.
If you have created an OpenMP executable from the hello source code, and called it hello, then you can run the following BASH shell script to execute the program requesting 1, 2, 4 and 8 threads, using the command
bash hello_local.shThe output will not show up on the screen, but rather in a file called "hello_local_output.txt".
Once you have made an OpenMP executable from the hello source code, copy the following script file to the same directory, and issue the command msub hello.sh. That submits a request to have the executable program run on 1, 2 and 4 processors. You can type showq to see if the request has started yet. When the program has completed, the output should show up in the file "hello_batch_output.txt".
You can go up one level to the OpenMP page.
Last revised on 10 October 2011.