Skip to content

Commit

Permalink
Fixed possible deadlocks in spatial taper and gauss functions
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-koehn committed Aug 3, 2023
1 parent 177471f commit 3e373ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/gauss_filt.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ void gauss_filt(float ** waveconv)
if(MYID==0){printf("\n \t ---- Smoothed gradient is distributed on computational nodes ... ---- \n");}

/* clean up temporary files*/
MPI_Barrier(MPI_COMM_WORLD);
/*MPI_Barrier(MPI_COMM_WORLD);
sprintf(jac_tmp,"%s_gauss.old.%i.%i",JACOBIAN,POS[1],POS[2]);
remove(jac_tmp);
remove(jac_tmp);*/

}
4 changes: 2 additions & 2 deletions src/gauss_filt_var.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ void gauss_filt_var(float ** waveconv, float ** vel_mod)
if(MYID==0){printf("\n \t ---- Smoothed gradient is distributed on computational nodes ... ---- \n");}

/* clean up temporary files*/
MPI_Barrier(MPI_COMM_WORLD);
/*MPI_Barrier(MPI_COMM_WORLD);
sprintf(jac_tmp,"%s_gauss.old.%i.%i",JACOBIAN,POS[1],POS[2]);
remove(jac_tmp);
remove(jac_tmp);*/

}
4 changes: 2 additions & 2 deletions src/taper_grad_shot.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void taper_grad_shot(float ** waveconv,float ** taper_coeff, float **srcpos, int
extern float DH;
extern float SRTRADIUS;
extern int FREE_SURF, NX, NY, NXG, NYG;
extern int NPROCX, NPROCY, MYID_SHOT, POS[3];
extern int NPROCX, NPROCY, MYID_SHOT, POS[3], COLOR;
extern int SRTSHAPE, FILTSIZE;
extern char TFILE[STRING_SIZE];
extern FILE *FP;
Expand Down Expand Up @@ -263,7 +263,7 @@ void taper_grad_shot(float ** waveconv,float ** taper_coeff, float **srcpos, int


MPI_Barrier(SHOT_COMM);
sprintf(modfile,"%s_coeff_%i.bin",TFILE,ishot);
sprintf(modfile,"%s_coeff_%i_%i.bin",TFILE,ishot,COLOR);
writemod(modfile,taper_coeff,3);
MPI_Barrier(SHOT_COMM);
if (MYID_SHOT==0) mergemod(modfile,3);
Expand Down

0 comments on commit 3e373ed

Please sign in to comment.