Commit 11192972 authored by Nandhana Sakhtivel's avatar Nandhana Sakhtivel
Browse files

Revamp of read file

parent 64adac63
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -13,8 +13,11 @@ else
include Build/Makefile.systype
endif

FFTW_MPI_INC = -I/${HOME}/include
FFTW_MPI_LIB = /${HOME}/lib 

LIBS = -L$(FFTW_LIB) -lfftw3 -lm -lcudart  -lcuda
CFLAGS += $(FFTW_MPI_INC)
LIBS = -L$(FFTW_MPI_LIB) -lfftw3_mpi -lfftw3 -lm #-lcudart  -lcuda

# create MPI code
OPT += -DUSE_MPI
@@ -22,12 +25,12 @@ OPT += -DUSE_MPI
# use FFTW (it can be switched on ONLY if MPI is active)
ifeq (USE_MPI,$(findstring USE_MPI,$(OPT)))
   OPT += -DUSE_FFTW
	 LIBS = -L$(FFTW_LIB) -lfftw3_mpi -lfftw3 -lm
	 LIBS = -L$(FFTW_MPI_LIB) -lfftw3_mpi -lfftw3 -lm 
endif

#OPT += -DNVIDIA
# perform one-side communication (suggested) instead of reduce (only if MPI is active)
OPT += -DONE_SIDE
#OPT += -DONE_SIDE
# write the full 3D cube of gridded visibilities and its FFT transform
#OPT += -DWRITE_DATA
# write the final image
@@ -36,8 +39,8 @@ OPT += -DWRITE_IMAGE
OPT += -DPHASE_ON


DEPS = w-stacking.h w-stacking-fftw.c w-stacking.cu phase_correction.cu
COBJ = w-stacking.o w-stacking-fftw.o phase_correction.o
DEPS = w-stacking.h w-stacking-fftw.c w-stacking.cu phase_correction.cu allvars.h
COBJ = w-stacking.o w-stacking-fftw.o phase_correction.o allvars.o

w-stacking.c: w-stacking.cu
	cp w-stacking.cu w-stacking.c

allvars.c

0 → 100644
+14 −0
Original line number Diff line number Diff line
#include "allvars.h"

struct io file;

struct ip in = {"ucoord.bin", "vcoord.bin", "wcoord.bin", "weights.bin", "visibilities_real.bin", "visibilities_img.bin", "meta.txt" };

struct op out = {"grid.txt", "coords.txt", "grid_real.bin", "grid_img.bin", "fft.txt", "fft_real.bin", "fft_img.bin", "run.log", ".txt", "timings.dat"};

struct meta metaData;

struct time timing;

char filename[1000];

allvars.h

0 → 100644
+68 −0
Original line number Diff line number Diff line
/* file to store global variables*/

#include <stdio.h>

extern struct io
{
	FILE * pFile;
        FILE * pFile1;
        FILE * pFilereal;
        FILE * pFileimg;
} file;

extern struct ip
{
	char ufile[30];
  	char vfile[30];
  	char wfile[30];
  	char weightsfile[30];
  	char visrealfile[30];
  	char visimgfile[30];
  	char metafile[30];

} in;

extern struct op
{
	char outfile[30];
        char outfile1[30];
        char outfile2[30];
        char outfile3[30];
        char fftfile[30];
        char fftfile2[30];
        char fftfile3[30];
        char logfile[30];
        char extension[30];
        char timingfile[30];

} out;

extern struct meta
{

	long Nmeasures,Nmeasures0;
        long Nvis,Nvis0;
        long Nweights,Nweights0;
        long freq_per_chan,freq_per_chan0;
        long polarisations,polarisations0;
        long Ntimes,Ntimes0;
        double dt,dt0;
        double thours,thours0;
        long baselines,baselines0;
        double uvmin,uvmin0;
        double uvmax,uvmax0;
        double wmin,wmin0;
        double wmax,wmax0;

} metaData;


extern struct time
{
   	double setup_time, process_time, mpi_time, fftw_time, tot_time, kernel_time, reduce_time, compose_time, phase_time;
	double setup_time1, process_time1, mpi_time1, fftw_time1, tot_time1, kernel_time1, reduce_time1, compose_time1, phase_time1;
	double writetime, writetime1;

} timing;

extern char filename[1000];
+231 −265

File changed.

Preview size limit exceeded, changes collapsed.