Skip to content

Commit

Permalink
Fixed bug in receiver.c if READREC=2
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-koehn committed Aug 28, 2020
1 parent 1b1f630 commit b93eaa0
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ int **receiver(FILE *fp, int *ntr, int ishot){
extern float DH, REFREC[4], FW;
extern int READREC, NX;
extern int MYID_SHOT;
extern float REC_INCR_X, REC_INCR_Y;
extern float REC_INCR_X, REC_INCR_Y;
extern MPI_Comm SHOT_COMM;

int **recpos1, **recpos, nxrec=0, nyrec=0, nzrec=0;
int itr=1, itr1=0, itr2=0, recflag=0, c, ifw, n, i, j;
Expand All @@ -25,8 +26,8 @@ int **receiver(FILE *fp, int *ntr, int ishot){

FILE *fpr;

/*if (MYID_SHOT==0)
{*/
if (MYID_SHOT==0)
{

if (READREC){ /* read receiver positions from file */

Expand Down Expand Up @@ -95,13 +96,13 @@ int **receiver(FILE *fp, int *ntr, int ishot){



/*}*/


/* MPI_Barrier(MPI_COMM_WORLD);
MPI_Bcast(ntr,1,MPI_INT,0,MPI_COMM_WORLD);
}

MPI_Barrier(SHOT_COMM);
MPI_Bcast(ntr,1,MPI_INT,0,SHOT_COMM);
if (MYID_SHOT!=0) recpos=imatrix(1,3,1,*ntr);
MPI_Bcast(&recpos[1][1],(*ntr)*3,MPI_INT,0,MPI_COMM_WORLD);*/
MPI_Bcast(&recpos[1][1],(*ntr)*3,MPI_INT,0,SHOT_COMM);


/* if (MYID_SHOT==0)
{
Expand Down

0 comments on commit b93eaa0

Please sign in to comment.