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
3559b282
Commit
3559b282
authored
1 month ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
test suite: Try alternative send modes.
parent
59a18362
No related branches found
No related tags found
1 merge request
!31
Draft: Attempt at fuller exchanger interface
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_exchanger_parallel.c
+30
-8
30 additions, 8 deletions
tests/test_exchanger_parallel.c
tests/test_exchanger_parallel_f.f90
+32
-13
32 additions, 13 deletions
tests/test_exchanger_parallel_f.f90
with
62 additions
and
21 deletions
tests/test_exchanger_parallel.c
+
30
−
8
View file @
3559b282
...
...
@@ -103,9 +103,22 @@ int main(int argc, char **argv)
XT_MT_OPENMP
,
#endif
};
static
const
int
send_comm_modes_2_test
[]
=
{
xt_exch_send_standard
,
xt_exch_send_buffered
,
xt_exch_send_synchronous
,
};
enum
{
num_mt_modes
=
sizeof
(
mt_configs_2_test
)
/
sizeof
(
mt_configs_2_test
[
0
]),
num_send_modes
=
(
sizeof
(
send_comm_modes_2_test
)
/
sizeof
(
send_comm_modes_2_test
[
0
])),
};
int
comm_size
;
xt_mpi_call
(
MPI_Comm_size
(
comm
,
&
comm_size
),
comm
);
size_t
buf_size
=
(
sizeof
(
int
)
+
(
size_t
)
MPI_BSEND_OVERHEAD
)
*
(
size_t
)
comm_size
;
void
*
buf
=
xmalloc
(
buf_size
);
xt_mpi_call
(
MPI_Buffer_attach
(
buf
,
(
int
)
buf_size
),
comm
);
for
(
size_t
m
=
0
;
m
<
num_mt_modes
;
++
m
)
{
#ifdef _OPENMP
int
thread_support_provided
;
...
...
@@ -115,20 +128,29 @@ int main(int argc, char **argv)
continue
;
#endif
xt_config_set_redist_mthread_mode
(
config
,
mt_configs_2_test
[
m
]);
for
(
size_t
i
=
0
;
exchanger_code
[
i
]
!=
-
1
;
++
i
)
{
xt_config_set_exchange_method
(
config
,
exchanger_code
[
i
]);
test_bcast
(
comm
,
config
);
for
(
size_t
n
=
0
;
n
<
num_send_modes
;
++
n
)
{
xt_config_set_exchange_send_comm_mode
(
config
,
send_comm_modes_2_test
[
n
]);
for
(
size_t
i
=
0
;
exchanger_code
[
i
]
!=
-
1
;
++
i
)
{
xt_config_set_exchange_method
(
config
,
exchanger_code
[
i
]);
test_bcast
(
comm
,
config
);
test_gather
(
comm
,
config
);
test_gather
(
comm
,
config
);
test_all2all
(
comm
,
config
);
test_all2all
(
comm
,
config
);
test_rr
(
comm
,
config
);
test_rr
(
comm
,
config
);
test_intercomm_all2all
(
comm
,
config
);
test_intercomm_all2all
(
comm
,
config
);
}
}
}
{
int
buf_size_
;
void
*
buf_
;
xt_mpi_call
(
MPI_Buffer_detach
(
&
buf_
,
&
buf_size_
),
comm
);
assert
(
buf
==
buf_
&&
buf_size_
>=
0
&&
(
size_t
)
buf_size_
==
buf_size
);
}
free
(
buf
);
xt_config_delete
(
config
);
free
(
exchanger_code
);
...
...
This diff is collapsed.
Click to expand it.
tests/test_exchanger_parallel_f.f90
+
32
−
13
View file @
3559b282
...
...
@@ -46,7 +46,7 @@
#include "fc_feature_defs.inc"
#define FP_EQ(a, b) (ABS((a)-(b)) < EPSILON((a)))
PROGRAM
test_exchanger_parallel
USE
iso_c_binding
,
ONLY
:
c_ptr
,
c_loc
USE
iso_c_binding
,
ONLY
:
c_ptr
,
c_loc
,
c_int
USE
mpi
USE
yaxt
USE
xt_exchanger_abstract
...
...
@@ -70,21 +70,35 @@ PROGRAM test_exchanger_parallel
#ifdef _OPENMP
,
XT_MT_OPENMP
&
#endif
/)
/)
INTEGER
,
PARAMETER
::
num_send_modes
=
3
INTEGER
,
PARAMETER
::
send_comm_modes_2_test
(
num_send_modes
)
=
(/
&
xt_exch_send_standard
,
&
xt_exch_send_buffered
,
&
xt_exch_send_synchronous
/)
INTEGER
::
comm
INTEGER
::
m
,
i
INTEGER
::
m
,
i
,
sm
#ifdef _OPENMP
INTEGER
::
thread_support_provided
,
ierror
INTEGER
::
thread_support_provided
#endif
INTEGER
,
ALLOCATABLE
::
exchanger_code
(:)
INTEGER
::
comm_size
,
buf_size
,
buf_size_
,
ierror
INTEGER
(
c_int
),
ALLOCATABLE
::
buf
(:)
TYPE
(
c_ptr
)
::
bufp
comm
=
MPI_COMM_WORLD
;
comm
=
MPI_COMM_WORLD
CALL
init_mpi
CALL
xt_initialize
(
comm
)
CALL
parse_options
(
exchanger_code
,
test_freq
)
config
=
xt_config_new
()
! todo: replace computation with query of exchanger
CALL
mpi_comm_size
(
comm
,
comm_size
,
ierror
)
buf_size
=
(
4
+
mpi_bsend_overhead
)
*
comm_size
ALLOCATE
(
buf
((
buf_size
+3
)/
4
))
CALL
mpi_buffer_attach
(
buf
,
buf_size
,
ierror
)
DO
m
=
1
,
num_mt_modes
#ifdef _OPENMP
CALL
mpi_query_thread
(
thread_support_provided
,
ierror
)
...
...
@@ -92,22 +106,27 @@ PROGRAM test_exchanger_parallel
.AND.
thread_support_provided
/
=
MPI_THREAD_MULTIPLE
)
CYCLE
#endif
CALL
xt_config_set_redist_mthread_mode
(
config
,
mt_configs_2_test
(
m
))
DO
i
=
1
,
SIZE
(
exchanger_code
)
CALL
xt_config_set_exchange_method
(
config
,
exchanger_code
(
i
))
DO
sm
=
1
,
num_send_modes
CALL
xt_config_set_exchange_send_comm_mode
(
config
,
&
send_comm_modes_2_test
(
sm
))
DO
i
=
1
,
SIZE
(
exchanger_code
)
CALL
xt_config_set_exchange_method
(
config
,
exchanger_code
(
i
))
CALL
test_bcast
(
comm
,
config
)
;
CALL
test_bcast
(
comm
,
config
)
CALL
test_gather
(
comm
,
config
)
;
CALL
test_gather
(
comm
,
config
)
CALL
test_all2all
(
comm
,
config
)
;
CALL
test_all2all
(
comm
,
config
)
CALL
test_rr
(
comm
,
config
)
;
CALL
test_rr
(
comm
,
config
)
CALL
test_intercomm_all2all
(
comm
,
config
);
CALL
test_intercomm_all2all
(
comm
,
config
)
END
DO
END
DO
END
DO
CALL
mpi_buffer_detach
(
bufp
,
buf_size_
,
ierror
)
CALL
xt_config_delete
(
config
)
DEALLOCATE
(
exchanger_code
)
DEALLOCATE
(
exchanger_code
,
buf
)
CALL
xt_finalize
CALL
finish_mpi
...
...
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