Commit b69a1d1c authored by Emanuele De Rubeis's avatar Emanuele De Rubeis
Browse files

General updates on the code, remove PARALLELIO

parent 5636a3d7
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -52,9 +52,6 @@ OPT += -DPHASE_ON
# Support CFITSIO !!! Remember to add the path to the CFITSIO library to LD_LIBRARY_PATH
#OPT += -DFITSIO

# Perform true parallel images writing
OPT += -DPARALLELIO

# Normalize uvw in case it is not done in the binMS
#OPT += -DNORMALIZE_UVW

@@ -74,13 +71,13 @@ OPT += -DGAUSS
#OPT += -DNVIDIA

#use cuda for GPUs
OPT += -DCUDACC
#OPT += -DCUDACC

# use GPU acceleration via OMP 
#OPT += -DACCOMP

# perform stacking on GPUs
OPT += -DGPU_STACKING
#OPT += -DGPU_STACKING

# use NVIDIA GPU to perform the reduce
#OPT += -DNCCL_REDUCE
@@ -89,7 +86,7 @@ OPT += -DGPU_STACKING
#OPT += -DRCCL_REDUCE

# use GPU to perform FFT
OPT += -DCUFFTMP
#OPT += -DCUFFTMP

#support for AMD GPUs
#OPT += __HIP_PLATFORM_AMD__
+9 −40
Original line number Diff line number Diff line
@@ -280,41 +280,12 @@ void write_fftw_data(){
  fits_write_subset(fptrimg, TDOUBLE, fpixel, lpixel, image_imag, &status);
  fits_close_file(fptrimg, &status);

 #endif //FITSIO

  for (int isector=0; isector<size; isector++)
    {

      MPI_Barrier(MPI_COMM_WORLD);
      
      if(isector == rank)
	{

	  printf("%d writing\n",isector);

	 #ifdef FITSIO

	  fpixel[0] = 1;
	  fpixel[1] = isector*yaxis+1;
	  lpixel[0] = xaxis;
	  lpixel[1] = (isector+1)*yaxis;

	  status = 0;
	  fits_open_image(&fptreal, testfitsreal, READWRITE, &status);
	  fits_write_subset(fptreal, TDOUBLE, fpixel, lpixel, image_real, &status);
	  fits_close_file(fptreal, &status);

	  status = 0;
	  fits_open_image(&fptrimg, testfitsimag, READWRITE, &status);
	  fits_write_subset(fptrimg, TDOUBLE, fpixel, lpixel, image_imag, &status);
	  fits_close_file(fptrimg, &status);

 #endif //FITSIO

  file.pFilereal = fopen (out.fftfile2,"ab");
  file.pFileimg = fopen (out.fftfile3,"ab");

	  uint global_index = isector*(xaxis*yaxis)*sizeof(double);
  uint global_index = rank*(xaxis*yaxis)*sizeof(double);

  fseek(file.pFilereal, global_index, SEEK_SET);
  fwrite(image_real, xaxis*yaxis, sizeof(double), file.pFilereal);
@@ -323,8 +294,6 @@ void write_fftw_data(){

  fclose(file.pFilereal);
  fclose(file.pFileimg);
	}
    }
 
  MPI_Barrier(MPI_COMM_WORLD);

+13 −2
Original line number Diff line number Diff line
@@ -70,8 +70,19 @@ int main(int argc, char * argv[])
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Comm_size(MPI_COMM_WORLD, &size);
  if(rank == 0)
    printf("Runn ing with %d MPI tasks\n", size);
  {
    printf("\n");
    printf("RRR   III   CCCC  K   K\n");
    printf("R  R   I   C      K  K \n");
    printf("RRR    I   C      KK   \n");
    printf("R  R   I   C      K  K \n");
    printf("R   R III   CCCC  K   K\n");
    printf("\n");
    printf("Radio Imaging Code Kernels (v2.0.0)\n");
    printf("\n");

    printf("Running with %d MPI tasks\n", size);
  }
  MPI_Comm_dup(MPI_COMM_WORLD, &MYMPI_COMM_WORLD);

  FFT_INIT;