The final term project is designed to familiarize you with parallel computing using OpenMP and benchmarking. You can choose to parallelize one of the two following codes that you have already coded: PS1 (benchmarking code) or PS4 question 2 (Monte Carlo integration). The second option is probably more rewarding but slightly more difficult. For your convenience, below I re-propose the two questions (choose one of these two):
Questions:
Hints: Use the links on the course web-page to see the solutions of PS1 and PS4 (with source codes) and look at some examples and tutorials on how to use OpenMP to parallelize a code, also available on the web-page. OpenMP allows you to add extra commands to the source code with directives to parallelize loops on a shared memory computers (for example a desktop with multi-processors and/or CPU with multi-cores). When you compile the code you need to use the option -openmp, or equivalent (look the manual page for the compiler you use). Without the openmp option, the OpenMP directives are treated as comments by the compiler. You need access to a desktop with CPUs or cores. Your laptop may have a dual core processor, the workstation ursa.astro.umd.edu has 2 CPUs (single core), galileo.astro.umd.edu (my desktop computer) has 2 quad cores (2x4=8 cores). Try to use the computer that has the largest number of cores! On linux machines (most in the astro department) you can check how may cores are available on a host by viewing the file /proc/cpuinfo. Have fun, and start early: not late term project will be accepted.