Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gyacomo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Cyril David Hoffmann
Gyacomo
Commits
639ccdd1
Commit
639ccdd1
authored
4 years ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
Change of communication mean for 2D parallel
parent
4d499275
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fourier_mod.F90
+8
-7
8 additions, 7 deletions
src/fourier_mod.F90
with
8 additions
and
7 deletions
src/fourier_mod.F90
+
8
−
7
View file @
639ccdd1
...
@@ -21,7 +21,7 @@ MODULE fourier
...
@@ -21,7 +21,7 @@ MODULE fourier
integer
(
C_INTPTR_T
)
::
i
,
ix
,
iy
integer
(
C_INTPTR_T
)
::
i
,
ix
,
iy
integer
(
C_INTPTR_T
),
PUBLIC
::
alloc_local_1
,
alloc_local_2
integer
(
C_INTPTR_T
),
PUBLIC
::
alloc_local_1
,
alloc_local_2
integer
(
C_INTPTR_T
)
::
NR_
,
NZ_
,
NR_halved
integer
(
C_INTPTR_T
)
::
NR_
,
NZ_
,
NR_halved
integer
::
communicator
! many plan data variables
! many plan data variables
integer
(
C_INTPTR_T
)
::
howmany
=
9
! numer of eleemnt of the tensor
integer
(
C_INTPTR_T
)
::
howmany
=
9
! numer of eleemnt of the tensor
integer
::
rank
=
3
! rank of the transform
integer
::
rank
=
3
! rank of the transform
...
@@ -36,10 +36,12 @@ MODULE fourier
...
@@ -36,10 +36,12 @@ MODULE fourier
NR_
=
Nr
;
NZ_
=
Nz
NR_
=
Nr
;
NZ_
=
Nz
NR_halved
=
NR_
/
2
+
1
NR_halved
=
NR_
/
2
+
1
! communicator = MPI_COMM_WORLD
communicator
=
commr
!! Complex arrays F, G
!! Complex arrays F, G
! Compute the room to allocate
! Compute the room to allocate
alloc_local_1
=
fftw_mpi_local_size_2d
(
NR_halved
,
NZ_
,
MPI_COMM_WORLD
,
local_nkr
,
local_nkr_offset
)
alloc_local_1
=
fftw_mpi_local_size_2d
(
NR_halved
,
NZ_
,
communicator
,
local_nkr
,
local_nkr_offset
)
! alloc_local_1 = fftw_mpi_local_size_2d_many(2, NR_halved, NZ_, MPI_COMM_WORLD, local_nkr, local_nkr_offset)
! Initalize pointers to this room
! Initalize pointers to this room
cdatac_f
=
fftw_alloc_complex
(
alloc_local_1
)
cdatac_f
=
fftw_alloc_complex
(
alloc_local_1
)
cdatac_g
=
fftw_alloc_complex
(
alloc_local_1
)
cdatac_g
=
fftw_alloc_complex
(
alloc_local_1
)
...
@@ -51,8 +53,7 @@ MODULE fourier
...
@@ -51,8 +53,7 @@ MODULE fourier
!! Real arrays iFFT(F), iFFT(G)
!! Real arrays iFFT(F), iFFT(G)
! Compute the room to allocate
! Compute the room to allocate
alloc_local_2
=
fftw_mpi_local_size_2d
(
NZ_
,
NR_halved
,
MPI_COMM_WORLD
,
local_nz
,
local_nz_offset
)
alloc_local_2
=
fftw_mpi_local_size_2d
(
NZ_
,
NR_halved
,
communicator
,
local_nz
,
local_nz_offset
)
! alloc_local_2 = fftw_mpi_local_size_2d_many(2, NZ_, NR_halved, MPI_COMM_WORLD, local_nz, local_nz_offset)
! Initalize pointers to this room
! Initalize pointers to this room
cdatar_f
=
fftw_alloc_real
(
2
*
alloc_local_2
)
cdatar_f
=
fftw_alloc_real
(
2
*
alloc_local_2
)
cdatar_g
=
fftw_alloc_real
(
2
*
alloc_local_2
)
cdatar_g
=
fftw_alloc_real
(
2
*
alloc_local_2
)
...
@@ -63,8 +64,8 @@ MODULE fourier
...
@@ -63,8 +64,8 @@ MODULE fourier
call
c_f_pointer
(
cdatar_c
,
real_data_c
,
[
2
*
(
NR_
/
2
+
1
),
local_nz
])
call
c_f_pointer
(
cdatar_c
,
real_data_c
,
[
2
*
(
NR_
/
2
+
1
),
local_nz
])
! Plan Creation (out-of-place forward and backward FFT)
! Plan Creation (out-of-place forward and backward FFT)
planf
=
fftw_mpi_plan_dft_r2c_2d
(
NZ_
,
NR_
,
real_data_f
,
cmpx_data_f
,
MPI_COMM_WORLD
,
ior
(
FFTW_MEASURE
,
FFTW_MPI_TRANSPOSED_OUT
))
planf
=
fftw_mpi_plan_dft_r2c_2d
(
NZ_
,
NR_
,
real_data_f
,
cmpx_data_f
,
communicator
,
ior
(
FFTW_MEASURE
,
FFTW_MPI_TRANSPOSED_OUT
))
planb
=
fftw_mpi_plan_dft_c2r_2d
(
NZ_
,
NR_
,
cmpx_data_f
,
real_data_f
,
MPI_COMM_WORLD
,
ior
(
FFTW_MEASURE
,
FFTW_MPI_TRANSPOSED_IN
))
planb
=
fftw_mpi_plan_dft_c2r_2d
(
NZ_
,
NR_
,
cmpx_data_f
,
real_data_f
,
communicator
,
ior
(
FFTW_MEASURE
,
FFTW_MPI_TRANSPOSED_IN
))
if
((
.not.
c_associated
(
planf
))
.OR.
(
.not.
c_associated
(
planb
)))
then
if
((
.not.
c_associated
(
planf
))
.OR.
(
.not.
c_associated
(
planb
)))
then
write
(
*
,
*
)
"plan creation error!!"
write
(
*
,
*
)
"plan creation error!!"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment