Skip to content
Snippets Groups Projects
Commit ff3aadad authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Add adjustable exchangers to parallel p2p redist tests.

parent a76ef193
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@
#include "test_redist_common.h"
int main(void) {
int main(int argc, char **argv) {
// init mpi
......@@ -68,7 +68,7 @@ int main(void) {
xt_mpi_call(MPI_Init(NULL, NULL), MPI_COMM_WORLD);
xt_initialize(MPI_COMM_WORLD);
Xt_config config = redist_exchanger_option(&argc, &argv);
xt_mpi_call(MPI_Comm_rank(MPI_COMM_WORLD, &rank), MPI_COMM_WORLD);
xt_mpi_call(MPI_Comm_size(MPI_COMM_WORLD, &size), MPI_COMM_WORLD);
......@@ -97,7 +97,7 @@ int main(void) {
xmap = xt_xmap_all2all_new(src_idxlist, dst_idxlist, MPI_COMM_WORLD);
// redist_p2p
Xt_redist redist = xt_redist_p2p_new(xmap, MPI_DOUBLE);
Xt_redist redist = xt_redist_p2p_custom_new(xmap, MPI_DOUBLE, config);
// test communicator of redist
......@@ -147,7 +147,7 @@ int main(void) {
= xt_xmap_all2all_new(src_idxlist, dst_idxlist, MPI_COMM_WORLD);
// redist_p2p
Xt_redist redist = xt_redist_p2p_new(xmap, MPI_DOUBLE);
Xt_redist redist = xt_redist_p2p_custom_new(xmap, MPI_DOUBLE, config);
// test communicator of redist
......@@ -226,7 +226,7 @@ int main(void) {
Xt_xmap xmap = xt_xmap_all2all_new(idxlist_a, idxlist_b, MPI_COMM_WORLD);
// simple redist:
Xt_redist redist = xt_redist_p2p_new(xmap, MPI_INT);
Xt_redist redist = xt_redist_p2p_custom_new(xmap, MPI_INT, config);
// test communicator of redist
......@@ -283,10 +283,9 @@ int main(void) {
else
src_block_offsets[i] = src_block_offsets[i-1]+src_block_sizes[i-1];
src_block_sizes[i] = gdepth[ia];
for (int j = 0; j < gdepth[ia]; j++) {
for (int j = 0; j < gdepth[ia]; j++, qa++) {
int p = ig2col_off[ia] + j;
a_voldata[qa] = gvoldata[p];
qa++;
}
a_vol_size += src_block_sizes[i];
}
......@@ -311,11 +310,10 @@ int main(void) {
}
// redist with blocks:
Xt_redist block_redist
= xt_redist_p2p_blocks_off_new(xmap,
src_block_offsets, src_block_sizes, nwin,
dst_block_offsets, dst_block_sizes, nwin,
MPI_INT);
Xt_redist block_redist = xt_redist_p2p_blocks_off_custom_new(
xmap, src_block_offsets, src_block_sizes, nwin,
dst_block_offsets, dst_block_sizes, nwin,
MPI_INT, config);
// test communicator of redist
if (!communicators_are_congruent(xt_redist_get_MPI_Comm(block_redist),
......@@ -326,9 +324,8 @@ int main(void) {
fill_array_int, NULL, b_voldata_ref, MPI_INT, MPI_INT);
// redist with blocks but without explicit offsets:
Xt_redist block_redist2
= xt_redist_p2p_blocks_new(xmap, src_block_sizes, nwin,
dst_block_sizes, nwin, MPI_INT);
Xt_redist block_redist2 = xt_redist_p2p_blocks_custom_new(
xmap, src_block_sizes, nwin, dst_block_sizes, nwin, MPI_INT, config);
// test communicator of redist
if (!communicators_are_congruent(xt_redist_get_MPI_Comm(block_redist2),
......@@ -348,6 +345,7 @@ int main(void) {
// end of test
}
xt_config_delete(config);
xt_finalize();
MPI_Finalize();
......
......@@ -52,17 +52,20 @@ PROGRAM test_redist_p2p_parallel
xt_xmap, xt_xmap_all2all_new, xt_xmap_delete, &
xt_redist, xt_redist_p2p_new, xt_redist_get_mpi_comm, &
xt_redist_delete, &
xt_redist_p2p_blocks_off_new, xt_redist_p2p_blocks_new
xt_redist_p2p_blocks_off_custom_new, xt_redist_p2p_blocks_custom_new, &
xt_config, xt_config_delete
USE test_idxlist_utils, ONLY: test_err_count
USE test_redist_common, ONLY: communicators_are_congruent, &
check_redist
check_redist, redist_exchanger_option
IMPLICIT NONE
CHARACTER(len=*), PARAMETER :: filename = 'test_redist_p2p_parallel_f.f90'
TYPE(xt_config) :: config
INTEGER :: comm_rank, comm_size, ierror
CALL init_mpi
CALL xt_initialize(mpi_comm_world)
config = redist_exchanger_option()
CALL mpi_comm_rank(mpi_comm_world, comm_rank, ierror)
IF (ierror /= mpi_success) &
......@@ -78,6 +81,7 @@ PROGRAM test_redist_p2p_parallel
IF (test_err_count() /= 0) &
CALL test_abort("non-zero error count!", filename, __LINE__)
CALL xt_config_delete(config)
CALL xt_finalize
CALL finish_mpi
......@@ -109,7 +113,7 @@ CONTAINS
! xmap
xmap = xt_xmap_all2all_new(src_idxlist, dst_idxlist, mpi_comm_world)
! redist_p2p
redist = xt_redist_p2p_new(xmap, mpi_double_precision)
redist = xt_redist_p2p_new(xmap, mpi_double_precision, config)
! test communicator of redist
IF (.NOT. communicators_are_congruent(xt_redist_get_mpi_comm(redist), &
......@@ -160,7 +164,7 @@ CONTAINS
xmap = xt_xmap_all2all_new(src_idxlist, dst_idxlist, mpi_comm_world)
! redist_p2p
redist = xt_redist_p2p_new(xmap, mpi_double_precision)
redist = xt_redist_p2p_new(xmap, mpi_double_precision, config)
! test communicator of redist
IF (.NOT. communicators_are_congruent(xt_redist_get_mpi_comm(redist), &
......@@ -244,7 +248,7 @@ CONTAINS
xmap = xt_xmap_all2all_new(idxlist_a, idxlist_b, mpi_comm_world)
! simple redist
redist = xt_redist_p2p_new(xmap, mpi_integer)
redist = xt_redist_p2p_new(xmap, mpi_integer, config)
! test communicator of redist
IF (.NOT. communicators_are_congruent(xt_redist_get_mpi_comm(redist), &
......@@ -310,10 +314,9 @@ CONTAINS
END DO
! redist with blocks
block_redist &
= xt_redist_p2p_blocks_off_new(xmap, &
block_redist = xt_redist_p2p_blocks_off_custom_new(xmap, &
src_block_offsets, src_block_sizes, nwin, &
dst_block_offsets, dst_block_sizes, nwin, mpi_integer)
dst_block_offsets, dst_block_sizes, nwin, mpi_integer, config)
! test communicator of redist
IF (.NOT. communicators_are_congruent(xt_redist_get_mpi_comm(block_redist), &
mpi_comm_world)) &
......@@ -322,8 +325,8 @@ CONTAINS
CALL check_redist(block_redist, a_voldata, b_voldata, b_voldata_ref)
! redist with blocks but without explicit offsets:
block_redist2 = xt_redist_p2p_blocks_new(xmap, &
src_block_sizes, nwin, dst_block_sizes, nwin, mpi_integer)
block_redist2 = xt_redist_p2p_blocks_custom_new(xmap, &
src_block_sizes, nwin, dst_block_sizes, nwin, mpi_integer, config)
! test communicator of redist
IF (.NOT. communicators_are_congruent(xt_redist_get_mpi_comm(block_redist2),&
......
......@@ -4,9 +4,9 @@ LIBC_FATAL_STDERR_=1
export LIBC_FATAL_STDERR_
[ x"@MPI_LAUNCH@" != xtrue ] || exit 77
@abs_top_builddir@/libtool --mode=execute \
@MPI_LAUNCH@ -n 4 @abs_builddir@/test_redist_p2p_parallel
@MPI_LAUNCH@ -n 4 @abs_builddir@/test_redist_p2p_parallel "$@"
@abs_top_builddir@/libtool --mode=execute \
@MPI_LAUNCH@ -n 4 @abs_builddir@/test_redist_p2p_parallel_f
@MPI_LAUNCH@ -n 4 @abs_builddir@/test_redist_p2p_parallel_f "$@"
#
# Local Variables:
# mode: sh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment