Commit 22e19348 authored by tilman.metz's avatar tilman.metz

bugfix attemp

parent 2607899f
......@@ -24,7 +24,7 @@
#include "fd.h"
double exchange_Fv(st_freq_velocity *fourier_vel,int nf,
double exchange_Fv(float **** vx,float **** vy,float **** vz,int nf,
st_buffer *buffer, MPI_Request * req_send, MPI_Request * req_rec, int ntr_hess){
......@@ -32,25 +32,12 @@ st_buffer *buffer, MPI_Request * req_send, MPI_Request * req_rec, int ntr_hess){
extern const int TAG1,TAG2,TAG3,TAG4,TAG5,TAG6;
MPI_Status status;
int i, j, k, l, n, nf1, nf2,m,p;
int i, j, k, l, n, nf1, nf2,m;
double time=0.0; /*, time1=0.0;*/
nf1=3*FDORDER/2-1;
nf2=nf1-1;
float **** vx = fourier_vel->Fvx_re;
float **** vy = fourier_vel->Fvy_re;
float **** vz = fourier_vel->Fvz_re;
/*if (LOG){
if (MYID==0) time1=MPI_Wtime();}*/
for(p=1;p<=2;p++){
if(p==2){
float **** vx = fourier_vel->Fvx_im;
float **** vy = fourier_vel->Fvy_im;
float **** vz = fourier_vel->Fvz_im;
}
for(m=1;m<=nf*(ntr_hess+1);m++){
......@@ -335,7 +322,7 @@ st_buffer *buffer, MPI_Request * req_send, MPI_Request * req_rec, int ntr_hess){
}
}
}
/*if (LOG)
if (MYID==0){
time2=MPI_Wtime();
......@@ -343,5 +330,5 @@ st_buffer *buffer, MPI_Request * req_send, MPI_Request * req_rec, int ntr_hess){
fprintf(FP," Real time for particle velocity exchange: \t %4.2f s.\n",time);
}*/
return time;
}
......@@ -220,7 +220,7 @@ void exchange_v_rsg(st_velocity *vel,st_buffer *buffer);
double exchange_v(st_velocity *vel, st_buffer *buffer, MPI_Request *req_send, MPI_Request *req_rec);
double exchange_Fv(st_freq_velocity *fourier_vel, int nf, st_buffer *buffer, MPI_Request *req_send, MPI_Request *req_rec, int ntr_hess);
double exchange_Fv(float ** **vx, float ** **vy, float ** **vz, int nf, st_buffer *buffer, MPI_Request *req_send, MPI_Request *req_rec, int ntr_hess);
float readdsk(FILE *fp_in, int format);
......
......@@ -843,7 +843,9 @@ MPI_Barrier(MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
if(METHOD){
/* exchange frequency domain wavefields */
exchange_Fv(fourier_vel_fw,nf, velbuff, req_send, req_rec,0);}
exchange_Fv(fourier_vel_fw->Fvx_re,fourier_vel_fw->Fvy_re,fourier_vel_fw->Fvz_re,nf, velbuff, req_send, req_rec,0);
exchange_Fv(fourier_vel_fw->Fvx_im,fourier_vel_fw->Fvy_im,fourier_vel_fw->Fvz_im,nf, velbuff, req_send, req_rec,0);}
/*---------------START INVERSION-------------*/
......@@ -978,14 +980,18 @@ MPI_Barrier(MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
if(!pshot){
exchange_Fv(fourier_vel_back,nf, velbuff, req_send, req_rec,0);
exchange_Fv(fourier_vel_back->Fvx_re,fourier_vel_back->Fvy_re,fourier_vel_back->Fvz_re,nf, velbuff, req_send, req_rec,0);
exchange_Fv(fourier_vel_back->Fvx_im,fourier_vel_back->Fvy_im,fourier_vel_back->Fvz_im,nf, velbuff, req_send, req_rec,0);
MPI_Barrier(MPI_COMM_WORLD);
gradient_F(NX,NY,NZ,fourier_vel_fw,fourier_vel_back,grad,nt,mod,finv,nf,iteration);
}
} /*hloop*/
if(iteration==1 && HESS && !READ_HESS){
exchange_Fv(fourier_vel_back,nf, velbuff, req_send, req_rec,ntr_hess);
exchange_Fv(fourier_vel_back->Fvx_re,fourier_vel_back->Fvy_re,fourier_vel_back->Fvz_re,nf, velbuff, req_send, req_rec,0);
exchange_Fv(fourier_vel_back->Fvx_im,fourier_vel_back->Fvy_im,fourier_vel_back->Fvz_im,nf, velbuff, req_send, req_rec,0);
MPI_Barrier(MPI_COMM_WORLD);
hess_F(NX,NY,NZ,fourier_vel_fw,fourier_vel_back, hessian,nt,mod, finv, nf,ntr_hess);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment