108-2 : High-Performance Big Data and Artificial Intelligence Systems (高效能巨量資料與人工智慧系統)
- Here is an OpenMP example of Matrix Multiply https://computing.llnl.gov/tutorials/openMP/samples/C/omp_mm.c
- Compile and run it on a server in the CSIE Workstation Lab… Make sure it runs correctly
- Comment out the printf statements. Run it with 1, 2, 4, 8,… threads and report the execution time
- Double the values of NRA, NCA, and NCB to observe the execution time.
- Repeat Step 4 until a problem happens to the system. Report your observations.
gcc hw.1.c -o <exec_file_name> -fopenmp
./<exec_file_name> <num_of_threads> <times_of_matrix>
- Write an MPI code to perform the same matrix multiply task as Exercise 1. You can get the code from anywhere, but make sure that you understand how it works.
- Install the MPI environment, compile and run the MPI code on a server in the CSIE Workstation Lab.with 1, 2, 4, 8, … processes… Report the execution time. Make sure it runs correctly.
- Run it on multiple servers and report the execution time.
- Double the values of NRA, NCA, and NCB to observe the execution time.
mpicc -g -Wall -o <exec_file_name> mpi_matrix.c
mpiexec -n <num_of_process> ./<exec_file_name> <times_of_matrix>
# or run with multiple server
mpirun -host <remote1>:<slots>,<remote2>:<slots> -np <num_of_process> ./mpi_matrix <times_of_matrix>
# or run with a custom server list
mpirun -np <num_of_process> --hostfile <hostfile> ./mpi_matrix <times_of_matrix>