Commit 65bf0d77 authored by Xin Zhao's avatar Xin Zhao
Browse files

Add tests to test cases when both SHM window and non-SHM window exist.


Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 8c5cb1e6
......@@ -71,6 +71,7 @@ contention_putget 4
put_base 2
put_bottom 2
win_flavors 4 mpiversion=3.0
win_flavors 3 mpiversion=3.0
manyrma2 2 timeLimit=500
manyrma2_shm 2 timeLimit=500
manyrma3 2
......@@ -81,6 +82,7 @@ win_shared_noncontig 4 mpiversion=3.0
win_shared_noncontig_put 4 mpiversion=3.0
win_zero 4 mpiversion=3.0
@largetest@win_large_shm 4 mpiversion=3.0
@largetest@win_large_shm 3 mpiversion=3.0
win_dynamic_acc 4 mpiversion=3.0
get_acc_local 1 mpiversion=3.0
linked_list 4 mpiversion=3.0
......
......@@ -17,62 +17,71 @@ int main(int argc, char **argv) {
MPI_Win win;
MPI_Info win_info;
MPI_Comm shared_comm;
int i;
int shm_win_size = 1024 * 1024 * 1024 * sizeof(char); /* 1GB */
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
MPI_Info_create(&win_info);
MPI_Info_set(win_info, (char*)"alloc_shm", (char*)"true");
for (i = 0; i < 2; i++) {
if (i == 0) {
MPI_Info_create(&win_info);
MPI_Info_set(win_info, (char*)"alloc_shm", (char*)"true");
}
else {
win_info = MPI_INFO_NULL;
}
MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, my_rank, MPI_INFO_NULL, &shared_comm);
MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, my_rank, MPI_INFO_NULL, &shared_comm);
MPI_Comm_rank(shared_comm, &shared_rank);
MPI_Comm_rank(shared_comm, &shared_rank);
/* every processes allocate 1GB window memory */
MPI_Win_allocate(shm_win_size, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
/* every processes allocate 1GB window memory */
MPI_Win_allocate(shm_win_size, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
MPI_Win_free(&win);
MPI_Win_free(&win);
MPI_Win_allocate_shared(shm_win_size, sizeof(char), win_info, shared_comm, &mybase, &win);
MPI_Win_allocate_shared(shm_win_size, sizeof(char), win_info, shared_comm, &mybase, &win);
MPI_Win_free(&win);
MPI_Win_free(&win);
/* some processes allocate 1GB and some processes allocate zero bytes */
if (my_rank % 2 == 0)
MPI_Win_allocate(shm_win_size, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
else
MPI_Win_allocate(0, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
/* some processes allocate 1GB and some processes allocate zero bytes */
if (my_rank % 2 == 0)
MPI_Win_allocate(shm_win_size, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
else
MPI_Win_allocate(0, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
MPI_Win_free(&win);
MPI_Win_free(&win);
if (shared_rank % 2 == 0)
MPI_Win_allocate_shared(shm_win_size, sizeof(char), win_info, shared_comm, &mybase, &win);
else
MPI_Win_allocate_shared(0, sizeof(char), win_info, shared_comm, &mybase, &win);
if (shared_rank % 2 == 0)
MPI_Win_allocate_shared(shm_win_size, sizeof(char), win_info, shared_comm, &mybase, &win);
else
MPI_Win_allocate_shared(0, sizeof(char), win_info, shared_comm, &mybase, &win);
MPI_Win_free(&win);
MPI_Win_free(&win);
/* some processes allocate 1GB and some processes allocate smaller bytes */
if (my_rank % 2 == 0)
MPI_Win_allocate(shm_win_size, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
else
MPI_Win_allocate(shm_win_size/2, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
/* some processes allocate 1GB and some processes allocate smaller bytes */
if (my_rank % 2 == 0)
MPI_Win_allocate(shm_win_size, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
else
MPI_Win_allocate(shm_win_size/2, sizeof(char), win_info, MPI_COMM_WORLD, &mybase, &win);
MPI_Win_free(&win);
MPI_Win_free(&win);
/* some processes allocate 1GB and some processes allocate smaller bytes */
if (shared_rank % 2 == 0)
MPI_Win_allocate_shared(shm_win_size, sizeof(char), win_info, shared_comm, &mybase, &win);
else
MPI_Win_allocate_shared(shm_win_size/2, sizeof(char), win_info, shared_comm, &mybase, &win);
/* some processes allocate 1GB and some processes allocate smaller bytes */
if (shared_rank % 2 == 0)
MPI_Win_allocate_shared(shm_win_size, sizeof(char), win_info, shared_comm, &mybase, &win);
else
MPI_Win_allocate_shared(shm_win_size/2, sizeof(char), win_info, shared_comm, &mybase, &win);
MPI_Win_free(&win);
MPI_Win_free(&win);
MPI_Comm_free(&shared_comm);
MPI_Comm_free(&shared_comm);
MPI_Info_free(&win_info);
if (i == 0)
MPI_Info_free(&win_info);
}
if (my_rank == 0)
printf(" No Errors\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment