diff --git a/jacobi/mpi/SendRecv/Makefile b/jacobi/mpi/SendRecv/Makefile index 4d38d38eabe9aa2bade6928c4395d23debcbd4e0..928007a35c8a7bcb7cb541ea555e785a4b810c87 100644 --- a/jacobi/mpi/SendRecv/Makefile +++ b/jacobi/mpi/SendRecv/Makefile @@ -12,12 +12,13 @@ include make.def include make_mpi_path ####################################################################### -.PHONY: info mpi valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean +.PHONY: info mpi debug valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean info: @echo ' ' @echo '-----------------------------------------------------------------------------------------' @echo '$$ make ---> compile the mpi application ' + @echo '$$ make debug ---> compile the mpi application for debugger ' @echo '$$ make valgrind_memcheck ---> run the mpi application using Valgrind under Memcheck ' @echo '$$ make valgrind_callgrind ---> run the mpi application using Valgrind under Callgrind ' @echo '$$ make valgrind_cachegrind ---> run the mpi application using Valgrind under Cachegrind ' @@ -28,6 +29,8 @@ info: mpi: $(PROG) +debug: $(PROG_DEBUG) + valgrind_memcheck: $(PROG_MEMCHECK) @echo 'oooOOO... valgrind_memcheck ...OOOooo' mpirun -n 2 valgrind --tool=memcheck -s --default-suppressions=yes --log-file=valgrind_memcheck_log_%p.txt ./$< 5 5 diff --git a/jacobi/mpi/SendRecv/make.def b/jacobi/mpi/SendRecv/make.def index 21f903d0773e74a9bb7cac39f1e98e4687617678..1934487afa11994e187c6ab4b93a2e55bc66497f 100644 --- a/jacobi/mpi/SendRecv/make.def +++ b/jacobi/mpi/SendRecv/make.def @@ -21,7 +21,7 @@ $(PROG): $(DEPENDENCIES) @echo ' ' $(PROG_DEBUG): $(DEPENDENCIES) - $(CC) $(CFLAGS) -Og -ggdb3 -fno-omit-frame-pointer -I./include I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) + $(CC) $(CFLAGS) -Og -ggdb3 -DDEBUG -fno-omit-frame-pointer -I./include -I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) @echo ' ' @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' @echo ' ' diff --git a/jacobi/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c b/jacobi/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c index 9c57bafb03ac4b795d242921ea13cb62fa36c956..2f4fe5b7ac524b54329ef5a7deac06d30784cd6d 100644 --- a/jacobi/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c +++ b/jacobi/mpi/SendRecv/src/jacobi_2D_mpi_sendrecv.c @@ -409,12 +409,12 @@ void get_domains(MyData **const buffer, { MPI_Status status; MPI_Recv((void *)&boundaries[task], sizeof(myDomain), MPI_BYTE, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } #if defined(DEBUG) printf("\n\t Diplacements[%d].start = %d - Diplacements[%d].end = %d", @@ -450,12 +450,12 @@ void get_domains(MyData **const buffer, const int nrows = (boundaries[task].end - boundaries[task].start + 1); const int elements = (nrows * (grid_dim + 2)); MPI_Recv((void *)&buffer[boundaries[task].start][0], elements, MPI_MyDatatype, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } } /* MASTER */ else if (task == rank) @@ -487,7 +487,7 @@ void WriteSolution(MyData **const phi, static int nfile = 0; /* File counter */ - char fname[32]; + char fname[128]; sprintf(fname,"jacobi2D_mpi_sendrecv_%02d.bin", nfile); FILE *fp; diff --git a/jacobi/mpi/Send_Recv_blocking/Makefile b/jacobi/mpi/Send_Recv_blocking/Makefile index 4d38d38eabe9aa2bade6928c4395d23debcbd4e0..5cac9115080bc7575b22b86c68344938428b8b35 100644 --- a/jacobi/mpi/Send_Recv_blocking/Makefile +++ b/jacobi/mpi/Send_Recv_blocking/Makefile @@ -12,12 +12,13 @@ include make.def include make_mpi_path ####################################################################### -.PHONY: info mpi valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean +.PHONY: info mpi debug valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean info: @echo ' ' @echo '-----------------------------------------------------------------------------------------' @echo '$$ make ---> compile the mpi application ' + @echo '$$ make debug ---> compile the mpi application for debugging ' @echo '$$ make valgrind_memcheck ---> run the mpi application using Valgrind under Memcheck ' @echo '$$ make valgrind_callgrind ---> run the mpi application using Valgrind under Callgrind ' @echo '$$ make valgrind_cachegrind ---> run the mpi application using Valgrind under Cachegrind ' @@ -28,6 +29,8 @@ info: mpi: $(PROG) +debug: $(PROG_DEBUG) + valgrind_memcheck: $(PROG_MEMCHECK) @echo 'oooOOO... valgrind_memcheck ...OOOooo' mpirun -n 2 valgrind --tool=memcheck -s --default-suppressions=yes --log-file=valgrind_memcheck_log_%p.txt ./$< 5 5 diff --git a/jacobi/mpi/Send_Recv_blocking/include/tools.h b/jacobi/mpi/Send_Recv_blocking/include/tools.h index 82859ec511710474547355ede3fc38cf33a92154..066ae344777161b1979234fbf4fa9eece99d03b5 100644 --- a/jacobi/mpi/Send_Recv_blocking/include/tools.h +++ b/jacobi/mpi/Send_Recv_blocking/include/tools.h @@ -16,3 +16,4 @@ void Show_2DdblArray(const MyData **const A, const char *const string); double seconds(void); + diff --git a/jacobi/mpi/Send_Recv_blocking/make.def b/jacobi/mpi/Send_Recv_blocking/make.def index 27810e9c27a0cb14d1f42186b83e983f3beea667..a1d8f2e091f054f8f9488e7db35bc7444a8586a1 100644 --- a/jacobi/mpi/Send_Recv_blocking/make.def +++ b/jacobi/mpi/Send_Recv_blocking/make.def @@ -21,7 +21,7 @@ $(PROG): $(DEPENDENCIES) @echo ' ' $(PROG_DEBUG): $(DEPENDENCIES) - $(CC) $(CFLAGS) -Og -ggdb3 -fno-omit-frame-pointer -I./include I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) + $(CC) $(CFLAGS) -DDEBUG -Og -ggdb3 -fno-omit-frame-pointer -I./include -I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) @echo ' ' @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' @echo ' ' diff --git a/jacobi/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c b/jacobi/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c index 936e6636aacf3925d610c11012c1122c13a476c4..f8263ae91ae95651278c7b8aa33f4ac7aca08f3c 100644 --- a/jacobi/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c +++ b/jacobi/mpi/Send_Recv_blocking/src/jacobi_2D_mpi_send_recv_blocking.c @@ -419,12 +419,12 @@ void get_domains(MyData **const buffer, { MPI_Status status; MPI_Recv((void *)&boundaries[task], sizeof(myDomain), MPI_BYTE, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } #if defined(DEBUG) printf("\n\t Diplacements[%d].start = %d - Diplacements[%d].end = %d", @@ -460,12 +460,12 @@ void get_domains(MyData **const buffer, const int nrows = (boundaries[task].end - boundaries[task].start + 1); const int elements = (nrows * (grid_dim + 2)); MPI_Recv((void *)&buffer[boundaries[task].start][0], elements, MPI_MyDatatype, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } } /* MASTER */ else if (task == rank) @@ -497,7 +497,7 @@ void WriteSolution(MyData **const phi, static int nfile = 0; /* File counter */ - char fname[32]; + char fname[128]; sprintf(fname,"jacobi2D_mpi_send_recv_blocking_%02d.bin", nfile); FILE *fp; diff --git a/jacobi/mpi/Send_Recv_nonblocking/Makefile b/jacobi/mpi/Send_Recv_nonblocking/Makefile index 4d38d38eabe9aa2bade6928c4395d23debcbd4e0..928007a35c8a7bcb7cb541ea555e785a4b810c87 100644 --- a/jacobi/mpi/Send_Recv_nonblocking/Makefile +++ b/jacobi/mpi/Send_Recv_nonblocking/Makefile @@ -12,12 +12,13 @@ include make.def include make_mpi_path ####################################################################### -.PHONY: info mpi valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean +.PHONY: info mpi debug valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean info: @echo ' ' @echo '-----------------------------------------------------------------------------------------' @echo '$$ make ---> compile the mpi application ' + @echo '$$ make debug ---> compile the mpi application for debugger ' @echo '$$ make valgrind_memcheck ---> run the mpi application using Valgrind under Memcheck ' @echo '$$ make valgrind_callgrind ---> run the mpi application using Valgrind under Callgrind ' @echo '$$ make valgrind_cachegrind ---> run the mpi application using Valgrind under Cachegrind ' @@ -28,6 +29,8 @@ info: mpi: $(PROG) +debug: $(PROG_DEBUG) + valgrind_memcheck: $(PROG_MEMCHECK) @echo 'oooOOO... valgrind_memcheck ...OOOooo' mpirun -n 2 valgrind --tool=memcheck -s --default-suppressions=yes --log-file=valgrind_memcheck_log_%p.txt ./$< 5 5 diff --git a/jacobi/mpi/Send_Recv_nonblocking/make.def b/jacobi/mpi/Send_Recv_nonblocking/make.def index 949ebfc52229ca2c73fa1cf642bc1b5219f8dd3b..32c14969a5569eba96c0668a25ae0568588429d6 100644 --- a/jacobi/mpi/Send_Recv_nonblocking/make.def +++ b/jacobi/mpi/Send_Recv_nonblocking/make.def @@ -21,7 +21,7 @@ $(PROG): $(DEPENDENCIES) @echo ' ' $(PROG_DEBUG): $(DEPENDENCIES) - $(CC) $(CFLAGS) -Og -ggdb3 -fno-omit-frame-pointer -I./include I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) + $(CC) $(CFLAGS) -Og -ggdb3 -DDEBUG -fno-omit-frame-pointer -I./include -I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) @echo ' ' @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' @echo ' ' diff --git a/jacobi/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c b/jacobi/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c index 8add90d0298826b835d88f10ff2c55518fa37960..a03e8cbec82eb87767a0290ffe84e97dc7997791 100644 --- a/jacobi/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c +++ b/jacobi/mpi/Send_Recv_nonblocking/src/jacobi_2D_mpi_send_recv_nonblocking.c @@ -426,12 +426,12 @@ void get_domains(MyData **const buffer, { MPI_Status status; MPI_Recv((void *)&boundaries[task], sizeof(myDomain), MPI_BYTE, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } #if defined(DEBUG) printf("\n\t Diplacements[%d].start = %d - Diplacements[%d].end = %d", @@ -467,12 +467,12 @@ void get_domains(MyData **const buffer, const int nrows = (boundaries[task].end - boundaries[task].start + 1); const int elements = (nrows * (grid_dim + 2)); MPI_Recv((void *)&buffer[boundaries[task].start][0], elements, MPI_MyDatatype, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } } /* MASTER */ else if (task == rank) diff --git a/jacobi/mpi/Send_Recv_paired/Makefile b/jacobi/mpi/Send_Recv_paired/Makefile index 4d38d38eabe9aa2bade6928c4395d23debcbd4e0..928007a35c8a7bcb7cb541ea555e785a4b810c87 100644 --- a/jacobi/mpi/Send_Recv_paired/Makefile +++ b/jacobi/mpi/Send_Recv_paired/Makefile @@ -12,12 +12,13 @@ include make.def include make_mpi_path ####################################################################### -.PHONY: info mpi valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean +.PHONY: info mpi debug valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean info: @echo ' ' @echo '-----------------------------------------------------------------------------------------' @echo '$$ make ---> compile the mpi application ' + @echo '$$ make debug ---> compile the mpi application for debugger ' @echo '$$ make valgrind_memcheck ---> run the mpi application using Valgrind under Memcheck ' @echo '$$ make valgrind_callgrind ---> run the mpi application using Valgrind under Callgrind ' @echo '$$ make valgrind_cachegrind ---> run the mpi application using Valgrind under Cachegrind ' @@ -28,6 +29,8 @@ info: mpi: $(PROG) +debug: $(PROG_DEBUG) + valgrind_memcheck: $(PROG_MEMCHECK) @echo 'oooOOO... valgrind_memcheck ...OOOooo' mpirun -n 2 valgrind --tool=memcheck -s --default-suppressions=yes --log-file=valgrind_memcheck_log_%p.txt ./$< 5 5 diff --git a/jacobi/mpi/Send_Recv_paired/make.def b/jacobi/mpi/Send_Recv_paired/make.def index 3a66a18bfeab4440599ee89539e658d9a376dbf6..41e5d7b17cd6a8c4188c44116e31a20b1df993a3 100644 --- a/jacobi/mpi/Send_Recv_paired/make.def +++ b/jacobi/mpi/Send_Recv_paired/make.def @@ -21,7 +21,7 @@ $(PROG): $(DEPENDENCIES) @echo ' ' $(PROG_DEBUG): $(DEPENDENCIES) - $(CC) $(CFLAGS) -Og -ggdb3 -fno-omit-frame-pointer -I./include I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) + $(CC) $(CFLAGS) -Og -ggdb3 -DDEBUG -fno-omit-frame-pointer -I./include -I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) @echo ' ' @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' @echo ' ' diff --git a/jacobi/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c b/jacobi/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c index c78c890e39e8738b54a6d54025b607eefd24b3f5..5218815c647a4197edba19b11caa6b537b0575e7 100644 --- a/jacobi/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c +++ b/jacobi/mpi/Send_Recv_paired/src/jacobi_2D_mpi_send_recv_paired.c @@ -441,12 +441,12 @@ void get_domains(MyData **const buffer, { MPI_Status status; MPI_Recv((void *)&boundaries[task], sizeof(myDomain), MPI_BYTE, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } #if defined(DEBUG) printf("\n\t Diplacements[%d].start = %d - Diplacements[%d].end = %d", @@ -482,12 +482,12 @@ void get_domains(MyData **const buffer, const int nrows = (boundaries[task].end - boundaries[task].start + 1); const int elements = (nrows * (grid_dim + 2)); MPI_Recv((void *)&buffer[boundaries[task].start][0], elements, MPI_MyDatatype, task, 0, comm, &status); - if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) - { - free(boundaries); - MPI_Abort(comm, EXIT_FAILURE); - exit(EXIT_FAILURE); - } + /* if ((status.MPI_ERROR != MPI_SUCCESS) || (status.MPI_SOURCE != task)) */ + /* { */ + /* free(boundaries); */ + /* MPI_Abort(comm, EXIT_FAILURE); */ + /* exit(EXIT_FAILURE); */ + /* } */ } } /* MASTER */ else if (task == rank) @@ -519,7 +519,7 @@ void WriteSolution(MyData **const phi, static int nfile = 0; /* File counter */ - char fname[32]; + char fname[128]; sprintf(fname,"jacobi2D_mpi_send_recv_paired_%02d.bin", nfile); FILE *fp; diff --git a/jacobi/mpi/cartesian/Makefile b/jacobi/mpi/cartesian/Makefile index 02695b48106ca217759865cd3708f7ffe738fb1c..cf2b7db1591e480d0ebc4451bbbfc7cc074b0f7f 100644 --- a/jacobi/mpi/cartesian/Makefile +++ b/jacobi/mpi/cartesian/Makefile @@ -12,12 +12,13 @@ include make.def include make_mpi_path ####################################################################### -.PHONY: info mpi valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean +.PHONY: info mpi debug valgrind_memcheck valgrind_callgrind valgrind_cachegrind clean info: @echo ' ' @echo '-----------------------------------------------------------------------------------------' @echo '$$ make ---> compile the mpi application ' + @echo '$$ make debug ---> compile the mpi application for debugger ' @echo '$$ make valgrind_memcheck ---> run the mpi application using Valgrind under Memcheck ' @echo '$$ make valgrind_callgrind ---> run the mpi application using Valgrind under Callgrind ' @echo '$$ make valgrind_cachegrind ---> run the mpi application using Valgrind under Cachegrind ' @@ -28,6 +29,8 @@ info: mpi: $(PROG) +debug: $(PROG_DEBUG) + valgrind_memcheck: $(PROG_MEMCHECK) @echo 'oooOOO... valgrind_memcheck ...OOOooo' mpirun -n 4 valgrind --tool=memcheck -s --default-suppressions=yes --log-file=valgrind_memcheck_log_%p.txt ./$< 9 2 diff --git a/jacobi/mpi/cartesian/make.def b/jacobi/mpi/cartesian/make.def index 9b011868551a84d967d65b3d5b9ab4cab794e61e..bafed56c0a0770db6a60fdeff9eafa2a6d5c23b1 100644 --- a/jacobi/mpi/cartesian/make.def +++ b/jacobi/mpi/cartesian/make.def @@ -21,7 +21,7 @@ $(PROG): $(DEPENDENCIES) @echo ' ' $(PROG_DEBUG): $(DEPENDENCIES) - $(CC) $(CFLAGS) -Og -ggdb3 -fno-omit-frame-pointer -I./include I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) + $(CC) $(CFLAGS) -Og -ggdb3 -DDEBUG -fno-omit-frame-pointer -I./include -I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) @echo ' ' @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' @echo ' ' diff --git a/jacobi/mpi/comp_comm/make.def b/jacobi/mpi/comp_comm/make.def index bacfcdd742d7ad4c5218cbae543f6913dd0de953..02fee4d5716a8732e0b630c23205b6174dc688be 100644 --- a/jacobi/mpi/comp_comm/make.def +++ b/jacobi/mpi/comp_comm/make.def @@ -21,7 +21,7 @@ $(PROG): $(DEPENDENCIES) @echo ' ' $(PROG_DEBUG): $(DEPENDENCIES) - $(CC) $(CFLAGS) -Og -ggdb3 -fno-omit-frame-pointer -I./include -I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) + $(CC) $(CFLAGS) -Og -ggdb3 -DDEBUG -fno-omit-frame-pointer -I./include -I$(MPI_INC) $(SOURCES) -o $@ -L$(MPI_LIB) $(LIBS) @echo ' ' @echo 'Program' $(PROG_DEBUG) 'compiled for' $(SYSTYPE) 'machine' @echo ' ' diff --git a/jacobi/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c b/jacobi/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c index bbd6ffb5fe289c68011bf62e2966a1b38b62e8d2..0a9dc72c30b88a2e40188ab0355967e93f24b80b 100644 --- a/jacobi/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c +++ b/jacobi/mpi/comp_comm/src/jacobi_2D_mpi_comp_comm.c @@ -14,8 +14,6 @@ #include <math.h> #include <string.h> -#define DEBUG - static int NX_GLOB, NY_GLOB; MyData **global_phi; @@ -112,8 +110,6 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - - /* get the comm size */ MPI_Comm_size(ThisTask.comm2d, &ThisTask.nranks); @@ -476,98 +472,40 @@ void Jacobi_Communication(MyData **const restrict Phi, const int jend = ThisTask->domain.local_end[X] - 1; const int ibeg = ThisTask->domain.local_start[Y] + 1; const int iend = ThisTask->domain.local_end[Y] - 1; - -#if defined(DEBUG) + /* wait the data on the boundaries */ MPI_Waitall(8, request, MPI_STATUSES_IGNORE); - + *error = 0.0; /* JacobiAlgorithm(Phi, Phi0, delta, jbeg, jend, ibeg, iend, error); */ - JacobiAlgorithm(Phi, Phi0, delta, - ThisTask->domain.local_start[X]+1, ThisTask->domain.local_end[X]-1, - ThisTask->domain.local_start[Y] , ThisTask->domain.local_end[Y], - error); - - /* /\* data from nbrbottom have been received *\/ */ - JacobiAlgorithm(Phi, Phi0, delta, - ThisTask->domain.local_start[X], ThisTask->domain.local_start[X], - ThisTask->domain.local_start[Y], ThisTask->domain.local_end[Y], - error); - - /* /\* data from nbrtop have been received *\/ */ - JacobiAlgorithm(Phi, Phi0, delta, - ThisTask->domain.local_end[X], ThisTask->domain.local_end[X], - ThisTask->domain.local_start[Y], ThisTask->domain.local_end[Y], - error); - - /* /\* data from nbrleft have been received *\/ */ + JacobiAlgorithm(Phi, Phi0, delta, jbeg-1, jend+1, ibeg-1, iend+1, error); + + /* /\* wait the data on the boundaries *\/ */ + /* MPI_Waitall(8, request, MPI_STATUSES_IGNORE); */ + + /* /\* nbrbottom *\/ */ + /* JacobiAlgorithm(Phi, Phi0, delta, */ + /* ThisTask->domain.local_start[X], ThisTask->domain.local_start[X], */ + /* ThisTask->domain.local_start[Y], ThisTask->domain.local_end[Y], */ + /* error); */ + + /* /\* nbrtop *\/ */ + /* JacobiAlgorithm(Phi, Phi0, delta, */ + /* ThisTask->domain.local_end[X], ThisTask->domain.local_end[X], */ + /* ThisTask->domain.local_start[Y], ThisTask->domain.local_end[Y], */ + /* error); */ + + /* /\* nbrleft *\/ */ /* JacobiAlgorithm(Phi, Phi0, delta, */ /* ThisTask->domain.local_start[X], ThisTask->domain.local_end[X], */ /* ThisTask->domain.local_start[Y], ThisTask->domain.local_start[Y], */ /* error); */ - /* /\* data from nbrright have been received *\/ */ + /* /\* nbrright *\/ */ /* JacobiAlgorithm(Phi, Phi0, delta, */ /* ThisTask->domain.local_start[X], ThisTask->domain.local_end[X], */ /* ThisTask->domain.local_end[Y], ThisTask->domain.local_end[Y], */ /* error); */ - -#else - - /**********************************************************************************************/ - - *error = 0.0; - JacobiAlgorithm(Phi, Phi0, delta, jbeg, jend, ibeg, iend, error); - - /* waits for any specified MPI Request to complete */ - for (int req=0 ; req<8 ; req++) - { - int idx; - MPI_Status status; - - MPI_Waitany(8, request, &idx, &status); - - switch(status.MPI_TAG) - { - /* communication with tag 0 completed */ - case 0: - /* data from nbrbottom have been received */ - JacobiAlgorithm(Phi, Phi0, delta, - ThisTask->domain.local_start[X], ThisTask->domain.local_start[X], - ThisTask->domain.local_start[Y], ThisTask->domain.local_end[Y], - error); - break; - - /* communication with tag 1 completed */ - case 1: - /* data from nbrtop have been received */ - JacobiAlgorithm(Phi, Phi0, delta, - ThisTask->domain.local_end[X], ThisTask->domain.local_end[X], - ThisTask->domain.local_start[Y], ThisTask->domain.local_end[Y], - error); - break; - - /* communication with tag 2 completed */ - case 2: - /* data from nbrleft have been received */ - JacobiAlgorithm(Phi, Phi0, delta, - ThisTask->domain.local_start[X], ThisTask->domain.local_end[X], - ThisTask->domain.local_start[Y], ThisTask->domain.local_start[Y], - error); - break; - - /* communication with tag 3 completed */ - case 3: - /* data from nbrright have been received */ - JacobiAlgorithm(Phi, Phi0, delta, - ThisTask->domain.local_start[X], ThisTask->domain.local_end[X], - ThisTask->domain.local_end[Y], ThisTask->domain.local_end[Y], - error); - break; - } - } - -#endif /* DEBUG */ MPI_Type_free(&column);