diff --git a/jacobi/openmp/not_opt/src/jacobi_2D_omp_not_opt.c b/jacobi/openmp/not_opt/src/jacobi_2D_omp_not_opt.c index a43c5bbcb2f75e956b8933784327773c9ce94e46..d61d7fd456d76679efd65d95f616d019038c2b07 100644 --- a/jacobi/openmp/not_opt/src/jacobi_2D_omp_not_opt.c +++ b/jacobi/openmp/not_opt/src/jacobi_2D_omp_not_opt.c @@ -225,9 +225,7 @@ void JacobiAlgorithm(MyData **const restrict Phi, { *error = 0.0; -#pragma omp parallel default(none) shared(error, delta, Phi, Phi0) \ - firstprivate(ibeg, iend, jbeg, jend) \ - num_threads(Nthreads) +#pragma omp parallel default(none) /**** MISSING CLAUSES ****/ { #if defined(DEBUG) const int id = omp_get_thread_num(); @@ -236,7 +234,9 @@ void JacobiAlgorithm(MyData **const restrict Phi, #pragma omp barrier #endif /* DEBUG */ - #pragma omp for schedule(static) + + /***** MISSING LOOP(s) PARALLELIZATION *****/ + for (int j=jbeg ; j<=jend ; j++) { for (int i=ibeg ; i<=iend ; i++) diff --git a/jacobi/serial/not_opt/src/jacobi_2D_serial_not_opt.c b/jacobi/serial/not_opt/src/jacobi_2D_serial_not_opt.c index ba53f321242432290dca329fae94271189fadf82..ea1d8edd97cf2f1f8fc6faf20c5f99f3d987e32e 100644 --- a/jacobi/serial/not_opt/src/jacobi_2D_serial_not_opt.c +++ b/jacobi/serial/not_opt/src/jacobi_2D_serial_not_opt.c @@ -75,7 +75,7 @@ int main(int argc, char **argv) 2. Generate grid, allocate memory -------------------------------------------------------- */ - /* memory allocation */ + /* memory allocation for I.C. */ MyData *xg = (MyData *) malloc((NX_GLOB + 2*NGHOST) * sizeof(MyData)); MyData *yg = (MyData *) malloc((NY_GLOB + 2*NGHOST) * sizeof(MyData)); assert((xg != NULL) && (yg != NULL)); @@ -136,24 +136,10 @@ int main(int argc, char **argv) printf("\n\t NX_GLOB x NY_GLOB = %d x %d\n", NX_GLOB, NY_GLOB); printf("\n\t Time = %lf [s]\n\n", seconds() - time_start); - // free memory - if (phi0) - { - free(phi0[0]); - free(phi0); - } - - if (phi) - { - free(phi[0]); - free(phi); - } - if (yg) - free(yg); - - if (xg) - free(xg); + /******************** MISSING CODE ********************************/ + /* free memory dynamically allocated */ + /******************** MISSING CODE ********************************/ return 0; } diff --git a/jacobi/mpi/SendRecv/Makefile b/jacobi_solutions/mpi/SendRecv/Makefile similarity index 100% rename from jacobi/mpi/SendRecv/Makefile rename to jacobi_solutions/mpi/SendRecv/Makefile diff --git a/jacobi/mpi/SendRecv/include/allvars.h b/jacobi_solutions/mpi/SendRecv/include/allvars.h similarity index 100% rename from jacobi/mpi/SendRecv/include/allvars.h rename to jacobi_solutions/mpi/SendRecv/include/allvars.h diff --git a/jacobi/mpi/SendRecv/include/tools.h b/jacobi_solutions/mpi/SendRecv/include/tools.h similarity index 100% rename from jacobi/mpi/SendRecv/include/tools.h rename to jacobi_solutions/mpi/SendRecv/include/tools.h diff --git a/jacobi/mpi/SendRecv/make.def b/jacobi_solutions/mpi/SendRecv/make.def similarity index 100% rename from jacobi/mpi/SendRecv/make.def rename to jacobi_solutions/mpi/SendRecv/make.def diff --git a/jacobi/mpi/SendRecv/make_mpi_path b/jacobi_solutions/mpi/SendRecv/make_mpi_path similarity index 100% rename from jacobi/mpi/SendRecv/make_mpi_path rename to jacobi_solutions/mpi/SendRecv/make_mpi_path diff --git a/jacobi/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c b/jacobi_solutions/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c similarity index 100% rename from jacobi/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c rename to jacobi_solutions/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c diff --git a/jacobi/mpi/SendRecv/src/tools.c b/jacobi_solutions/mpi/SendRecv/src/tools.c similarity index 100% rename from jacobi/mpi/SendRecv/src/tools.c rename to jacobi_solutions/mpi/SendRecv/src/tools.c diff --git a/jacobi/mpi/Send_Recv_blocking/Makefile b/jacobi_solutions/mpi/Send_Recv_blocking/Makefile similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/Makefile rename to jacobi_solutions/mpi/Send_Recv_blocking/Makefile diff --git a/jacobi/mpi/Send_Recv_blocking/include/allvars.h b/jacobi_solutions/mpi/Send_Recv_blocking/include/allvars.h similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/include/allvars.h rename to jacobi_solutions/mpi/Send_Recv_blocking/include/allvars.h diff --git a/jacobi/mpi/Send_Recv_blocking/include/tools.h b/jacobi_solutions/mpi/Send_Recv_blocking/include/tools.h similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/include/tools.h rename to jacobi_solutions/mpi/Send_Recv_blocking/include/tools.h diff --git a/jacobi/mpi/Send_Recv_blocking/make.def b/jacobi_solutions/mpi/Send_Recv_blocking/make.def similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/make.def rename to jacobi_solutions/mpi/Send_Recv_blocking/make.def diff --git a/jacobi/mpi/Send_Recv_blocking/make_mpi_path b/jacobi_solutions/mpi/Send_Recv_blocking/make_mpi_path similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/make_mpi_path rename to jacobi_solutions/mpi/Send_Recv_blocking/make_mpi_path diff --git a/jacobi/mpi/Send_Recv_blocking/script/input_parameters b/jacobi_solutions/mpi/Send_Recv_blocking/script/input_parameters similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/script/input_parameters rename to jacobi_solutions/mpi/Send_Recv_blocking/script/input_parameters diff --git a/jacobi/mpi/Send_Recv_blocking/script/run_pleiadi.sh b/jacobi_solutions/mpi/Send_Recv_blocking/script/run_pleiadi.sh similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/script/run_pleiadi.sh rename to jacobi_solutions/mpi/Send_Recv_blocking/script/run_pleiadi.sh diff --git a/jacobi/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c b/jacobi_solutions/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c rename to jacobi_solutions/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c diff --git a/jacobi/mpi/Send_Recv_blocking/src/tools.c b/jacobi_solutions/mpi/Send_Recv_blocking/src/tools.c similarity index 100% rename from jacobi/mpi/Send_Recv_blocking/src/tools.c rename to jacobi_solutions/mpi/Send_Recv_blocking/src/tools.c diff --git a/jacobi/mpi/Send_Recv_nonblocking/Makefile b/jacobi_solutions/mpi/Send_Recv_nonblocking/Makefile similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/Makefile rename to jacobi_solutions/mpi/Send_Recv_nonblocking/Makefile diff --git a/jacobi/mpi/Send_Recv_nonblocking/include/allvars.h b/jacobi_solutions/mpi/Send_Recv_nonblocking/include/allvars.h similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/include/allvars.h rename to jacobi_solutions/mpi/Send_Recv_nonblocking/include/allvars.h diff --git a/jacobi/mpi/Send_Recv_nonblocking/include/tools.h b/jacobi_solutions/mpi/Send_Recv_nonblocking/include/tools.h similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/include/tools.h rename to jacobi_solutions/mpi/Send_Recv_nonblocking/include/tools.h diff --git a/jacobi/mpi/Send_Recv_nonblocking/make.def b/jacobi_solutions/mpi/Send_Recv_nonblocking/make.def similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/make.def rename to jacobi_solutions/mpi/Send_Recv_nonblocking/make.def diff --git a/jacobi/mpi/Send_Recv_nonblocking/make_mpi_path b/jacobi_solutions/mpi/Send_Recv_nonblocking/make_mpi_path similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/make_mpi_path rename to jacobi_solutions/mpi/Send_Recv_nonblocking/make_mpi_path diff --git a/jacobi/mpi/Send_Recv_nonblocking/script/input_parameters b/jacobi_solutions/mpi/Send_Recv_nonblocking/script/input_parameters similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/script/input_parameters rename to jacobi_solutions/mpi/Send_Recv_nonblocking/script/input_parameters diff --git a/jacobi/mpi/Send_Recv_nonblocking/script/run_pleiadi.sh b/jacobi_solutions/mpi/Send_Recv_nonblocking/script/run_pleiadi.sh similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/script/run_pleiadi.sh rename to jacobi_solutions/mpi/Send_Recv_nonblocking/script/run_pleiadi.sh diff --git a/jacobi/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c b/jacobi_solutions/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c rename to jacobi_solutions/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c diff --git a/jacobi/mpi/Send_Recv_nonblocking/src/tools.c b/jacobi_solutions/mpi/Send_Recv_nonblocking/src/tools.c similarity index 100% rename from jacobi/mpi/Send_Recv_nonblocking/src/tools.c rename to jacobi_solutions/mpi/Send_Recv_nonblocking/src/tools.c diff --git a/jacobi/mpi/Send_Recv_paired/Makefile b/jacobi_solutions/mpi/Send_Recv_paired/Makefile similarity index 100% rename from jacobi/mpi/Send_Recv_paired/Makefile rename to jacobi_solutions/mpi/Send_Recv_paired/Makefile diff --git a/jacobi/mpi/Send_Recv_paired/include/allvars.h b/jacobi_solutions/mpi/Send_Recv_paired/include/allvars.h similarity index 100% rename from jacobi/mpi/Send_Recv_paired/include/allvars.h rename to jacobi_solutions/mpi/Send_Recv_paired/include/allvars.h diff --git a/jacobi/mpi/Send_Recv_paired/include/tools.h b/jacobi_solutions/mpi/Send_Recv_paired/include/tools.h similarity index 100% rename from jacobi/mpi/Send_Recv_paired/include/tools.h rename to jacobi_solutions/mpi/Send_Recv_paired/include/tools.h diff --git a/jacobi/mpi/Send_Recv_paired/make.def b/jacobi_solutions/mpi/Send_Recv_paired/make.def similarity index 100% rename from jacobi/mpi/Send_Recv_paired/make.def rename to jacobi_solutions/mpi/Send_Recv_paired/make.def diff --git a/jacobi/mpi/Send_Recv_paired/make_mpi_path b/jacobi_solutions/mpi/Send_Recv_paired/make_mpi_path similarity index 100% rename from jacobi/mpi/Send_Recv_paired/make_mpi_path rename to jacobi_solutions/mpi/Send_Recv_paired/make_mpi_path diff --git a/jacobi/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c b/jacobi_solutions/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c similarity index 100% rename from jacobi/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c rename to jacobi_solutions/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c diff --git a/jacobi/mpi/Send_Recv_paired/src/tools.c b/jacobi_solutions/mpi/Send_Recv_paired/src/tools.c similarity index 100% rename from jacobi/mpi/Send_Recv_paired/src/tools.c rename to jacobi_solutions/mpi/Send_Recv_paired/src/tools.c diff --git a/jacobi/mpi/cartesian/Makefile b/jacobi_solutions/mpi/cartesian/Makefile similarity index 100% rename from jacobi/mpi/cartesian/Makefile rename to jacobi_solutions/mpi/cartesian/Makefile diff --git a/jacobi/mpi/cartesian/include/allvars.h b/jacobi_solutions/mpi/cartesian/include/allvars.h similarity index 100% rename from jacobi/mpi/cartesian/include/allvars.h rename to jacobi_solutions/mpi/cartesian/include/allvars.h diff --git a/jacobi/mpi/cartesian/include/tools.h b/jacobi_solutions/mpi/cartesian/include/tools.h similarity index 100% rename from jacobi/mpi/cartesian/include/tools.h rename to jacobi_solutions/mpi/cartesian/include/tools.h diff --git a/jacobi/mpi/cartesian/make.def b/jacobi_solutions/mpi/cartesian/make.def similarity index 100% rename from jacobi/mpi/cartesian/make.def rename to jacobi_solutions/mpi/cartesian/make.def diff --git a/jacobi/mpi/cartesian/make_mpi_path b/jacobi_solutions/mpi/cartesian/make_mpi_path similarity index 100% rename from jacobi/mpi/cartesian/make_mpi_path rename to jacobi_solutions/mpi/cartesian/make_mpi_path diff --git a/jacobi/mpi/cartesian/src/jacobi_2D_mpi_cartesian.c b/jacobi_solutions/mpi/cartesian/src/jacobi_2D_mpi_cartesian.c similarity index 100% rename from jacobi/mpi/cartesian/src/jacobi_2D_mpi_cartesian.c rename to jacobi_solutions/mpi/cartesian/src/jacobi_2D_mpi_cartesian.c diff --git a/jacobi/mpi/cartesian/src/tools.c b/jacobi_solutions/mpi/cartesian/src/tools.c similarity index 100% rename from jacobi/mpi/cartesian/src/tools.c rename to jacobi_solutions/mpi/cartesian/src/tools.c diff --git a/jacobi/mpi/comp_comm/Makefile b/jacobi_solutions/mpi/comp_comm/Makefile similarity index 100% rename from jacobi/mpi/comp_comm/Makefile rename to jacobi_solutions/mpi/comp_comm/Makefile diff --git a/jacobi/mpi/comp_comm/include/allvars.h b/jacobi_solutions/mpi/comp_comm/include/allvars.h similarity index 100% rename from jacobi/mpi/comp_comm/include/allvars.h rename to jacobi_solutions/mpi/comp_comm/include/allvars.h diff --git a/jacobi/mpi/comp_comm/include/tools.h b/jacobi_solutions/mpi/comp_comm/include/tools.h similarity index 100% rename from jacobi/mpi/comp_comm/include/tools.h rename to jacobi_solutions/mpi/comp_comm/include/tools.h diff --git a/jacobi/mpi/comp_comm/make.def b/jacobi_solutions/mpi/comp_comm/make.def similarity index 100% rename from jacobi/mpi/comp_comm/make.def rename to jacobi_solutions/mpi/comp_comm/make.def diff --git a/jacobi/mpi/comp_comm/make_mpi_path b/jacobi_solutions/mpi/comp_comm/make_mpi_path similarity index 100% rename from jacobi/mpi/comp_comm/make_mpi_path rename to jacobi_solutions/mpi/comp_comm/make_mpi_path diff --git a/jacobi/mpi/comp_comm/script/input_parameters b/jacobi_solutions/mpi/comp_comm/script/input_parameters similarity index 100% rename from jacobi/mpi/comp_comm/script/input_parameters rename to jacobi_solutions/mpi/comp_comm/script/input_parameters diff --git a/jacobi/mpi/comp_comm/script/run_pleiadi.sh b/jacobi_solutions/mpi/comp_comm/script/run_pleiadi.sh similarity index 100% rename from jacobi/mpi/comp_comm/script/run_pleiadi.sh rename to jacobi_solutions/mpi/comp_comm/script/run_pleiadi.sh diff --git a/jacobi/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c b/jacobi_solutions/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c similarity index 100% rename from jacobi/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c rename to jacobi_solutions/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c diff --git a/jacobi/mpi/comp_comm/src/tools.c b/jacobi_solutions/mpi/comp_comm/src/tools.c similarity index 100% rename from jacobi/mpi/comp_comm/src/tools.c rename to jacobi_solutions/mpi/comp_comm/src/tools.c diff --git a/jacobi/mpi/comp_comm_io/Makefile b/jacobi_solutions/mpi/comp_comm_io/Makefile similarity index 100% rename from jacobi/mpi/comp_comm_io/Makefile rename to jacobi_solutions/mpi/comp_comm_io/Makefile diff --git a/jacobi/mpi/comp_comm_io/include/allvars.h b/jacobi_solutions/mpi/comp_comm_io/include/allvars.h similarity index 100% rename from jacobi/mpi/comp_comm_io/include/allvars.h rename to jacobi_solutions/mpi/comp_comm_io/include/allvars.h diff --git a/jacobi/mpi/comp_comm_io/include/tools.h b/jacobi_solutions/mpi/comp_comm_io/include/tools.h similarity index 100% rename from jacobi/mpi/comp_comm_io/include/tools.h rename to jacobi_solutions/mpi/comp_comm_io/include/tools.h diff --git a/jacobi/mpi/comp_comm_io/make.def b/jacobi_solutions/mpi/comp_comm_io/make.def similarity index 100% rename from jacobi/mpi/comp_comm_io/make.def rename to jacobi_solutions/mpi/comp_comm_io/make.def diff --git a/jacobi/mpi/comp_comm_io/make_mpi_path b/jacobi_solutions/mpi/comp_comm_io/make_mpi_path similarity index 100% rename from jacobi/mpi/comp_comm_io/make_mpi_path rename to jacobi_solutions/mpi/comp_comm_io/make_mpi_path diff --git a/jacobi/mpi/comp_comm_io/script/input_parameters b/jacobi_solutions/mpi/comp_comm_io/script/input_parameters similarity index 100% rename from jacobi/mpi/comp_comm_io/script/input_parameters rename to jacobi_solutions/mpi/comp_comm_io/script/input_parameters diff --git a/jacobi/mpi/comp_comm_io/script/run_pleiadi.sh b/jacobi_solutions/mpi/comp_comm_io/script/run_pleiadi.sh similarity index 100% rename from jacobi/mpi/comp_comm_io/script/run_pleiadi.sh rename to jacobi_solutions/mpi/comp_comm_io/script/run_pleiadi.sh diff --git a/jacobi/mpi/comp_comm_io/src/jacobi_2D_mpi_comp_comm_io.c b/jacobi_solutions/mpi/comp_comm_io/src/jacobi_2D_mpi_comp_comm_io.c similarity index 100% rename from jacobi/mpi/comp_comm_io/src/jacobi_2D_mpi_comp_comm_io.c rename to jacobi_solutions/mpi/comp_comm_io/src/jacobi_2D_mpi_comp_comm_io.c diff --git a/jacobi/mpi/comp_comm_io/src/tools.c b/jacobi_solutions/mpi/comp_comm_io/src/tools.c similarity index 100% rename from jacobi/mpi/comp_comm_io/src/tools.c rename to jacobi_solutions/mpi/comp_comm_io/src/tools.c diff --git a/jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_1.cc b/jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_1.cc similarity index 100% rename from jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_1.cc rename to jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_1.cc diff --git a/jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_2.cc b/jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_2.cc similarity index 100% rename from jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_2.cc rename to jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Broadcast_2.cc diff --git a/jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Gather_Scatter.c b/jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Gather_Scatter.c similarity index 100% rename from jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Gather_Scatter.c rename to jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Gather_Scatter.c diff --git a/jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Heat_Equation_Gather.c b/jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Heat_Equation_Gather.c similarity index 100% rename from jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/Heat_Equation_Gather.c rename to jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/Heat_Equation_Gather.c diff --git a/jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/lecture_Broadcast_Gather_Scatter.pdf b/jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/lecture_Broadcast_Gather_Scatter.pdf similarity index 100% rename from jacobi/mpi/miscellaneous/Broadcast_Gather_Scatter/lecture_Broadcast_Gather_Scatter.pdf rename to jacobi_solutions/mpi/miscellaneous/Broadcast_Gather_Scatter/lecture_Broadcast_Gather_Scatter.pdf diff --git a/jacobi/mpi/miscellaneous/MPI_Datatypes/Subarray.c b/jacobi_solutions/mpi/miscellaneous/MPI_Datatypes/Subarray.c similarity index 100% rename from jacobi/mpi/miscellaneous/MPI_Datatypes/Subarray.c rename to jacobi_solutions/mpi/miscellaneous/MPI_Datatypes/Subarray.c diff --git a/jacobi/mpi/miscellaneous/MPI_Datatypes/lecture_MPI_Datatypes.pdf b/jacobi_solutions/mpi/miscellaneous/MPI_Datatypes/lecture_MPI_Datatypes.pdf similarity index 100% rename from jacobi/mpi/miscellaneous/MPI_Datatypes/lecture_MPI_Datatypes.pdf rename to jacobi_solutions/mpi/miscellaneous/MPI_Datatypes/lecture_MPI_Datatypes.pdf diff --git a/jacobi/mpi/miscellaneous/MPI_Datatypes/tools.c b/jacobi_solutions/mpi/miscellaneous/MPI_Datatypes/tools.c similarity index 100% rename from jacobi/mpi/miscellaneous/MPI_Datatypes/tools.c rename to jacobi_solutions/mpi/miscellaneous/MPI_Datatypes/tools.c diff --git a/jacobi/mpi/miscellaneous/Parallel_IO/lecture_Parallel_IO.pdf b/jacobi_solutions/mpi/miscellaneous/Parallel_IO/lecture_Parallel_IO.pdf similarity index 100% rename from jacobi/mpi/miscellaneous/Parallel_IO/lecture_Parallel_IO.pdf rename to jacobi_solutions/mpi/miscellaneous/Parallel_IO/lecture_Parallel_IO.pdf diff --git a/jacobi/mpi/miscellaneous/Parallel_IO/write_arr1D.c b/jacobi_solutions/mpi/miscellaneous/Parallel_IO/write_arr1D.c similarity index 100% rename from jacobi/mpi/miscellaneous/Parallel_IO/write_arr1D.c rename to jacobi_solutions/mpi/miscellaneous/Parallel_IO/write_arr1D.c diff --git a/jacobi/mpi/miscellaneous/Parallel_IO/write_arr2D.c b/jacobi_solutions/mpi/miscellaneous/Parallel_IO/write_arr2D.c similarity index 100% rename from jacobi/mpi/miscellaneous/Parallel_IO/write_arr2D.c rename to jacobi_solutions/mpi/miscellaneous/Parallel_IO/write_arr2D.c diff --git a/jacobi/mpi/miscellaneous/cartesian b/jacobi_solutions/mpi/miscellaneous/cartesian similarity index 100% rename from jacobi/mpi/miscellaneous/cartesian rename to jacobi_solutions/mpi/miscellaneous/cartesian diff --git a/jacobi/mpi/miscellaneous/cartesian.c b/jacobi_solutions/mpi/miscellaneous/cartesian.c similarity index 100% rename from jacobi/mpi/miscellaneous/cartesian.c rename to jacobi_solutions/mpi/miscellaneous/cartesian.c diff --git a/jacobi/mpi/miscellaneous/cartesian.cpp b/jacobi_solutions/mpi/miscellaneous/cartesian.cpp similarity index 100% rename from jacobi/mpi/miscellaneous/cartesian.cpp rename to jacobi_solutions/mpi/miscellaneous/cartesian.cpp diff --git a/jacobi/mpi/miscellaneous/color_ring.c b/jacobi_solutions/mpi/miscellaneous/color_ring.c similarity index 100% rename from jacobi/mpi/miscellaneous/color_ring.c rename to jacobi_solutions/mpi/miscellaneous/color_ring.c diff --git a/jacobi/mpi/miscellaneous/lecture_color_ring.pdf b/jacobi_solutions/mpi/miscellaneous/lecture_color_ring.pdf similarity index 100% rename from jacobi/mpi/miscellaneous/lecture_color_ring.pdf rename to jacobi_solutions/mpi/miscellaneous/lecture_color_ring.pdf diff --git a/jacobi/mpi/miscellaneous/subarray b/jacobi_solutions/mpi/miscellaneous/subarray similarity index 100% rename from jacobi/mpi/miscellaneous/subarray rename to jacobi_solutions/mpi/miscellaneous/subarray diff --git a/jacobi/mpi/miscellaneous/subarray.c b/jacobi_solutions/mpi/miscellaneous/subarray.c similarity index 100% rename from jacobi/mpi/miscellaneous/subarray.c rename to jacobi_solutions/mpi/miscellaneous/subarray.c diff --git a/jacobi/openmp/opt/Makefile b/jacobi_solutions/openmp/not_opt/Makefile similarity index 100% rename from jacobi/openmp/opt/Makefile rename to jacobi_solutions/openmp/not_opt/Makefile diff --git a/jacobi_solutions/openmp/not_opt/include/allvars.h b/jacobi_solutions/openmp/not_opt/include/allvars.h new file mode 100644 index 0000000000000000000000000000000000000000..6ffdbdae9e5b89a38a5dc6747bbd73edecb77ba3 --- /dev/null +++ b/jacobi_solutions/openmp/not_opt/include/allvars.h @@ -0,0 +1,20 @@ +#pragma once + +#define NGHOST 1 +#define NDIM 2 /* 2D */ +#define X 0 +#define Y 1 +#define TOL 1.e-5 + +typedef double MyData; + +#if defined(_OPENMP) + +#include <omp.h> + +#else + +#define omp_get_thread_num() 0 +#define omp_get_num_threads() 1 + +#endif /* _OPENMP */ diff --git a/jacobi/openmp/opt/include/tools.h b/jacobi_solutions/openmp/not_opt/include/tools.h similarity index 100% rename from jacobi/openmp/opt/include/tools.h rename to jacobi_solutions/openmp/not_opt/include/tools.h diff --git a/jacobi_solutions/openmp/not_opt/make.def b/jacobi_solutions/openmp/not_opt/make.def new file mode 100644 index 0000000000000000000000000000000000000000..83eb87773bcdeb6105d7b20b9fe10af919488d32 --- /dev/null +++ b/jacobi_solutions/openmp/not_opt/make.def @@ -0,0 +1,53 @@ +CC = gcc +CFLAGS = -Wall -Wextra -march=native +OMP = -fopenmp +LIBS = -lm + +SYSTYPE = $(strip $(shell uname -n)) + +PROG = jacobi_serial_not_opt_$(SYSTYPE) +PROG_OMP = jacobi_omp_not_opt_$(SYSTYPE) +PROG_DEBUG = $(PROG_OMP)_DEBUG +PROG_MEMCHECK = $(PROG_OMP)_MEMCHECK +PROG_CALLGRIND = $(PROG_OMP)_CALLGRIND +PROG_CACHEGRIND = $(PROG_OMP)_CACHEGRIND + +HEADERS = $(wildcard ./include/*.h) +SOURCES = $(wildcard ./src/*.c) +DEPENDENCIES = $(SOURCES) $(HEADERS) Makefile + +$(PROG): $(DEPENDENCIES) + $(CC) $(CFLAGS) -O3 -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_OMP): $(DEPENDENCIES) + $(CC) $(CFLAGS) -O3 $(OMP) -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_DEBUG): $(DEPENDENCIES) + $(CC) $(CFLAGS) -Og -ggdb3 $(OMP) -fno-omit-frame-pointer -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_MEMCHECK): $(DEPENDENCIES) + $(CC) $(CFLAGS) -Og $(OMP) -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_MEMCHECK) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_CALLGRIND): $(DEPENDENCIES) + $(CC) $(CFLAGS) -g -O3 $(OMP) -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_CALLGRIND) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_CACHEGRIND): $(DEPENDENCIES) + $(CC) $(CFLAGS) -g -O3 $(OMP) -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_CACHEGRIND) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' diff --git a/jacobi_solutions/openmp/not_opt/script/input_parameters b/jacobi_solutions/openmp/not_opt/script/input_parameters new file mode 100644 index 0000000000000000000000000000000000000000..c5fd600ce5a859f2aad58827976c8ca8e43ad69b --- /dev/null +++ b/jacobi_solutions/openmp/not_opt/script/input_parameters @@ -0,0 +1,9 @@ +########################################################################## + +# set the grid size + +GRID_SIZE_X=128 +GRID_SIZE_Y=128 + +OMP_THREADS=(1 2 4 8) +########################################################################## diff --git a/jacobi_solutions/openmp/not_opt/script/run.sh b/jacobi_solutions/openmp/not_opt/script/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..b0d90058f7a792f1d4a7a4cc30088a827833ccd2 --- /dev/null +++ b/jacobi_solutions/openmp/not_opt/script/run.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +######################### RESOURSE ALLOCATION ##################################### +#SBATCH --account=hpc_school +#SBATCH --partition=hpc_school +#SBATCH --job-name="Jacobi" +#SBATCH --nodes=1 +#SBATCH --ntasks-per-node=1 +#SBATCH --cpus-per-task=8 +#SBATCH --output=Jacobi-omp-no-opt-%j.out +#SBATCH --error=Jacobi-omp-no-opt.%j.err +#SBATCH --time=00:05:00 +################################################################################### + +################################## MODULES ######################################## +export MODULE_VERSION=5.0.1 +source /opt/cluster/spack/share/spack/setup-env.sh + +# module purge +module purge +# load GCC +module load default-gcc-11.2.0 +################################################################################### + +# input parameters +source input_parameters + +WORKDIR=${PWD} +# compile the application +cd .. && make clean && make omp +if [[ "$?" != "0" ]] +then + echo "Cannot compile the application ...aborting..." + exit 1 +fi + +# get the executable +EXEC=$(find $(realpath ./) -maxdepth 1 -executable -name "jacobi_*" -type f -print) +if [[ "$?" != "0" ]] +then + echo "Cannot find the executable ...aborting..." + exit 2 +fi + + +# OMP stuff +export OMP_DISPLAY_AFFINITY=1 +export OMP_WAIT_POLICY=ACTIVE +# export OMP_PLACES=( "cores", "threads" ) +# export BINDING=( "master" "close" "spread" ) + +for OMP in ${OMP_THREADS[@]} +do + # not necessary because the clause 'num_threads' + # is specified in the source code + # export OMP_NUM_THREADS=${OMP} + + # run the application + time ${EXEC} ${GRID_SIZE_X} ${GRID_SIZE_Y} ${OMP} |& tee ${EXEC}_OMP_${OMP}_output.txt +done +cd ${WORKDIR} + +exit 0 diff --git a/jacobi_solutions/openmp/not_opt/src/jacobi_2D_omp_not_opt.c b/jacobi_solutions/openmp/not_opt/src/jacobi_2D_omp_not_opt.c new file mode 100644 index 0000000000000000000000000000000000000000..a43c5bbcb2f75e956b8933784327773c9ce94e46 --- /dev/null +++ b/jacobi_solutions/openmp/not_opt/src/jacobi_2D_omp_not_opt.c @@ -0,0 +1,309 @@ +/* ///////////////////////////////////////////////////////////////////// */ +/* Authors: A. Mignone (mignone@to.infn.it) */ +/* V. Cesare (valentina.cesare@inaf.it) */ +/* D. Goz (david.goz@inaf.it) */ +/* */ +/* Date : June 2024 */ +/* */ +/* ///////////////////////////////////////////////////////////////////// */ + +#include "allvars.h" +#include "tools.h" +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + +/* function prototypes */ +void BoundaryConditions(MyData **const restrict, + MyData *const restrict, + MyData *const restrict, + const int, + const int); + +void JacobiAlgorithm(MyData **const restrict, MyData **const restrict, MyData *const restrict, + const MyData *const restrict, int, int, int, int, const int); + +void WriteSolution(MyData **const phi, const int nx, const int ny); + +void copy_grids(MyData **const restrict A, + MyData **const restrict B, + const int xbeg, + const int xend, + const int ybeg, + const int yend); + +int main(int argc, char **argv) +{ +#if defined(_OPENMP) + if (argc <= 3) + + { + printf("\n\t Usage: <executable> <x_grid_size> <y_grid_size> <omp threads>\n\n"); + exit(EXIT_FAILURE); + } +#else + if (argc <= 2) + { + printf("\n\t Usage: <executable> <x_grid_size> <y_grid_size>\n\n"); + exit(EXIT_FAILURE); + } +#endif /* _OPENMP */ + + /* global X and Y grid size */ + const int NX_GLOB = (int) strtol(argv[1], NULL, 10); + const int NY_GLOB = (int) strtol(argv[2], NULL, 10); +#if defined(_OPENMP) + const int Nthread = (int) strtol(argv[3], NULL, 10); +#else + const int Nthread = 1; +#endif /* _OPENMP */ + + const MyData xbeg = 0.0; + const MyData xend = 1.0; + const MyData ybeg = 0.0; + const MyData yend = 1.0; + + const MyData delta[NDIM] = {(xend - xbeg)/(NX_GLOB + 1), + (yend - ybeg)/(NY_GLOB + 1)}; + + /* -------------------------------------------------------- + 1. Set grid indices + -------------------------------------------------------- */ + + const int ibeg = NGHOST; + const int iend = ibeg + NX_GLOB - 1; + const int nx = iend - ibeg + 1; + const int nx_tot = nx + 2 * NGHOST; + + const int jbeg = NGHOST; + const int jend = jbeg + NY_GLOB - 1; + const int ny = jend - jbeg + 1; + const int ny_tot = ny + 2 * NGHOST; + + printf("\n\t Grid indices:"); + printf("\n\t\t ibeg, iend = %d, %d; nx_tot = %d" ,ibeg, iend, nx_tot); + printf("\n\t\t jbeg, jend = %d, %d; ny_tot = %d\n\n",jbeg, jend, ny_tot); + + /* -------------------------------------------------------- + 2. Generate grid, allocate memory + -------------------------------------------------------- */ + + /* memory allocation */ + MyData *xg = (MyData *) malloc((NX_GLOB + 2*NGHOST) * sizeof(MyData)); + MyData *yg = (MyData *) malloc((NY_GLOB + 2*NGHOST) * sizeof(MyData)); + assert((xg != NULL) && (yg != NULL)); + + /* initial conditions */ + for (int i=0 ; i<(NX_GLOB + 2*NGHOST) ; i++) xg[i] = xbeg + (i - ibeg + 1) * delta[X]; + for (int j=0 ; j<(NY_GLOB + 2*NGHOST) ; j++) yg[j] = ybeg + (j - jbeg + 1) * delta[Y]; + MyData *x = xg; /* Global and local grids are the same */ + MyData *y = yg; /* for serial version of the code */ + + /* grids memory allocation */ + MyData **phi = Allocate_2DdblArray(ny_tot, nx_tot); + MyData **phi0 = Allocate_2DdblArray(ny_tot, nx_tot); + + /* -------------------------------------------------------- + 3. Initialize solution array to 0 + -------------------------------------------------------- */ + + for (int j=jbeg ; j<=jend ; j++) + for (int i=ibeg ; i<=iend ; i++) + phi0[j][i] = 0.0; + + /* -------------------------------------------------------- + 4. Main iteration cycle + -------------------------------------------------------- */ + + const double time_start = seconds(); + + MyData err = 1.0; + /* iterations */ + int k = 0; + while (err > TOL) + { + /* -- 4a. Set boundary conditions first -- */ + + BoundaryConditions(phi0, x, y, nx, ny); + + /* -- 4b. Jacobi's method and residual (interior points) -- */ + /* core algorithm */ + + err = 0.0; + JacobiAlgorithm(phi, phi0, &err, delta, + ibeg, iend, jbeg, jend, Nthread); + + /* -- 4c. Copy grids --*/ + copy_grids(phi0, phi, + jbeg, jend, + ibeg, jend); + + printf ("\n\t Iteration = %d - err = %lg\n",k, err); + + /* increase the counter of loop iterations */ + k++; + } + + WriteSolution(phi, nx, ny); + + printf("\n\t NX_GLOB x NY_GLOB = %d x %d\n", NX_GLOB, NY_GLOB); + printf("\n\t Time = %lf [s]\n\n", seconds() - time_start); + + // free memory + if (phi0) + { + free(phi0[0]); + free(phi0); + } + + if (phi) + { + free(phi[0]); + free(phi); + } + + if (yg) + free(yg); + + if (xg) + free(xg); + + return 0; +} + +/* ********************************************************************* */ +void BoundaryConditions(MyData **const restrict phi, + MyData *const restrict x, + MyData *const restrict y, + const int nx, + const int ny) +/* +*********************************************************************** */ +{ + const int ibeg = NGHOST; + const int iend = ibeg + nx - 1; + + const int jbeg = NGHOST; + const int jend = jbeg + ny - 1; + + int i,j; + + /* -- Left -- */ + i = ibeg - 1; + for (int j=jbeg ; j<=jend ; j++) + phi[j][i] = (1.0 - y[j]); + + /* -- Right -- */ + i = jend + 1; + for (int j=jbeg ; j<=jend ; j++) + phi[j][i] = (y[j] * y[j]); + + /* -- Bottom -- */ + j = jbeg - 1; + for (int i=ibeg ; i<=iend ; i++) + phi[j][i] = (1.0 - x[i]); + + /* -- Top -- */ + j = jend + 1; + for (int i=ibeg ; i<=iend ; i++) + phi[j][i] = x[i]; + + return; +} + +/* ********************************************************************* */ + +void JacobiAlgorithm(MyData **const restrict Phi, + MyData **const restrict Phi0, + MyData *const restrict error, + const MyData *const restrict delta, + int ibeg, + int iend, + int jbeg, + int jend, + const int Nthreads) +{ + *error = 0.0; + +#pragma omp parallel default(none) shared(error, delta, Phi, Phi0) \ + firstprivate(ibeg, iend, jbeg, jend) \ + num_threads(Nthreads) + { +#if defined(DEBUG) + const int id = omp_get_thread_num(); + const int thr = omp_get_num_threads(); + printf("\n\t I am the omp thread %d out of %d", id, thr); + #pragma omp barrier +#endif /* DEBUG */ + + #pragma omp for schedule(static) + for (int j=jbeg ; j<=jend ; j++) + { + for (int i=ibeg ; i<=iend ; i++) + { + Phi[j][i] = 0.25 * (Phi0[j][i-1] + Phi0[j][i+1] + + Phi0[j-1][i] + Phi0[j+1][i]); + + #pragma omp critical + { + *error += delta[X] * delta[Y] * fabs(Phi[j][i] - Phi0[j][i]); + } + } /* loop over columns */ + } /* loop over rows */ + } /* omp parallel */ + + return; +} + +/* ********************************************************************* */ + +/* ********************************************************************* */ +void copy_grids(MyData **const restrict A, + MyData **const restrict B, + const int xbeg, + const int xend, + const int ybeg, + const int yend) +{ + for (int i=xbeg ; i<=xend ; i++) + for (int j=ybeg ; j<=yend ; j++) + A[i][j] = B[i][j]; + + return; +} +/* +************************************************************************ */ + + +/* ********************************************************************* */ +void WriteSolution (MyData **const phi, + const int nx, + const int ny) +/* +*********************************************************************** */ +{ + const int ibeg = NGHOST; + const int jbeg = NGHOST; + const int jend = jbeg + ny - 1; + + static int nfile = 0; /* File counter */ + + char fname[32]; +#if defined(_OPENMP) + sprintf(fname,"jacobi2D_omp_not_opt_%02d.bin", nfile); +#else + sprintf(fname,"jacobi2D_serial_not_opt_%02d.bin", nfile); +#endif /* _OPENMP */ + + FILE *fp; + printf ("> Writing %s\n",fname); + fp = fopen(fname, "wb"); + + for (int j=jbeg ; j<=jend ; j++) + { + fwrite (phi[j] + ibeg, sizeof(MyData), nx, fp); + } + + nfile++; + fclose(fp); +} diff --git a/jacobi/openmp/opt/src/tools.c b/jacobi_solutions/openmp/not_opt/src/tools.c similarity index 100% rename from jacobi/openmp/opt/src/tools.c rename to jacobi_solutions/openmp/not_opt/src/tools.c diff --git a/jacobi_solutions/openmp/opt/Makefile b/jacobi_solutions/openmp/opt/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..fc4833da0e6826ad3d36680ad49de5393c24039e --- /dev/null +++ b/jacobi_solutions/openmp/opt/Makefile @@ -0,0 +1,66 @@ +####################################################################### +# Author: David Goz (david.goz@inaf.it) # +# June 2024 # +####################################################################### +# +# To see all the compilation options +# $ make info +####################################################################### + +# make.def defines how the application is compiled +include make.def +####################################################################### + +.PHONY: info serial omp valgrind_memcheck valgrind_callgrind valgrind_cachegrind debug clean + +info: + @echo ' ' + @echo '--------------------------------------------------------------------------------------------' + @echo '$$ make serial ---> compile the serial application ' + @echo '$$ make omp ---> compile the omp application ' + @echo '$$ make debug ---> debug the omp application ' + @echo '$$ make valgrind_memcheck ---> run the omp application using Valgrind under Memcheck ' + @echo '$$ make valgrind_callgrind ---> run the omp application using Valgrind under Callgrind ' + @echo '$$ make valgrind_cachegrind ---> run the omp application using Valgrind under Cachegrind ' + @echo '$$ make clean ---> clean up all ' + @echo '$$ make info ---> get make info ' + @echo '--------------------------------------------------------------------------------------------' + @echo ' ' + +serial: $(PROG) + +omp: $(PROG_OMP) + +debug: $(PROG_DEBUG) + @echo 'OOOooo... debugging ...oooOOO' + gdb --args ./$< + @echo 'OOOooo... debugging ... oooOOO' + +valgrind_memcheck: $(PROG_MEMCHECK) + @echo 'oooOOO... valgrind_memcheck ...OOOooo' + valgrind --tool=memcheck -s --leak-check=full --show-leak-kinds=all --track-origins=yes --read-var-info=yes --log-file=valgrind_memcheck_log_%p.txt ./$< 10 10 2 + @echo 'oooOOO... valgrind_memcheck ...OOOooo' + +valgrind_callgrind: $(PROG_CALLGRIND) + @echo 'oooOOO... valgrind_callgrind ...OOOooo' + valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes --log-file=valgrind_callgrind_log_.%p.txt ./$< 128 128 2 + @echo ' ' + @echo 'To generate a function-by-function summary from the profile data file:' + @echo '$$ callgrind_annotate --auto=yes callgrind.out.<pid> | less' + @echo '(kcachegrind is required in order to visualize the output using the GUI)' + +valgrind_cachegrind: $(PROG_CACHEGRIND) + @echo 'oooOOO... valgrind_cachegrind ...OOOooo' + valgrind --tool=cachegrind --log-file=valgrind_cachegrind_log_.%p.txt ./$< 128 128 2 + @echo '$$ cg_annotate --auto=yes cachegrind.out.<pid> | less' + @echo '(kcachegrind is required in order to visualize the output using the GUI)' + @echo 'oooOOO... valgrind_cachegrind ...OOOooo' + +clean: + rm -f *~ .*~ ./src/*~ ./src/*# ./include/*~ ./include/*# *~ + rm -f $(PROG) $(PROG_OMP) $(PROG_DEBUG) $(PROG_MEMCHECK) $(PROG_CALLGRIND) $(PROG_CACHEGRIND) + rm -f valgrind_*.txt + rm -f cachegrind.out.* + rm -f callgrind.* + rm -f *bin + rm -f jacobi_* diff --git a/jacobi/openmp/opt/include/allvars.h b/jacobi_solutions/openmp/opt/include/allvars.h similarity index 100% rename from jacobi/openmp/opt/include/allvars.h rename to jacobi_solutions/openmp/opt/include/allvars.h diff --git a/jacobi/serial/opt/include/tools.h b/jacobi_solutions/openmp/opt/include/tools.h similarity index 100% rename from jacobi/serial/opt/include/tools.h rename to jacobi_solutions/openmp/opt/include/tools.h diff --git a/jacobi/openmp/opt/make.def b/jacobi_solutions/openmp/opt/make.def similarity index 100% rename from jacobi/openmp/opt/make.def rename to jacobi_solutions/openmp/opt/make.def diff --git a/jacobi/openmp/opt/src/jacobi_2D_omp_opt.c b/jacobi_solutions/openmp/opt/src/jacobi_2D_omp_opt.c similarity index 98% rename from jacobi/openmp/opt/src/jacobi_2D_omp_opt.c rename to jacobi_solutions/openmp/opt/src/jacobi_2D_omp_opt.c index 2a47ed64cf5b577ef13eb78610e14b7d3677d9eb..b1b84b4e2ca8be9068a7445a2684f8a2e4c29dac 100644 --- a/jacobi/openmp/opt/src/jacobi_2D_omp_opt.c +++ b/jacobi_solutions/openmp/opt/src/jacobi_2D_omp_opt.c @@ -244,9 +244,9 @@ void JacobiAlgorithm(MyData **const restrict Phi, /* ********************************************************************* */ /* ********************************************************************* */ -void WriteSolution (MyData **const phi, - const int nx, - const int ny) +void WriteSolution(MyData **const phi, + const int nx, + const int ny) /* *********************************************************************** */ { diff --git a/jacobi/serial/opt/src/tools.c b/jacobi_solutions/openmp/opt/src/tools.c similarity index 100% rename from jacobi/serial/opt/src/tools.c rename to jacobi_solutions/openmp/opt/src/tools.c diff --git a/jacobi_solutions/serial/not_opt/Makefile b/jacobi_solutions/serial/not_opt/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..191f891f79c02871d09e8960b75ea9a71d369c47 --- /dev/null +++ b/jacobi_solutions/serial/not_opt/Makefile @@ -0,0 +1,63 @@ +####################################################################### +# Author: David Goz (david.goz@inaf.it) # +# June 2024 # +####################################################################### +# +# To see all the compilation options +# $ make info +####################################################################### + +# make.def defines how the application is compiled +include make.def +####################################################################### + +.PHONY: info serial valgrind_memcheck valgrind_callgrind valgrind_cachegrind debug clean + +info: + @echo ' ' + @echo '-----------------------------------------------------------------------------------------------' + @echo '$$ make serial ---> compile the serial application ' + @echo '$$ make debug ---> debug the serial application ' + @echo '$$ make valgrind_memcheck ---> run the serial application using Valgrind under Memcheck ' + @echo '$$ make valgrind_callgrind ---> run the serial application using Valgrind under Callgrind ' + @echo '$$ make valgrind_cachegrind ---> run the serial application using Valgrind under Cachegrind ' + @echo '$$ make clean ---> clean up all ' + @echo '$$ make info ---> get make info ' + @echo '-----------------------------------------------------------------------------------------------' + @echo ' ' + +serial: $(PROG) + +debug: $(PROG_DEBUG) + @echo 'OOOooo... debugging ...oooOOO' + gdb --args ./$< + @echo 'OOOooo... debugging ... oooOOO' + +valgrind_memcheck: $(PROG_MEMCHECK) + @echo 'oooOOO... valgrind_memcheck ...OOOooo' + valgrind --tool=memcheck -s --leak-check=full --show-leak-kinds=all --track-origins=yes --read-var-info=yes --log-file=valgrind_memcheck_log_%p.txt ./$< 10 10 + @echo 'oooOOO... valgrind_memcheck ...OOOooo' + +valgrind_callgrind: $(PROG_CALLGRIND) + @echo 'oooOOO... valgrind_callgrind ...OOOooo' + valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes --log-file=valgrind_callgrind_log_.%p.txt ./$< 128 128 + @echo ' ' + @echo 'To generate a function-by-function summary from the profile data file:' + @echo '$$ callgrind_annotate --auto=yes callgrind.out.<pid> | less' + @echo '(kcachegrind is required in order to visualize the output using the GUI)' + +valgrind_cachegrind: $(PROG_CACHEGRIND) + @echo 'oooOOO... valgrind_cachegrind ...OOOooo' + valgrind --tool=cachegrind --log-file=valgrind_cachegrind_log_.%p.txt ./$< 128 128 + @echo '$$ cg_annotate --auto=yes cachegrind.out.<pid> | less' + @echo '(kcachegrind is required in order to visualize the output using the GUI)' + @echo 'oooOOO... valgrind_cachegrind ...OOOooo' + +clean: + rm -f *~ .*~ ./src/*~ ./src/*# ./include/*~ ./include/*# *~ + rm -f $(PROG) $(PROG_DEBUG) $(PROG_MEMCHECK) $(PROG_CALLGRIND) $(PROG_CACHEGRIND) + rm -f valgrind_*.txt + rm -f cachegrind.out.* + rm -f callgrind.* + rm -f *bin + rm -rf jacobi_serial_* diff --git a/jacobi/serial/opt/include/allvars.h b/jacobi_solutions/serial/not_opt/include/allvars.h similarity index 100% rename from jacobi/serial/opt/include/allvars.h rename to jacobi_solutions/serial/not_opt/include/allvars.h diff --git a/jacobi_solutions/serial/not_opt/include/tools.h b/jacobi_solutions/serial/not_opt/include/tools.h new file mode 100644 index 0000000000000000000000000000000000000000..82859ec511710474547355ede3fc38cf33a92154 --- /dev/null +++ b/jacobi_solutions/serial/not_opt/include/tools.h @@ -0,0 +1,18 @@ +#pragma once + +#include "allvars.h" +#include <assert.h> +#include <sys/time.h> +#include <time.h> +#include <sys/stat.h> +#include <stdio.h> +#include <stdlib.h> + +/* function prototypes */ +MyData **Allocate_2DdblArray(const int nx, const int ny); +void Show_2DdblArray(const MyData **const A, + const int nx, + const int ny, + const char *const string); + +double seconds(void); diff --git a/jacobi_solutions/serial/not_opt/make.def b/jacobi_solutions/serial/not_opt/make.def new file mode 100644 index 0000000000000000000000000000000000000000..54b8cd61e022ef81ece11e51ad0508ca0c17fc24 --- /dev/null +++ b/jacobi_solutions/serial/not_opt/make.def @@ -0,0 +1,45 @@ +CC = gcc +CFLAGS = -Wall -Wextra -march=native +LIBS = -lm + +SYSTYPE = $(strip $(shell uname -n)) + +PROG = jacobi_serial_not_opt_$(SYSTYPE) +PROG_DEBUG = $(PROG)_DEBUG +PROG_MEMCHECK = $(PROG)_MEMCHECK +PROG_CALLGRIND = $(PROG)_CALLGRIND +PROG_CACHEGRIND = $(PROG)_CACHEGRIND + +HEADERS = $(wildcard ./include/*.h) +SOURCES = $(wildcard ./src/*.c) +DEPENDENCIES = $(SOURCES) $(HEADERS) Makefile + +$(PROG): $(DEPENDENCIES) + $(CC) $(CFLAGS) -O3 -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_DEBUG): $(DEPENDENCIES) + $(CC) $(CFLAGS) -Og -ggdb3 -fno-omit-frame-pointer -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_MEMCHECK): $(DEPENDENCIES) + $(CC) $(CFLAGS) -Og -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_MEMCHECK) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_CALLGRIND): $(DEPENDENCIES) + $(CC) $(CFLAGS) -g -O3 -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_CALLGRIND) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' + +$(PROG_CACHEGRIND): $(DEPENDENCIES) + $(CC) $(CFLAGS) -g -O3 -I./include $(SOURCES) -o $@ $(LIBS) + @echo ' ' + @echo 'Program' $(PROG_CACHEGRIND) 'compiled for' $(SYSTYPE) 'machine' + @echo ' ' diff --git a/jacobi_solutions/serial/not_opt/script/input_parameters b/jacobi_solutions/serial/not_opt/script/input_parameters new file mode 100644 index 0000000000000000000000000000000000000000..06ef59f500860fd4ab1f6182938ae3029bf16e60 --- /dev/null +++ b/jacobi_solutions/serial/not_opt/script/input_parameters @@ -0,0 +1,8 @@ +########################################################################## + +# set the grid size + +GRID_SIZE_X=128 +GRID_SIZE_Y=128 + +########################################################################## diff --git a/jacobi_solutions/serial/not_opt/script/run.sh b/jacobi_solutions/serial/not_opt/script/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..e5d5d6955bc6a4be036797a7406d61d258085535 --- /dev/null +++ b/jacobi_solutions/serial/not_opt/script/run.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +######################### RESOURSE ALLOCATION ##################################### +#SBATCH --account=hpc_school +#SBATCH --partition=hpc_school +#SBATCH --job-name="Jacobi" +#SBATCH --nodes=1 +#SBATCH --cpus-per-task=1 +#SBATCH --output=Jacobi-serial-no-opt-%j.out +#SBATCH --error=Jacobi-serial-no-opt.%j.err +#SBATCH --time=00:05:00 +################################################################################### + +################################## MODULES ######################################## +export MODULE_VERSION=5.0.1 +source /opt/cluster/spack/share/spack/setup-env.sh + +# module purge +module purge +# load GCC +module load default-gcc-11.2.0 +# load valgrind (optional) +module load valgrind-3.18.1-gcc-11.2.0-3hcfkwk +################################################################################### + +# input parameters +source input_parameters + +WORKDIR=${PWD} +# compile the application +cd .. && make clean && make serial +if [[ "$?" != "0" ]] +then + echo "Cannot compile the application ...aborting..." + exit 1 +fi + +# get the executable +EXEC=$(find $(realpath ./) -maxdepth 1 -executable -name "jacobi_*" -type f -print) +if [[ "$?" != "0" ]] +then + echo "Cannot find the executable ...aborting..." + exit 2 +fi + + +# run +time ${EXEC} ${GRID_SIZE_X} ${GRID_SIZE_Y} |& tee ${EXEC}_output.txt + +cd ${WORKDIR} + +exit 0 diff --git a/jacobi_solutions/serial/not_opt/src/jacobi_2D_serial_not_opt.c b/jacobi_solutions/serial/not_opt/src/jacobi_2D_serial_not_opt.c new file mode 100644 index 0000000000000000000000000000000000000000..ba53f321242432290dca329fae94271189fadf82 --- /dev/null +++ b/jacobi_solutions/serial/not_opt/src/jacobi_2D_serial_not_opt.c @@ -0,0 +1,274 @@ +/* ///////////////////////////////////////////////////////////////////// */ +/* Authors: A. Mignone (mignone@to.infn.it) */ +/* V. Cesare (valentina.cesare@inaf.it) */ +/* D. Goz (david.goz@inaf.it) */ +/* */ +/* Date : June 2024 */ +/* */ +/* ///////////////////////////////////////////////////////////////////// */ + +#include "allvars.h" +#include "tools.h" +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + + +/* function prototypes */ +void BoundaryConditions(MyData **const restrict, + MyData *const restrict, + MyData *const restrict, + const int, + const int); + +void JacobiAlgorithm(MyData **const restrict, MyData **const restrict, MyData *const restrict, + const MyData *const restrict, const int, const int, const int, const int); + +void WriteSolution(MyData **const phi, const int nx, const int ny); + +void copy_grids(MyData **const restrict A, + MyData **const restrict B, + const int xbeg, + const int xend, + const int ybeg, + const int yend); + +int main(int argc, char **argv) +{ + if (argc <= 2) + { + printf("\n\t Usage: <executable> <x_grid_size> <y_grid_size> \n\n"); + exit(EXIT_FAILURE); + } + + /* global X and Y grid size */ + const int NX_GLOB = (int) strtol(argv[1], NULL, 10); + const int NY_GLOB = (int) strtol(argv[2], NULL, 10); + + const MyData xbeg = 0.0; + const MyData xend = 1.0; + const MyData ybeg = 0.0; + const MyData yend = 1.0; + + const MyData delta[NDIM] = {(xend - xbeg)/(NX_GLOB + 1), + (yend - ybeg)/(NY_GLOB + 1)}; + + /* -------------------------------------------------------- + 1. Set grid indices + -------------------------------------------------------- */ + + const int ibeg = NGHOST; + const int iend = ibeg + NX_GLOB - 1; + const int nx = iend - ibeg + 1; + const int nx_tot = nx + 2 * NGHOST; + + const int jbeg = NGHOST; + const int jend = jbeg + NY_GLOB - 1; + const int ny = jend - jbeg + 1; + const int ny_tot = ny + 2 * NGHOST; + + printf("\n\t Grid indices:"); + printf("\n\t\t ibeg, iend = %d, %d; nx_tot = %d" ,ibeg, iend, nx_tot); + printf("\n\t\t jbeg, jend = %d, %d; ny_tot = %d\n\n",jbeg, jend, ny_tot); + + /* -------------------------------------------------------- + 2. Generate grid, allocate memory + -------------------------------------------------------- */ + + /* memory allocation */ + MyData *xg = (MyData *) malloc((NX_GLOB + 2*NGHOST) * sizeof(MyData)); + MyData *yg = (MyData *) malloc((NY_GLOB + 2*NGHOST) * sizeof(MyData)); + assert((xg != NULL) && (yg != NULL)); + + /* initial conditions */ + for (int i=0 ; i<(NX_GLOB + 2*NGHOST) ; i++) xg[i] = xbeg + (i - ibeg + 1) * delta[X]; + for (int j=0 ; j<(NY_GLOB + 2*NGHOST) ; j++) yg[j] = ybeg + (j - jbeg + 1) * delta[Y]; + MyData *x = xg; /* Global and local grids are the same */ + MyData *y = yg; /* for serial version of the code */ + + /* grids memory allocation */ + MyData **phi = Allocate_2DdblArray(ny_tot, nx_tot); + MyData **phi0 = Allocate_2DdblArray(ny_tot, nx_tot); + + /* -------------------------------------------------------- + 3. Initialize solution array to 0 + -------------------------------------------------------- */ + + for (int j=jbeg ; j<=jend ; j++) + for (int i=ibeg ; i<=iend ; i++) + phi0[j][i] = 0.0; + + /* -------------------------------------------------------- + 4. Main iteration cycle + -------------------------------------------------------- */ + + const double time_start = seconds(); + + MyData err = 1.0; + /* iterations */ + int k = 0; + while (err > TOL) + { + /* -- 4a. Set boundary conditions first -- */ + + BoundaryConditions(phi0, x, y, nx, ny); + + /* -- 4b. Jacobi's method and residual (interior points) -- */ + /* core algorithm */ + + err = 0.0; + JacobiAlgorithm(phi, phi0, &err, delta, + ibeg, iend, jbeg, jend); + + /* -- 4c. Copy grids --*/ + copy_grids(phi0, phi, + jbeg, jend, + ibeg, jend); + + printf ("\n\t Iteration = %d - err = %lg\n",k, err); + + /* increase the counter of loop iterations */ + k++; + } + + WriteSolution(phi, nx, ny); + + printf("\n\t NX_GLOB x NY_GLOB = %d x %d\n", NX_GLOB, NY_GLOB); + printf("\n\t Time = %lf [s]\n\n", seconds() - time_start); + + // free memory + if (phi0) + { + free(phi0[0]); + free(phi0); + } + + if (phi) + { + free(phi[0]); + free(phi); + } + + if (yg) + free(yg); + + if (xg) + free(xg); + + return 0; +} + +/* ********************************************************************* */ +void BoundaryConditions(MyData **const restrict phi, + MyData *const restrict x, + MyData *const restrict y, + const int nx, + const int ny) +/* +*********************************************************************** */ +{ + const int ibeg = NGHOST; + const int iend = ibeg + nx - 1; + + const int jbeg = NGHOST; + const int jend = jbeg + ny - 1; + + int i,j; + + /* -- Left -- */ + i = ibeg - 1; + for (int j=jbeg ; j<=jend ; j++) + phi[j][i] = (1.0 - y[j]); + + /* -- Right -- */ + i = jend + 1; + for (int j=jbeg ; j<=jend ; j++) + phi[j][i] = (y[j] * y[j]); + + /* -- Bottom -- */ + j = jbeg - 1; + for (int i=ibeg ; i<=iend ; i++) + phi[j][i] = (1.0 - x[i]); + + /* -- Top -- */ + j = jend + 1; + for (int i=ibeg ; i<=iend ; i++) + phi[j][i] = x[i]; + + return; +} + +/* ********************************************************************* */ + +void JacobiAlgorithm(MyData **const restrict Phi, + MyData **const restrict Phi0, + MyData *const restrict error, + const MyData *const restrict delta, + const int ibeg, + const int iend, + const int jbeg, + const int jend) +{ + *error = 0.0; + for (int j=jbeg ; j<=jend ; j++) + { + for (int i=ibeg ; i<=iend ; i++) + { + Phi[j][i] = 0.25 * (Phi0[j][i-1] + Phi0[j][i+1] + + Phi0[j-1][i] + Phi0[j+1][i]); + + *error += delta[X] * delta[Y] * fabs(Phi[j][i] - Phi0[j][i]); + } /* loop over columns */ + } /* loop over rows */ + + return; +} + +/* ********************************************************************* */ + +/* ********************************************************************* */ +void copy_grids(MyData **const restrict A, + MyData **const restrict B, + const int xbeg, + const int xend, + const int ybeg, + const int yend) +{ + for (int i=xbeg ; i<=xend ; i++) + for (int j=ybeg ; j<=yend ; j++) + A[i][j] = B[i][j]; + + return; +} +/* +************************************************************************ */ + + +/* ********************************************************************* */ +void WriteSolution (MyData **const phi, + const int nx, + const int ny) +/* +*********************************************************************** */ +{ + const int ibeg = NGHOST; + const int jbeg = NGHOST; + const int jend = jbeg + ny - 1; + + static int nfile = 0; /* File counter */ + + char fname[32]; + sprintf(fname,"jacobi2D_serial_not_opt_%02d.bin", nfile); + + FILE *fp; + printf ("> Writing %s\n",fname); + fp = fopen(fname, "wb"); + + for (int j=jbeg ; j<=jend ; j++) + { + fwrite (phi[j] + ibeg, sizeof(MyData), nx, fp); + } + + nfile++; + fclose(fp); +} diff --git a/jacobi_solutions/serial/not_opt/src/tools.c b/jacobi_solutions/serial/not_opt/src/tools.c new file mode 100644 index 0000000000000000000000000000000000000000..be2761d170c23fde4d5d4aeda54af00e56abf3ce --- /dev/null +++ b/jacobi_solutions/serial/not_opt/src/tools.c @@ -0,0 +1,59 @@ +/* ///////////////////////////////////////////////////////////////////// */ +/* Authors: A. Mignone (mignone@to.infn.it) */ +/* V. Cesare (valentina.cesare@inaf.it) */ +/* D. Goz (david.goz@inaf.it) */ +/* */ +/* Date : June 2024 */ +/* */ +/* ///////////////////////////////////////////////////////////////////// */ + +#include "tools.h" + +/* ********************************************************************* */ +MyData **Allocate_2DdblArray(const int nx, const int ny) +/* + * Allocate memory for a double precision array with + * nx rows and ny columns + *********************************************************************** */ +{ + MyData **buf = malloc(nx * sizeof(MyData *)); + assert(buf != NULL); + + buf[0] = (MyData *) malloc(nx * ny * sizeof(MyData)); + assert(buf[0] != NULL); + + for (int j=1 ; j<nx ; j++) + buf[j] = buf[j-1] + ny; + + return buf; +} + +/* ********************************************************************* */ +void Show_2DdblArray(const MyData **const A, + const int nx, + const int ny, + const char *const string) +/* *********************************************************************** */ +{ + printf ("%s\n",string); + printf ("------------------------------\n"); + for (int i=0 ; i<nx ; i++) + { + for (int j=0 ; j<ny ; j++) + { + printf ("%8.2f ", A[i][j]); + } + printf ("\n"); + } + printf ("------------------------------\n"); +} +/* ********************************************************************* */ + +double seconds() +{ + struct timeval tmp; + gettimeofday(&tmp, (struct timezone *)0); + double sec = tmp.tv_sec + ((double)tmp.tv_usec)/1000000.0; + + return sec; +} diff --git a/jacobi/serial/opt/Makefile b/jacobi_solutions/serial/opt/Makefile similarity index 100% rename from jacobi/serial/opt/Makefile rename to jacobi_solutions/serial/opt/Makefile diff --git a/jacobi_solutions/serial/opt/include/allvars.h b/jacobi_solutions/serial/opt/include/allvars.h new file mode 100644 index 0000000000000000000000000000000000000000..468de4a19bebf2c0d5c59cd24ad3aab94b8df0f6 --- /dev/null +++ b/jacobi_solutions/serial/opt/include/allvars.h @@ -0,0 +1,9 @@ +#pragma once + +#define NGHOST 1 +#define NDIM 2 /* 2D */ +#define X 0 +#define Y 1 +#define TOL 1.e-5 + +typedef double MyData; diff --git a/jacobi_solutions/serial/opt/include/tools.h b/jacobi_solutions/serial/opt/include/tools.h new file mode 100644 index 0000000000000000000000000000000000000000..82859ec511710474547355ede3fc38cf33a92154 --- /dev/null +++ b/jacobi_solutions/serial/opt/include/tools.h @@ -0,0 +1,18 @@ +#pragma once + +#include "allvars.h" +#include <assert.h> +#include <sys/time.h> +#include <time.h> +#include <sys/stat.h> +#include <stdio.h> +#include <stdlib.h> + +/* function prototypes */ +MyData **Allocate_2DdblArray(const int nx, const int ny); +void Show_2DdblArray(const MyData **const A, + const int nx, + const int ny, + const char *const string); + +double seconds(void); diff --git a/jacobi/serial/opt/make.def b/jacobi_solutions/serial/opt/make.def similarity index 100% rename from jacobi/serial/opt/make.def rename to jacobi_solutions/serial/opt/make.def diff --git a/jacobi/serial/opt/src/jacobi_2D_serial_opt.c b/jacobi_solutions/serial/opt/src/jacobi_2D_serial_opt.c similarity index 100% rename from jacobi/serial/opt/src/jacobi_2D_serial_opt.c rename to jacobi_solutions/serial/opt/src/jacobi_2D_serial_opt.c diff --git a/jacobi_solutions/serial/opt/src/tools.c b/jacobi_solutions/serial/opt/src/tools.c new file mode 100644 index 0000000000000000000000000000000000000000..be2761d170c23fde4d5d4aeda54af00e56abf3ce --- /dev/null +++ b/jacobi_solutions/serial/opt/src/tools.c @@ -0,0 +1,59 @@ +/* ///////////////////////////////////////////////////////////////////// */ +/* Authors: A. Mignone (mignone@to.infn.it) */ +/* V. Cesare (valentina.cesare@inaf.it) */ +/* D. Goz (david.goz@inaf.it) */ +/* */ +/* Date : June 2024 */ +/* */ +/* ///////////////////////////////////////////////////////////////////// */ + +#include "tools.h" + +/* ********************************************************************* */ +MyData **Allocate_2DdblArray(const int nx, const int ny) +/* + * Allocate memory for a double precision array with + * nx rows and ny columns + *********************************************************************** */ +{ + MyData **buf = malloc(nx * sizeof(MyData *)); + assert(buf != NULL); + + buf[0] = (MyData *) malloc(nx * ny * sizeof(MyData)); + assert(buf[0] != NULL); + + for (int j=1 ; j<nx ; j++) + buf[j] = buf[j-1] + ny; + + return buf; +} + +/* ********************************************************************* */ +void Show_2DdblArray(const MyData **const A, + const int nx, + const int ny, + const char *const string) +/* *********************************************************************** */ +{ + printf ("%s\n",string); + printf ("------------------------------\n"); + for (int i=0 ; i<nx ; i++) + { + for (int j=0 ; j<ny ; j++) + { + printf ("%8.2f ", A[i][j]); + } + printf ("\n"); + } + printf ("------------------------------\n"); +} +/* ********************************************************************* */ + +double seconds() +{ + struct timeval tmp; + gettimeofday(&tmp, (struct timezone *)0); + double sec = tmp.tv_sec + ((double)tmp.tv_usec)/1000000.0; + + return sec; +} diff --git a/material/slides/INAF_HPC_course_hands-on_session_OpenMP.pdf b/material/slides/INAF_HPC_course_2024_hands-on_session_OpenMP.pdf similarity index 79% rename from material/slides/INAF_HPC_course_hands-on_session_OpenMP.pdf rename to material/slides/INAF_HPC_course_2024_hands-on_session_OpenMP.pdf index e55239651f5a01f40ca1fffc7cf24ef2d4c83981..6f3883674f4eb3e7bd39a4cd401e119aa8b0d1a9 100644 Binary files a/material/slides/INAF_HPC_course_hands-on_session_OpenMP.pdf and b/material/slides/INAF_HPC_course_2024_hands-on_session_OpenMP.pdf differ diff --git a/material/slides/INAF_HPC_course_hands-on_session_presentation.pdf b/material/slides/INAF_HPC_course_2024_hands-on_session_presentation.pdf similarity index 89% rename from material/slides/INAF_HPC_course_hands-on_session_presentation.pdf rename to material/slides/INAF_HPC_course_2024_hands-on_session_presentation.pdf index c4fcb149f80e5f5246499529f38bb7e714b074dd..5487794d8ce31860cf70f9aceee91921f0ff3a6b 100644 Binary files a/material/slides/INAF_HPC_course_hands-on_session_presentation.pdf and b/material/slides/INAF_HPC_course_2024_hands-on_session_presentation.pdf differ