Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yaxt
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
Container Registry
Model registry
Operate
Environments
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
dkrz-sw
yaxt
Commits
a9a3e51e
Commit
a9a3e51e
authored
5 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Clarify Fortran interface of xt_xmap_intersection_pos_new.
parent
635033f3
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/xt_xmap_intersection_f.f90
+31
-30
31 additions, 30 deletions
src/xt_xmap_intersection_f.f90
with
31 additions
and
30 deletions
src/xt_xmap_intersection_f.f90
+
31
−
30
View file @
a9a3e51e
...
...
@@ -107,9 +107,9 @@ MODULE xt_xmap_intersection
FUNCTION
xmi_pos_new_f2c
(
num_src_msg
,
src_com
,
num_dst_msg
,
dst_com
,
comm
)
&
RESULT
(
xmap
)
&
BIND
(
c
,
name
=
'xt_xmap_intersection_pos_new_f2c'
)
IMPORT
::
c_int
,
c_ptr
,
xt_mpi_fint_kind
IMPORT
::
c_int
,
c_ptr
,
xt_mpi_fint_kind
,
xt_com_pos_c
INTEGER
(
c_int
),
VALUE
,
INTENT
(
in
)
::
num_src_msg
,
num_dst_msg
TYPE
(
c_ptr
),
VALUE
,
INTENT
(
in
)
::
src_com
,
dst_com
TYPE
(
xt_com_pos_c
)
,
INTENT
(
in
)
::
src_com
(
*
)
,
dst_com
(
*
)
INTEGER
(
xt_mpi_fint_kind
),
VALUE
,
INTENT
(
in
)
::
comm
TYPE
(
c_ptr
)
::
xmap
END
FUNCTION
xmi_pos_new_f2c
...
...
@@ -223,60 +223,61 @@ CONTAINS
INTEGER
(
c_int
)
::
num_src_msg_c
,
num_dst_msg_c
TYPE
(
xt_com_pos_c
),
ALLOCATABLE
::
src_com_c
(:),
dst_com_c
(:)
INTEGER
(
c_int
),
ALLOCATABLE
::
pos_buffer
(:)
INTEGER
(
c_size_t
)
::
pos_buffer_offset
INTEGER
(
c_int
),
TARGET
,
ALLOCATABLE
::
pos_buffer
(:)
INTEGER
::
pos_buffer_offset
,
num_pos_total
ALLOCATE
(
pos_buffer
(
get_total_num_transfer_pos
(
num_src_msg
,
src_com
)
+
&
get_total_num_transfer_pos
(
num_dst_msg
,
dst_com
)))
num_pos_total
=
get_total_num_transfer_pos
(
num_src_msg
,
src_com
)
+
&
get_total_num_transfer_pos
(
num_dst_msg
,
dst_com
)
ALLOCATE
(
pos_buffer
(
num_pos_total
))
num_src_msg_c
=
INT
(
num_src_msg
,
c_int
)
num_dst_msg_c
=
INT
(
num_dst_msg
,
c_int
)
pos_buffer_offset
=
1
CALL
generate_xt_com_pos_c
(
&
num_
src_msg
,
src_com
,
src_com_c
,
pos_buffer
,
pos_buffer_offset
)
CALL
generate_xt_com_pos_c
(
&
num_
dst_msg
,
dst_com
,
dst_com_c
,
pos_buffer
,
pos_buffer_offset
)
pos_buffer_offset
=
0
CALL
generate_xt_com_pos_c
(
num_src_msg
,
src_com
,
src_com_c
,
&
num_
pos_total
,
pos_buffer
,
pos_buffer_offset
)
CALL
generate_xt_com_pos_c
(
num_dst_msg
,
dst_com
,
dst_com_c
,
&
num_
pos_total
,
pos_buffer
,
pos_buffer_offset
)
xmap
=
&
xt_xmap_c2f
(
&
xmi_pos_new_f2c
(&
num_src_msg_c
,
C_LOC
(
src_com_c
),
num_dst_msg_c
,
C_LOC
(
dst_com_c
),
comm
))
xt_xmap_c2f
(
xmi_pos_new_f2c
(&
num_src_msg_c
,
src_com_c
,
num_dst_msg_c
,
dst_com_c
,
comm
))
CONTAINS
FUNCTION
get_total_num_transfer_pos
(
num_msg
,
com_pos
)
&
RESULT
(
total_num_transfer_pos
)
INTEGER
,
INTENT
(
in
)
::
num_msg
TYPE
(
xt_com_pos
),
TARGET
,
INTENT
(
in
)
::
com_pos
(:)
TYPE
(
xt_com_pos
),
INTENT
(
in
)
::
com_pos
(:)
INTEGER
::
i
INTEGER
(
c_size_t
)
::
total_num_transfer_pos
INTEGER
::
total_num_transfer_pos
total_num_transfer_pos
=
0
DO
i
=
1
,
num_msg
total_num_transfer_pos
=
&
total_num_transfer_pos
+
SIZE
(
com_pos
(
i
)
%
transfer_pos
,
1
,
c_size_t
)
total_num_transfer_pos
=
total_num_transfer_pos
&
+
SIZE
(
com_pos
(
i
)
%
transfer_pos
)
END
DO
END
FUNCTION
get_total_num_transfer_pos
SUBROUTINE
generate_xt_com_pos_c
(
&
num_msg
,
com_pos
,
com_pos_c
,
pos_buffer
,
pos_buffer_offset
)
SUBROUTINE
generate_xt_com_pos_c
(
num_msg
,
com_pos
,
com_pos_c
,
&
pos_buffer_size
,
pos_buffer
,
&
pos_buffer_offset
)
INTEGER
,
INTENT
(
in
)
::
num_msg
TYPE
(
xt_com_pos
),
TARGET
,
INTENT
(
in
)
::
com_pos
(:)
TYPE
(
xt_com_pos_c
),
ALLOCATABLE
,
INTENT
(
in
out
)
::
com_pos_c
(:)
INTEGER
(
c_int
),
TARGET
,
INTENT
(
in
out
)
::
pos_buffer
(:)
INTEGER
(
c_
size_t
)
,
INTENT
(
inout
)
::
pos_buffer
_offset
INTEGER
::
i
INTEGER
(
c_size_t
)
::
j
,
curr_num_transfer_pos
TYPE
(
xt_com_pos_c
),
ALLOCATABLE
,
INTENT
(
out
)
::
com_pos_c
(:)
INTEGER
,
INTENT
(
in
)
::
pos_buffer
_size
INTEGER
(
c_
int
),
TARGET
,
INTENT
(
inout
)
::
pos_buffer
(
pos_buffer_size
)
INTEGER
,
INTENT
(
inout
)
::
pos_buffer_offset
INTEGER
::
i
,
j
,
curr_num_transfer_pos
ALLOCATE
(
com_pos_c
(
num_msg
))
DO
i
=
1
,
num_msg
curr_num_transfer_pos
=
SIZE
(
com_pos
(
i
)
%
transfer_pos
,
1
,
c_size_t
)
DO
j
=
0
,
curr_num_transfer_pos
-
1
curr_num_transfer_pos
=
SIZE
(
com_pos
(
i
)
%
transfer_pos
)
DO
j
=
1
,
curr_num_transfer_pos
pos_buffer
(
pos_buffer_offset
+
j
)
=
&
INT
(
com_pos
(
i
)
%
transfer_pos
(
j
+1
),
c_int
)
INT
(
com_pos
(
i
)
%
transfer_pos
(
j
),
c_int
)
END
DO
com_pos_c
(
i
)
%
transfer_pos
=
C_LOC
(
pos_buffer
(
pos_buffer_offset
))
com_pos_c
(
i
)
%
transfer_pos
=
C_LOC
(
pos_buffer
(
pos_buffer_offset
+1
))
com_pos_c
(
i
)
%
num_transfer_pos
=
INT
(
curr_num_transfer_pos
,
c_int
)
com_pos_c
(
i
)
%
rank
=
INT
(
com_pos
(
i
)
%
rank
,
c_int
)
pos_buffer_offset
=
pos_buffer_offset
+
curr_num_transfer_pos
...
...
@@ -286,7 +287,7 @@ CONTAINS
END
FUNCTION
xmi_pos_new_i_a_i_a
FUNCTION
xmi_pos_new_a_a
(
src_com
,
dst_com
,
comm
)
RESULT
(
xmap
)
TYPE
(
xt_com_pos
),
TARGET
,
INTENT
(
in
)
::
src_com
(:),
dst_com
(:)
TYPE
(
xt_com_pos
),
INTENT
(
in
)
::
src_com
(:),
dst_com
(:)
INTEGER
,
INTENT
(
in
)
::
comm
TYPE
(
xt_xmap
)
::
xmap
...
...
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