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
d1d5817b
Commit
d1d5817b
authored
4 months ago
by
Moritz Hanke
Committed by
Thomas Jahns
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
exchangers: Use exch_send_type in xt_exchanger_mix_isend_irecv
parent
8481ec5a
No related branches found
Branches containing commit
No related tags found
1 merge request
!31
Draft: Attempt at fuller exchanger interface
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xt_exchanger_mix_isend_irecv.c
+18
-8
18 additions, 8 deletions
src/xt_exchanger_mix_isend_irecv.c
with
18 additions
and
8 deletions
src/xt_exchanger_mix_isend_irecv.c
+
18
−
8
View file @
d1d5817b
...
...
@@ -161,6 +161,7 @@ struct Xt_exchanger_mix_isend_irecv_ {
int
n
,
tag_offset
;
MPI_Comm
comm
;
enum
Xt_exch_send_comm_mode
send_mode
;
struct
Xt_msg_param
msgs
[];
};
...
...
@@ -174,6 +175,7 @@ xt_exchanger_mix_isend_irecv_alloc(size_t nmsg,
body_size
=
sizeof
(
struct
Xt_msg_param
)
*
nmsg
;
exchanger
=
xmalloc
(
header_size
+
body_size
);
exchanger
->
n
=
(
int
)
nmsg
;
exchanger
->
send_mode
=
XT_CONFIG_GET_EXCH_SEND_COMM_MODE
(
config
);
#ifdef _OPENMP
int
mthread_mode
=
xt_config_get_redist_mthread_mode
(
config
);
if
(
mthread_mode
==
XT_MT_OPENMP
)
...
...
@@ -228,6 +230,7 @@ xt_exchanger_mix_isend_irecv_new(int nsend, int nrecv,
=
xt_exchanger_mix_isend_irecv_alloc
(
nmsg
,
config
);
exchanger
->
comm
=
comm
;
exchanger
->
tag_offset
=
tag_offset
;
exchanger
->
send_mode
=
XT_CONFIG_GET_EXCH_SEND_COMM_MODE
(
config
);
struct
Xt_msg_param
*
restrict
msgs
=
exchanger
->
msgs
;
bool
dt_dup
=
!
(
config
->
flags
&
exch_no_dt_dup
);
xt_msg_params_copy
((
size_t
)
nsend
,
send_msgs
,
msgs
,
comm
,
dt_dup
);
...
...
@@ -272,6 +275,7 @@ xt_exchanger_mix_isend_irecv_copy(Xt_exchanger exchanger,
=
xt_exchanger_mix_isend_irecv_alloc
(
nmsg
,
&
xt_default_config
);
exchanger_copy
->
comm
=
new_comm
;
exchanger_copy
->
tag_offset
=
new_tag_offset
;
exchanger_copy
->
send_mode
=
exchanger_msr
->
send_mode
;
exchanger_copy
->
vtable
=
exchanger_msr
->
vtable
;
xt_msg_params_copy
(
nmsg
,
exchanger_msr
->
msgs
,
exchanger_copy
->
msgs
,
new_comm
,
true
);
...
...
@@ -295,12 +299,14 @@ redist_msgs_to_req(size_t nmsg,
const
struct
Xt_msg_param
*
restrict
msgs
,
const
void
*
src_data
,
void
*
dst_data
,
MPI_Request
*
requests
,
MPI_Comm
comm
,
int
tag_offset
)
MPI_Comm
comm
,
int
tag_offset
,
enum
Xt_exch_send_comm_mode
send_mode
)
{
typedef
int
(
*
ifp
)(
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
int
dest
,
int
tag
,
MPI_Comm
comm
,
MPI_Request
*
request
);
ifp
a_send
=
(
ifp
)
xt_send_func_tab
[
0
][
send_mode
];
for
(
size_t
i
=
0
;
i
<
nmsg
;
++
i
)
{
typedef
int
(
*
ifp
)(
void
*
buf
,
int
count
,
MPI_Datatype
datatype
,
int
dest
,
int
tag
,
MPI_Comm
comm
,
MPI_Request
*
request
);
ifp
op
=
MSG_DIR
(
msgs
[
i
])
==
SEND
?
(
ifp
)
MPI_Isend
:
(
ifp
)
MPI_Irecv
;
ifp
op
=
MSG_DIR
(
msgs
[
i
])
==
SEND
?
(
ifp
)
a_send
:
(
ifp
)
MPI_Irecv
;
unsigned
char
*
data
=
MSG_DIR
(
msgs
[
i
])
==
SEND
?
(
void
*
)(
intptr_t
)
src_data
:
dst_data
;
xt_mpi_call
(
op
(
data
+
msgs
[
i
].
displacement
,
msgs
[
i
].
count
,
msgs
[
i
].
datatype
,
...
...
@@ -326,7 +332,8 @@ xt_exchanger_mix_isend_irecv_s_exchange(Xt_exchanger exchanger,
?
req_buf
:
xmalloc
(
nmsg
*
sizeof
(
*
requests
));
redist_msgs_to_req
((
size_t
)
nmsg
,
exchanger_msr
->
msgs
,
src_data
,
dst_data
,
requests
,
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
);
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
,
exchanger_msr
->
send_mode
);
xt_mpi_call
(
MPI_Waitall
((
int
)
nmsg
,
requests
,
MPI_STATUSES_IGNORE
),
exchanger_msr
->
comm
);
if
(
requests
!=
req_buf
)
...
...
@@ -351,7 +358,8 @@ static void xt_exchanger_mix_isend_irecv_a_exchange(
=
xt_request_msgs_get_req_ptr
(
requests
);
redist_msgs_to_req
(
nmsg
,
exchanger_msr
->
msgs
,
src_data
,
dst_data
,
requests_
,
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
);
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
,
exchanger_msr
->
send_mode
);
*
request
=
requests
;
}
else
*
request
=
XT_REQUEST_NULL
;
...
...
@@ -375,7 +383,8 @@ xt_exchanger_mix_isend_irecv_a_exchange_mt(Xt_exchanger exchanger,
nmsg_
=
(
nmsg
*
(
tid
+
1
))
/
num_threads
-
start
;
redist_msgs_to_req
(
nmsg_
,
exchanger_msr
->
msgs
+
start
,
src_data
,
dst_data
,
requests
+
start
,
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
);
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
,
exchanger_msr
->
send_mode
);
}
static
void
...
...
@@ -411,7 +420,8 @@ xt_exchanger_mix_isend_irecv_s_exchange_mt(Xt_exchanger exchanger,
nmsg_
=
(
nmsg
*
(
tid
+
1
))
/
num_threads
-
start
;
redist_msgs_to_req
(
nmsg_
,
exchanger_msr
->
msgs
+
start
,
src_data
,
dst_data
,
requests
+
start
,
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
);
exchanger_msr
->
comm
,
exchanger_msr
->
tag_offset
,
exchanger_msr
->
send_mode
);
xt_mpi_call
(
MPI_Waitall
((
int
)
nmsg_
,
requests
+
start
,
MPI_STATUSES_IGNORE
),
exchanger_msr
->
comm
);
}
...
...
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