Skip to content
Snippets Groups Projects
Commit 4bddc68e authored by Luca Tornatore's avatar Luca Tornatore
Browse files

just maquillage

parent 3d40f2a6
No related branches found
No related tags found
No related merge requests found
...@@ -130,31 +130,23 @@ void gridding_data(){ ...@@ -130,31 +130,23 @@ void gridding_data(){
double resolution_asec = (3600.0*180.0)/MAX(abs(metaData.uvmin),abs(metaData.uvmax))/PI; double resolution_asec = (3600.0*180.0)/MAX(abs(metaData.uvmin),abs(metaData.uvmax))/PI;
printf("RESOLUTION = %f rad, %f arcsec\n", resolution, resolution_asec); printf("RESOLUTION = %f rad, %f arcsec\n", resolution, resolution_asec);
// Declare temporary arrays for the masking for (long isector = 0; isector < nsectors; isector++)
double * uus;
double * vvs;
double * wws;
float * visreals;
float * visimgs;
float * weightss;
long isector;
for (long isector_count=0; isector_count<nsectors; isector_count++)
{ {
clock_gettime(CLOCK_MONOTONIC, &begink); clock_gettime(CLOCK_MONOTONIC, &begink);
startk = clock(); startk = clock();
// define local destination sector // define local destination sector
//isector = (isector_count+rank)%size; //isector = (isector_count+rank)%size; // this line must be wrong! [LT]
isector = isector_count;
// allocate sector arrays // allocate sector arrays
long Nsec = histo_send[isector]; long Nsec = histo_send[isector];
uus = (double*) malloc(Nsec*sizeof(double)); double *uus = (double*) malloc(Nsec*sizeof(double));
vvs = (double*) malloc(Nsec*sizeof(double)); double *vvs = (double*) malloc(Nsec*sizeof(double));
wws = (double*) malloc(Nsec*sizeof(double)); double *wws = (double*) malloc(Nsec*sizeof(double));
long Nweightss = Nsec*metaData.polarisations; long Nweightss = Nsec*metaData.polarisations;
long Nvissec = Nweightss*metaData.freq_per_chan; long Nvissec = Nweightss*metaData.freq_per_chan;
weightss = (float*) malloc(Nweightss*sizeof(float)); float *weightss = (float*) malloc(Nweightss*sizeof(float));
visreals = (float*) malloc(Nvissec*sizeof(float)); float *visreals = (float*) malloc(Nvissec*sizeof(float));
visimgs = (float*) malloc(Nvissec*sizeof(float)); float *visimgs = (float*) malloc(Nvissec*sizeof(float));
// select data for this sector // select data for this sector
long icount = 0; long icount = 0;
...@@ -262,13 +254,15 @@ void gridding_data(){ ...@@ -262,13 +254,15 @@ void gridding_data(){
#ifndef USE_MPI #ifndef USE_MPI
long stride = isector*2*xaxis*yaxis*num_w_planes; long stride = isector*2*xaxis*yaxis*num_w_planes;
for (long iii=0; iii<2*xaxis*yaxis*num_w_planes; iii++)gridtot[stride+iii] = gridss[iii]; for (long iii=0; iii<2*xaxis*yaxis*num_w_planes; iii++)
gridtot[stride+iii] = gridss[iii];
#endif #endif
// Write grid in the corresponding remote slab // Write grid in the corresponding remote slab
#ifdef USE_MPI #ifdef USE_MPI
int target_rank = (int)isector; // int target_rank = (int)isector; it implied that size >= nsectors
//int target_rank = (int)(size-isector-1); int target_rank = (int)(isector % size);
#ifdef ONE_SIDE #ifdef ONE_SIDE
printf("One Side communication active\n"); printf("One Side communication active\n");
MPI_Win_lock(MPI_LOCK_SHARED,target_rank,0,slabwin); MPI_Win_lock(MPI_LOCK_SHARED,target_rank,0,slabwin);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment