{"id":200,"date":"2016-12-09T17:04:44","date_gmt":"2016-12-09T22:04:44","guid":{"rendered":"https:\/\/people.clas.ufl.edu\/deumens\/?page_id=200"},"modified":"2026-03-19T08:36:39","modified_gmt":"2026-03-19T12:36:39","slug":"high-performance-computing-topics-homework","status":"publish","type":"page","link":"https:\/\/people.clas.ufl.edu\/deumens\/courses\/high-performance-computing-topics-homework\/","title":{"rendered":"High Performance Computing Topics Homework"},"content":{"rendered":"\r\n<section class=\"fullwidth-text-block\">\r\n\t<div class=\"container px-0 pt-5\">\r\n\t\t<div class=\"row align-items-start\">\r\n\t\t\t<div class=\"col-12\">\r\n\t\t\t\t\n<h1 class=\"wp-block-heading\">High Performance Computing Topics Homework<\/h1>\n\n\n\n<h4 class=\"wp-block-heading\">Homework<\/h4>\n\n\n\n<ol class=\"wp-block-list\"><li><a name=\"hmwrk1\"><\/a> <strong>Homework 1 Lecture 1 and 2: Architecture of HPC systems<\/strong><br>\nConfigure a cluster purchase for your chosen problem. What is the &#8220;best&#8221; hardware and software configuration depends strongly on the kind of problem(s) you want to solve. Analyse the problem in your research area, or pick one of the following: Quantum chemistry using DFT, Molecular dynamics on bio-molecules, finite element of a bridge, an airplane, a car.<br>\nWeigh each factor and their relative proportion and importance:\n<ul>\n<li>CPU need<\/li>\n<li>I\/O speed<\/li>\n<li>storage (I\/O capacity)<\/li>\n<\/ul>\n<p>Then specify the cluster hardware and software<\/p>\n<ul>\n<li>type of CPU (32 or 64 bit, Intel, PowerPC or other architecture)<\/li>\n<li>number of CPUs and size of RAM and disk per node<\/li>\n<li>network switch<\/li>\n<li>cluster storage: local disk, global disk, RAID type<\/li>\n<li>special software: MPI, MFS, parallel file system, software RAID<\/li>\n<\/ul>\n<\/li><li><a name=\"hmwrk2\"><\/a> <strong>Homework 2 Lecture 3: Classification of HPC work<\/strong><br>\nFind the best mode to execute a list of tasks\n<ol>\n<li>Find a given (short) gene sequence in a very large set of genes.<\/li>\n<li>Hurricane simulation and path prediction.<\/li>\n<li>Find the best match between a fingerprint (image) in a fingerprint database of several hundred thousand.<\/li>\n<li>Find the boundaries of all organs in a database of many MRI scans of human midsections.<\/li>\n<\/ol>\n<p>Describe how each task is classified, what its resource requirements are and how you address each need in your proposed mode to execute the tasks.<\/p><\/li>\n<li><a name=\"hmwrk3\"><\/a> <strong>Homework 3 Lecture 4 and 5: Programmer tools<\/strong><br>\nWork through all the steps with a provided program.\n<ol>\n<li>Make a work directory<br>\n<strong>mkdir $HOME\/import<br>\ncd $HOME\/import <\/strong><\/li>\n<li>Download the files for the software project, you may have to hold down the Shift key to force your browser to download the files instead of displaying them: poisson.cpp, Makefile, testpoisson, test.correct<\/li>\n<li>Create a CVS repository:<br>\n<strong>mkdir $HOME\/cvsrepository<br>\nexport CVSROOT=$HOME\/cvsrepository<br>\ncvs init <\/strong><\/li>\n<li>Import the downloaded files into the repository<br>\n<strong>cvs import -m &#8220;Solve Poisson and Helmholtz equation.&#8221; poisson Homework3 Serialversion <\/strong><\/li>\n<li>Create a working directory of the project<br>\n<strong>rm poisson.cpp Makefile testpoisson test.correct<br>\ncvs co poisson<br>\ncd poisson<br>\ncvs log <\/strong><br>\nshows the status of the source code: names, dates created, who created them, etc. Look at the files with an editor or with <strong>more<\/strong> or <strong>less<\/strong><\/li>\n<li>Build the program and verify that it works and gives correct answers<br>\n<strong>make<br>\n.\/testpoisson <\/strong><br>\nThe program works correctly when the <strong>testpoisson<\/strong> script prints &#8220;Poisson test passed&#8221;.<\/li>\n<li>Submit a brief report to the deumens@qtp.ufl.edu.<\/li>\n<\/ol>\n<\/li><li><a name=\"hmwrk4\"><\/a> <strong>Homework 4 Lecture 7: MPI programming part 1<\/strong><br>\nDebug and run a given example program that implements a matrix multiply with minimal MPI\n<ol>\n<li>Continue as in homework 3. First download the program for this homework.<br>\nIf you prefer, you can rewrite the program in the language of your choice, such as Fortran 77, Fortran 90 or C 89. Your can start from the C++ 98 version supplied below.<br>\nIf you do not have access to a system with MPI, send an e-mail to deumens@qtp.ufl.edu to request a class account on the QTP system and run on the SIMU or XENA III cluster.<\/li>\n<li>Download the files for the software project, you may have to hold down the Shift key to force your browser to download the files instead of displaying them: matrixserial.cpp, matrix.cpp, Makefile<\/li>\n<li>You must edit the Makefile to get the correct call for compilation with C++ and MPI libraries, or Fortran or C if you choose tp rewrite the program.<br>\nImport the new files into your CVS repository as a new module &#8220;matrix&#8221; as in homework 3. Check the final working version into your CVS repository.<\/li>\n<li>Figure out how to set up the LAM-MPI or MPICH machine file or the POE host.list file or LAM MPI universe (depending on which MPI you are using) to run your program. For example with MPICH:<br>\n<strong>mpirun -machinefile list -np 4 .\/matrix<\/strong><br>\nRun both the serial and parallel program.<\/li>\n<li><strong>MPI_Broadcast<\/strong> Replace the MPI send and receive with MPI broadcast. Edit the file and fix the MPI calls. Use the online documentation or man page for each call to find the arguments and code them correctly.<br>\nCompile, debug and run the program and make sure the answer is the same.<\/li>\n<li><strong>Square blocks<\/strong> Change the program to use square blocks instead of rows to divide the matrices.<br>\nCompile, debug and run the program and make sure the answer is the same.<\/li>\n<li>Send the final programs, with broadcast and with square blocks, to deumens@qtp.ufl.edu.<\/li>\n<\/ol>\n<\/li><li><a name=\"hmwrk5\"><\/a> <strong>Homework 5 Lecture 8: MPI programming part 2<\/strong><br>\nTime the program created in homework 4 using the method explained in the lecture.\n<ol>\n<li>Modify the program <strong>matrix.cpp<\/strong> using code similar to the following to obtain wall-clock timings for computation and comminication:\n<pre>  double newtime=0.;\r\n  double oldtime=0;\r\n  double othertime=0.;\r\n  double matrix_workt=0.;\r\n  double matrix_msgt=0.;\r\n  long matrix_count=0;\r\n  newtime=MPI_Wtime();\r\n  oldtime=newtime;\r\n\r\n  \/\/ other code\r\n\r\n  \/\/ inside the loop for doing work\r\n\r\n  newtime=MPI_Wtime();\r\n  othertime+=newtime-oldtime;\r\n  oldtime=newtime;\r\n\r\n  \/\/ do work here...\r\n\r\n  newtime=MPI_Wtime();\r\n  matrix_workt+=newtime-oldtime;\r\n  oldtime=newtime;\r\n\r\n  \/\/ do communication here...\r\n\r\n  newtime=MPI_Wtime();\r\n  matrix_msgt+=newtime-oldtime;\r\n  oldtime=newtime;\r\n\r\n  \/\/ do more work here...\r\n\r\n  newtime=MPI_Wtime();\r\n  matrix_workt+=newtime-oldtime;\r\n  oldtime=newtime;\r\n\r\n  \/\/ other code\r\n\r\n  \/\/ Generate the timings report on each task\r\n  \/\/matrix_workt\/=matrix_count;\r\n  cout &lt;&lt; \"Task \" &lt;&lt; ME &lt;&lt; \" matrix wrk \" &lt;&lt; matrix_workt\r\n       &lt;&lt; \" matrix msg \" &lt;&lt; matrix_msgt\r\n       &lt;&lt; \" matrix_count \" &lt;&lt; matrix_count &lt;&lt; endline\r\n       &lt;&lt; \"Task \" &lt;&lt; ME &lt;&lt; \" othertime \" &lt;&lt; othertime &lt;&lt; endline;\r\n<\/pre>\n<\/li>\n<li>Compile, run and debug the modified program.<\/li>\n<li>Submit a brief report to the deumens@qtp.ufl.edu.<\/li>\n<li><strong>Extra<\/strong> You can let each task send the results to the master task (task 0 by convention), and it can then compute averages and standard deviation and print out the timing report in a more organized and more meaningful way.<\/li>\n<\/ol>\n<\/li><li><a name=\"hmwrk6\"><\/a> <strong>Homework 6 Lecture 9: OpenMP programming<\/strong><br>\nCompile and run an OpenMP Fortran 90 program.\n<ol>\n<li>First download the program for this homework.<br>\nIf you prefer, you can rewrite the program in the language of your choice, such as Fortran 77, Fortran 90 or C 89. Your can start from the C++ 98 version supplied below.<br>\nIf you do not have access to a system with OpenMP, send an e-mail to deumens@qtp.ufl.edu to request a class account on the QTP system and run on BUDDY, the SIMU or XENA III cluster.<\/li>\n<li>Download the files for the software project, you may have to hold down the Shift key to force your browser to download the files instead of displaying them: openmp.f90, Makefile<\/li>\n<li>Set the OpenMP environment variable OMP_NUM_THREADS to the number of threads and run the program.<\/li>\n<li><strong>Blocks<\/strong> Implement the blocked matrix of homework 4 multiplication algorithm in this OpenMP program.<\/li>\n<li>Send the modified program, with the blocked algorithm to deumens@qtp.ufl.edu.<\/li>\n<\/ol>\n<\/li><li><a name=\"hmwrk7\"><\/a> <strong>Homework 7 Lecture 10: POSIX threads programming<\/strong><br>\nCompile and run a C program using POSIX threads.\n<ol>\n<li>First download the program for this homework.<br>\nIf you prefer, you can rewrite the program in the language of your choice, such as Fortran 77, Fortran 90 or C 89. Your can start from the C++ 98 version supplied below.<br>\nIf you do not have access to a system with OpenMP, send an e-mail to deumens@qtp.ufl.edu to request a class account on the QTP system and run on BUDDY, the SIMU or XENA III cluster.<\/li>\n<li>Download the files for the software project, you may have to hold down the Shift key to force your browser to download the files instead of displaying them: posix.c, Makefile<\/li>\n<li>Compile the program and run it with the folloing options:<br>\nUse 4 threads, process-wide scheduling, and perform 25 iterations of 30 counts each<br>\n<strong>.\/posix -p -n 4 -i 25 -c 30<\/strong><br>\nUse 5 threads, system-wide scheduling, and perform 25 iterations of 30 counts each<br>\n<strong>.\/posix -s -n 5 -i 25 -c 30<\/strong><\/li>\n<li><strong>Blocks<\/strong> Implement the blocked matrix of homework 4 multiplication algorithm into the work portion of the program.<\/li>\n<li>Send the modified program, with the blocked algorithm to deumens@qtp.ufl.edu.<\/li>\n<\/ol>\n<\/li><\/ol>\n\n\n\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t<\/div>\r\n<\/section>\r\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":685,"featured_media":0,"parent":8,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"featured_post":"","footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-200","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/pages\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/users\/685"}],"replies":[{"embeddable":true,"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/comments?post=200"}],"version-history":[{"count":4,"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/pages\/200\/revisions"}],"predecessor-version":[{"id":433,"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/pages\/200\/revisions\/433"}],"up":[{"embeddable":true,"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/pages\/8"}],"wp:attachment":[{"href":"https:\/\/people.clas.ufl.edu\/deumens\/wp-json\/wp\/v2\/media?parent=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}