Commit ec1c275b authored by David Goz's avatar David Goz 😴
Browse files

mpi Makefile bugfix

parent 2fb621e0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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 ' '
+13 −13
Original line number Diff line number Diff line
@@ -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;
+4 −1
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -16,3 +16,4 @@ void Show_2DdblArray(const MyData **const A,
                     const char *const    string);

double seconds(void);
Loading