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
b6c9fd75
Commit
b6c9fd75
authored
4 years ago
by
Antoine Cyril David Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
2D parallel distribution
parent
f85f7606
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/grid_mod.F90
+28
-10
28 additions, 10 deletions
src/grid_mod.F90
with
28 additions
and
10 deletions
src/grid_mod.F90
+
28
−
10
View file @
b6c9fd75
...
@@ -35,7 +35,10 @@ MODULE grid
...
@@ -35,7 +35,10 @@ MODULE grid
REAL
(
dp
),
PUBLIC
,
PROTECTED
::
deltar
,
deltaz
REAL
(
dp
),
PUBLIC
,
PROTECTED
::
deltar
,
deltaz
INTEGER
,
PUBLIC
,
PROTECTED
::
irs
,
ire
,
izs
,
ize
INTEGER
,
PUBLIC
,
PROTECTED
::
irs
,
ire
,
izs
,
ize
INTEGER
,
PUBLIC
::
ir
,
iz
! counters
INTEGER
,
PUBLIC
::
ir
,
iz
! counters
integer
(
C_INTPTR_T
),
PUBLIC
::
local_nkr
,
local_nkr_offset
,
local_nz
,
local_nz_offset
integer
(
C_INTPTR_T
),
PUBLIC
::
local_nkr
,
local_nz
integer
(
C_INTPTR_T
),
PUBLIC
::
local_nkr_offset
,
local_nz_offset
INTEGER
,
PUBLIC
::
local_np_e
,
local_np_i
integer
(
C_INTPTR_T
),
PUBLIC
::
local_np_e_offset
,
local_np_i_offset
! Grids containing position in fourier space
! Grids containing position in fourier space
REAL
(
dp
),
DIMENSION
(:),
ALLOCATABLE
,
PUBLIC
::
krarray
REAL
(
dp
),
DIMENSION
(:),
ALLOCATABLE
,
PUBLIC
::
krarray
...
@@ -69,12 +72,12 @@ CONTAINS
...
@@ -69,12 +72,12 @@ CONTAINS
SUBROUTINE
init_1Dgrid_distr
SUBROUTINE
init_1Dgrid_distr
write
(
*
,
*
)
Nr
!
write(*,*) Nr
local_nkr
=
(
Nr
/
2+1
)/
num_procs
local_nkr
=
(
Nr
/
2+1
)/
num_procs
_kr
write
(
*
,
*
)
local_nkr
!
write(*,*) local_nkr
local_nkr_offset
=
my_id
*
local_nkr
local_nkr_offset
=
rank_r
*
local_nkr
if
(
my_id
.EQ.
num_procs
-1
)
local_nkr
=
(
Nr
/
2+1
)
-
local_nkr_offset
if
(
rank_r
.EQ.
num_procs
_kr
-1
)
local_nkr
=
(
Nr
/
2+1
)
-
local_nkr_offset
END
SUBROUTINE
init_1Dgrid_distr
END
SUBROUTINE
init_1Dgrid_distr
...
@@ -83,13 +86,14 @@ CONTAINS
...
@@ -83,13 +86,14 @@ CONTAINS
IMPLICIT
NONE
IMPLICIT
NONE
INTEGER
::
ip
INTEGER
::
ip
ips_e
=
1
;
ipe_e
=
pmaxe
+
1
CALL
decomp1D
(
pmaxe
+1
,
num_procs_p
,
rank_p
,
ips_e
,
ipe_e
)
ips_i
=
1
;
ipe_i
=
pmaxi
+
1
CALL
decomp1D
(
pmaxi
+1
,
num_procs_p
,
rank_p
,
ips_i
,
ipe_i
)
ALLOCATE
(
parray_e
(
ips_e
:
ipe_e
))
ALLOCATE
(
parray_e
(
ips_e
:
ipe_e
))
ALLOCATE
(
parray_i
(
ips_i
:
ipe_i
))
ALLOCATE
(
parray_i
(
ips_i
:
ipe_i
))
DO
ip
=
ips_e
,
ipe_e
;
parray_e
(
ip
)
=
(
ip
-1
);
END
DO
DO
ip
=
ips_e
,
ipe_e
;
parray_e
(
ip
)
=
(
ip
-1
);
END
DO
DO
ip
=
ips_i
,
ipe_i
;
parray_i
(
ip
)
=
(
ip
-1
);
END
DO
DO
ip
=
ips_i
,
ipe_i
;
parray_i
(
ip
)
=
(
ip
-1
);
END
DO
! Ghosts boundaries
! Ghosts boundaries
ipsg_e
=
ips_e
-
2
;
ipeg_e
=
ipe_e
+
2
;
ipsg_e
=
ips_e
-
2
;
ipeg_e
=
ipe_e
+
2
;
ipsg_i
=
ips_i
-
2
;
ipeg_i
=
ipe_i
+
2
;
ipsg_i
=
ips_i
-
2
;
ipeg_i
=
ipe_i
+
2
;
...
@@ -119,7 +123,7 @@ CONTAINS
...
@@ -119,7 +123,7 @@ CONTAINS
! Precomputations
! Precomputations
jmaxe_dp
=
real
(
jmaxe
,
dp
)
jmaxe_dp
=
real
(
jmaxe
,
dp
)
jmaxi_dp
=
real
(
jmaxi
,
dp
)
jmaxi_dp
=
real
(
jmaxi
,
dp
)
END
SUBROUTINE
set_jgrid
END
SUBROUTINE
set_jgrid
...
@@ -245,4 +249,18 @@ CONTAINS
...
@@ -245,4 +249,18 @@ CONTAINS
bari
=
(
jmaxi
+1
)
*
p_
+
j_
+
1
bari
=
(
jmaxi
+1
)
*
p_
+
j_
+
1
END
FUNCTION
END
FUNCTION
SUBROUTINE
decomp1D
(
n
,
numprocs
,
myid
,
s
,
e
)
INTEGER
::
n
,
numprocs
,
myid
,
s
,
e
INTEGER
::
nlocal
INTEGER
::
deficit
nlocal
=
n
/
numprocs
s
=
myid
*
nlocal
+
1
deficit
=
MOD
(
n
,
numprocs
)
s
=
s
+
MIN
(
myid
,
deficit
)
IF
(
myid
.LT.
deficit
)
nlocal
=
nlocal
+
1
e
=
s
+
nlocal
-
1
IF
(
e
.GT.
n
.OR.
myid
.EQ.
numprocs
-1
)
e
=
n
END
SUBROUTINE
decomp1D
END
MODULE
grid
END
MODULE
grid
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