Skip to content
Snippets Groups Projects
Commit 1d94a958 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fix memory issue

parent 8f6c887a
No related branches found
No related tags found
No related merge requests found
......@@ -107,8 +107,8 @@ fluid_solver<R>::fluid_solver( \
\
this->cv[1] = FFTW(alloc_complex)(this->cd->local_size);\
this->cv[2] = FFTW(alloc_complex)(this->cd->local_size);\
this->rv[1] = (R*)(this->cv);\
this->rv[2] = (R*)(this->cv);\
this->rv[1] = (R*)(this->cv[1]);\
this->rv[2] = (R*)(this->cv[2]);\
\
this->c2r_vorticity = new FFTW(plan);\
this->r2c_vorticity = new FFTW(plan);\
......@@ -149,7 +149,7 @@ fluid_solver<R>::fluid_solver( \
this->vc2r[2] = new FFTW(plan);\
this->vr2c[2] = new FFTW(plan);\
\
*(FFTW(plan)*)this->vc2r[1] = FFTW(mpi_plan_many_dft_c2r)( \
*(FFTW(plan)*)(this->vc2r[1]) = FFTW(mpi_plan_many_dft_c2r)( \
3, sizes, 3, FFTW_MPI_DEFAULT_BLOCK, FFTW_MPI_DEFAULT_BLOCK, \
this->cv[1], this->rv[1], \
MPI_COMM_WORLD, FFTW_ESTIMATE | FFTW_MPI_TRANSPOSED_IN); \
......
......@@ -60,18 +60,18 @@ Kdata0[..., 0] = Kdata00
Kdata0[..., 1] = Kdata01
Kdata0[..., 2] = Kdata02
Kdata0.tofile("Kdata0")
run_test('test_FFT')
Kdata1 = np.fromfile('Kdata1', dtype = np.complex64).reshape(Kdata0.shape)
print np.max(np.abs(Kdata0 - Kdata1))
print np.max(np.abs(Kdata0))
fig = plt.figure(figsize=(12, 6))
a = fig.add_subplot(121)
a.imshow(abs(Kdata0[4, :, :, 2]), interpolation = 'none')
a = fig.add_subplot(122)
a.imshow(abs(Kdata1[4, :, :, 2]), interpolation = 'none')
fig.savefig('tmp.pdf', format = 'pdf')
run_test('test_step')
#Kdata1 = np.fromfile('Kdata1', dtype = np.complex64).reshape(Kdata0.shape)
#
#print np.max(np.abs(Kdata0 - Kdata1))
#print np.max(np.abs(Kdata0))
#
#fig = plt.figure(figsize=(12, 6))
#a = fig.add_subplot(121)
#a.imshow(abs(Kdata0[4, :, :, 2]), interpolation = 'none')
#a = fig.add_subplot(122)
#a.imshow(abs(Kdata1[4, :, :, 2]), interpolation = 'none')
#fig.savefig('tmp.pdf', format = 'pdf')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment