diff --git a/Makefile b/Makefile index 472d5ff77509dbf2447fd2fd905b0c8c295f5e08..928bb596a7ba2d83fb31628a1fe0ce0dd5192b78 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ OPT += -DPHASE_ON # Support CFITSIO OPT += -DFITSIO # Perform true parallel fits writing -OPT += -DPARALLEL_FITS +OPT += -DPARALLELIO ifeq (FITSIO,$(findstring FITSIO,$(OPT))) LIBS += -L$(FITSIO_LIB) -lcfitsio diff --git a/w-stacking-fftw.c b/w-stacking-fftw.c index 2fe8a6f45f7a153da22e5dadc04f1352039c1090..93e520d72090bc6abe5120b87aa50ac756fadbb0 100644 --- a/w-stacking-fftw.c +++ b/w-stacking-fftw.c @@ -2,7 +2,7 @@ #include <stdlib.h> #include <string.h> #ifdef FITSIO -#include "/m100/home/userexternal/ederubei/cfitsio-3.49/fitsio.h" +#include "fitsio.h" #endif #ifdef USE_MPI #include <mpi.h> @@ -104,8 +104,8 @@ int main(int argc, char * argv[]) double resolution; // Mesh related parameters: global size - int grid_size_x = 2048; - int grid_size_y = 2048; + int grid_size_x = 4096; + int grid_size_y = 4096; // Split Mesh size (auto-calculated) int local_grid_size_x; int local_grid_size_y; @@ -132,17 +132,12 @@ int main(int argc, char * argv[]) fitsfile *fptreal; fitsfile *fptrimg; int status; - long nelements; -// long fpixel, lpixel; - char testfitsreal[FILENAMELENGTH] = "parallel_np4_real.fits"; - char testfitsimag[FILENAMELENGTH] = "parallel_np4_img.fits"; + char testfitsreal[FILENAMELENGTH] = "parallel_np2_real.fits"; + char testfitsimag[FILENAMELENGTH] = "parallel_np2_img.fits"; long naxis = 2; long naxes[2] = { grid_size_x, grid_size_y }; - nelements = naxes[0] * naxes[1]; - - // Internal profiling parameters @@ -958,19 +953,17 @@ if(rank == 0){ remove(testfitsimag); - printf("FITS CREATING\n"); + printf("FITS CREATION\n"); status = 0; fits_create_file(&fptrimg, testfitsimag, &status); fits_create_img(fptrimg, DOUBLE_IMG, naxis, naxes, &status); -// fits_write_img(fptrimg, TDOUBLE, fpixel, nelements, image_imag, &status); fits_close_file(fptrimg, &status); status = 0; fits_create_file(&fptreal, testfitsreal, &status); fits_create_img(fptreal, DOUBLE_IMG, naxis, naxes, &status); -// fits_write_img(fptreal, TDOUBLE, fpixel, nelements, image_real, &status); fits_close_file(fptreal, &status); #endif @@ -989,7 +982,7 @@ if(rank == 0){ #ifdef USE_MPI MPI_Barrier(MPI_COMM_WORLD); #endif - #ifdef PARALLEL_FITS + #ifdef PARALLELIO #ifdef FITSIO fpixel[0] = 1; @@ -1007,7 +1000,7 @@ if(rank == 0){ fits_write_subset(fptrimg, TDOUBLE, fpixel, lpixel, image_imag, &status); fits_close_file(fptrimg, &status); - #endif + #endif //FITSIO pFilereal = fopen (fftfile2,"ab"); pFileimg = fopen (fftfile3,"ab"); @@ -1036,9 +1029,7 @@ if(rank == 0){ #ifdef FITSIO printf("%d writing\n",isector); - //long * fpixel = (long *) malloc(sizeof(long)*naxis); - //long * lpixel = (long *) malloc(sizeof(long)*naxis); - + fpixel[0] = 1; fpixel[1] = isector*yaxis+1; lpixel[0] = xaxis; @@ -1054,7 +1045,7 @@ if(rank == 0){ fits_write_subset(fptrimg, TDOUBLE, fpixel, lpixel, image_imag, &status); fits_close_file(fptrimg, &status); - #endif + #endif //FITSIO pFilereal = fopen (fftfile2,"ab"); pFileimg = fopen (fftfile3,"ab"); @@ -1070,7 +1061,7 @@ if(rank == 0){ fclose(pFileimg); } } - #endif + #endif //PARALLELIO #ifdef USE_MPI MPI_Barrier(MPI_COMM_WORLD); #endif