Mod & Sim Using Parallel Compu (CMPSC-4273-01) assignment. This professor is really strict about AI so please do it clear-fully.

CMPSC 4273 Modeling and Simulation Using Parallel Computing Assignment 2 – 10 points Helpful information: You can d ownload the Basic SLURM script file from Blackboard to use as a “base script”. You will have to modify according to your username and executable that you want to run. To write code/scripts: either use gedit, then use SCP/SFTP to transfer the file if you are using a Linux distribution , or use the vi editor on Schooner. If using Windows and Putty, you can use WinSCP to transfer files. On a Mac you can use the terminal and SCP commands or check online for an SCP/SFTP client such as Cyberduck. For writing programs I use Notepad++ and vi/Vim . For documentation on Schooner: http://ou.edu/oscer/getting_started/getting_started_using_oscer Address: schooner.oscer.ou.edu (if using Putty or other ssh client) To log on using SSH type in the terminal: ssh [email protected] Loading modules: module load OpenMPI Compilation: mpicc mycode.c –o myexe Script submission: sbatch myscript Check status: squeue –u yourusername File transfer: http://ou.edu/oscer/support/file_transfer#linux Having not connected to Schooner, type : scp direct ory_of_your_file/yourfilename [email protected]:target_directory/ Assignment Exercises : 1. Write an MPI program in C that will have each process (core) print the following message X+1 times: “Hello from process X”, where X is the rank of the given process. That is, process with rank 0 should print “Hello from process 0” once, then process 1 sh ould print “Hello from process 1” 2 times, then process 2 should print “Hello from process 2” three times etc. The printing does not have to be in order. Run this code on 4 cores (tasks should be 4 and tasks per node should be 4) by modifying the testscrip t accordingly. Then test on 6 cores, and 8 cores to verify it works. Your code should work for any number of cores (processes) that I set when testing. 6 points 2. Consider the “addition” example from the slides. Modify the code so that n is specified as a command line argument (use argv) and then the value n!=1*2*3*…*(n -1)*n is calculated in parallel. You don’t have to change how we split the problem for addition in class (you’ll have to modify the code in the slides as we did in class, m ake sure your ranges are correct). For example for n=16 on 4 cores: core 0 will have the numbers 1,2,3,4 assigned to it, core 1 will have 5,6,7,8, core 2 will have 9,10,11,12, and core 3 will have 13,14,15,16. Test your code for multiple values of n and mu ltiple values of cores (keep cores less than 20 for now) . 4 points IMPORTANT NOTE 1: Submit a screenshot of each program in the queue on Schooner. Just run the ‘ squeue –u yourusername ’ command so it only shows your job. It can either be pending or running . This is to make sure you actually used that machine. IMPORTANT NOTE 2: Also s ubmit your output and error files (stdout, stderr files) for just the final run(s) of your program(s). Please submit your source code , scripts , screenshots , and output/error files via Blackboard as a ZIP ARCHIVE .