From 7c9b628fc75bcdc29f5721176ddcb707c3c7b00b Mon Sep 17 00:00:00 2001 From: JOAN VINYALS YLLA CATALA Date: Fri, 30 Sep 2022 14:47:53 +0200 Subject: [PATCH 1/2] Creates PILS version with several TALP regions This commit will modify the pils.c to include a compilation option that creates several TALP regions, that are started at the begining of the execution and stoped at the end. It will also adapt the Makefile to include the compilation option for this new version. Signed-off-by: JOAN VINYALS YLLA CATALA --- Makefile | 3 +++ pils.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3f23057..897f69b 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,9 @@ pils: pils.c pils_regions: pils.c $(MPICC) $^ -o $@ $(DLB_FLAGS) -DTALP_REGIONS +pils_several_regions: pils.c + $(MPICC) $^ -o $@ $(DLB_FLAGS) -DTALP_SEVERAL_REGIONS=30 + .PHONY: clean clean: rm -f pils pils_regions diff --git a/pils.c b/pils.c index 2a8bffe..ea9491c 100644 --- a/pils.c +++ b/pils.c @@ -26,7 +26,11 @@ #include #include -#if TALP_REGIONS +#if defined(TALP_REGIONS) && defined(TALP_SEVERAL_REGIONS) +#error TALP_REGIONS and TALP_SEVERAL_REGIONS are incompatible +#endif + +#if defined(TALP_REGIONS) || defined(TALP_SEVERAL_REGIONS) #include #endif @@ -226,6 +230,16 @@ int main(int argc, char* argv[]) { dlb_monitor_t *region = DLB_MonitoringRegionRegister(NULL); #endif +#ifdef TALP_SEVERAL_REGIONS + dlb_monitor_t *region[TALP_SEVERAL_REGIONS]; + { + int i = 0; + for (i = 0; i < TALP_SEVERAL_REGIONS; i++) { + region[i] = DLB_MonitoringRegionRegister(NULL); + DLB_MonitoringRegionStart(region[i]); + } + } +#endif /***********************************************************************/ /************** MAIN LOOP **********************************************/ int k; @@ -260,6 +274,15 @@ int main(int argc, char* argv[]) { MPI_Allreduce(&iter_time, &final_time, 1, MPI_DOUBLE , MPI_SUM, MPI_COMM_WORLD); } +#ifdef TALP_SEVERAL_REGIONS + dlb_monitor_t *region[TALP_SEVERAL_REGIONS]; + { + int i = 0; + for (i = 0; i < TALP_SEVERAL_REGIONS; i++) { + DLB_MonitoringRegionStop(region[i]); + } +#endif + if (mpi_rank == 0) printf("Total time: %6.3f\n", final_time); // Application elapsed time @@ -271,6 +294,10 @@ int main(int argc, char* argv[]) { printf("\nApplication time = %.4f \n", app_time); } + } + } +#endif + MPI_Finalize(); free(loads); -- GitLab From 7fdc01d0d53a690370d9536e4f1fab9db30224e1 Mon Sep 17 00:00:00 2001 From: JOAN VINYALS YLLA CATALA Date: Fri, 30 Sep 2022 14:53:42 +0200 Subject: [PATCH 2/2] Adds parametrization in the Makefile This commit will modify the Makefile to include parametrization to the compilation option for several TALP regions. So that the number of regions can be decided from the command line. Signed-off-by: JOAN VINYALS YLLA CATALA --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 897f69b..e88c886 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ MPICC = /apps/INTEL/2017.4/impi/2017.3.196/bin64/mpicc DLB_FLAGS = -I$(DLB_HOME)/include -L$(DLB_HOME)/lib -ldlb -Wl,-rpath,$(DLB_HOME)/lib +TALP_NUM_REGIONS ?= 30 + all: pils pils_regions pils: pils.c @@ -30,7 +32,7 @@ pils_regions: pils.c $(MPICC) $^ -o $@ $(DLB_FLAGS) -DTALP_REGIONS pils_several_regions: pils.c - $(MPICC) $^ -o $@ $(DLB_FLAGS) -DTALP_SEVERAL_REGIONS=30 + $(MPICC) $^ -o $@ $(DLB_FLAGS) -DTALP_SEVERAL_REGIONS=$(TALP_NUM_REGIONS) .PHONY: clean clean: -- GitLab