[mpich] MPICH primary repository branch, master, updated. v3.1b1-99-g269fc33
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via 269fc330d21d8ff49264d57b6dee875a08fa60ef (commit) via 2b572f0cefac0491da025637db31f89b80186bda (commit) from beac0a936b294c39385814ea93640953ae732cd8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/269fc330d21d8ff49264d57b6dee875a08... commit 269fc330d21d8ff49264d57b6dee875a08fa60ef Author: Xin Zhao <[email protected]> Date: Fri Oct 18 20:51:06 2013 -0500 Add a test for allocating 1GB SHM window memory per process. Test MPI_WIN_ALLOCATE and MPI_WIN_ALLOCATE_SHARED when allocating large SHM window memory (1GB) per process. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am index 273d921..b059648 100644 --- a/test/mpi/rma/Makefile.am +++ b/test/mpi/rma/Makefile.am @@ -85,6 +85,7 @@ noinst_PROGRAMS = \ win_shared_noncontig \ win_shared_noncontig_put \ win_zero \ + win_large_shm \ win_dynamic_acc \ get_acc_local \ compare_and_swap \ diff --git a/test/mpi/rma/testlist b/test/mpi/rma/testlist index ccc7aca..84f5646 100644 --- a/test/mpi/rma/testlist +++ b/test/mpi/rma/testlist @@ -70,6 +70,7 @@ win_shared 4 mpiversion=3.0 win_shared_noncontig 4 mpiversion=3.0 win_shared_noncontig_put 4 mpiversion=3.0 win_zero 4 mpiversion=3.0 +win_large_shm 4 mpiversion=3.0 win_dynamic_acc 4 mpiversion=3.0 get_acc_local 1 mpiversion=3.0 linked_list 4 mpiversion=3.0 diff --git a/test/mpi/rma/win_large_shm.c b/test/mpi/rma/win_large_shm.c new file mode 100644 index 0000000..fe730d2 --- /dev/null +++ b/test/mpi/rma/win_large_shm.c @@ -0,0 +1,83 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2001 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +/* test MPI_WIN_ALLOCATE and MPI_WIN_ALLOCATE_SHARED when allocating + SHM memory with size of 1GB per process */ + +#include "mpi.h" +#include <stdlib.h> +#include <stdio.h> + +int main(int argc, char **argv) { + int my_rank, shared_rank; + void *mybase = NULL; + MPI_Win win; + MPI_Info win_info; + MPI_Comm shared_comm; + 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"); + + 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); + + /* 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_allocate_shared(shm_win_size, sizeof(char), win_info, shared_comm, &mybase, &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); + + 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); + + 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); + + 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); + + MPI_Win_free(&win); + + MPI_Comm_free(&shared_comm); + + MPI_Info_free(&win_info); + + if (my_rank == 0) + printf(" No Errors\n"); + + MPI_Finalize(); + + return 0; +} http://git.mpich.org/mpich.git/commitdiff/2b572f0cefac0491da025637db31f89b80... commit 2b572f0cefac0491da025637db31f89b80186bda Author: Xin Zhao <[email protected]> Date: Fri Oct 18 14:29:09 2013 -0500 make MMAP SHM handle as MPI_Aint type. make SHM handle type in MMAP SHM allocation defined as MPI_Aint instead of integer to accomodate allocation of SHM memory with size larger than 2^32. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/src/util/wrappers/mpiu_os_wrappers_pre.h b/src/util/wrappers/mpiu_os_wrappers_pre.h index 8d2c186..44858fe 100644 --- a/src/util/wrappers/mpiu_os_wrappers_pre.h +++ b/src/util/wrappers/mpiu_os_wrappers_pre.h @@ -30,7 +30,7 @@ #ifdef USE_SYSV_SHM typedef int MPIU_SHMW_Lhnd_t; #elif defined USE_MMAP_SHM -typedef int MPIU_SHMW_Lhnd_t; +typedef MPI_Aint MPIU_SHMW_Lhnd_t; #elif defined USE_NT_SHM typedef HANDLE MPIU_SHMW_Lhnd_t; #endif diff --git a/src/util/wrappers/mpiu_shm_wrappers.h b/src/util/wrappers/mpiu_shm_wrappers.h index 02774e4..5e6335b 100644 --- a/src/util/wrappers/mpiu_shm_wrappers.h +++ b/src/util/wrappers/mpiu_shm_wrappers.h @@ -592,7 +592,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ( int offset, int flag) { int mpi_errno = MPI_SUCCESS; - int lhnd = -1, rc = -1; + MPIU_SHMW_Lhnd_t lhnd = -1, rc = -1; if(flag & MPIU_SHMW_FLAG_SHM_CREATE){ char dev_shm_fname[] = "/dev/shm/mpich_shar_tmpXXXXXX"; @@ -610,7 +610,7 @@ static inline int MPIU_SHMW_Seg_create_attach_templ( MPIU_OSW_Strerror(MPIU_OSW_Get_errno())); MPIU_SHMW_Lhnd_set(hnd, lhnd); - rc = (int)lseek(lhnd, seg_sz - 1, SEEK_SET); + rc = (MPIU_SHMW_Lhnd_t)lseek(lhnd, seg_sz - 1, SEEK_SET); MPIU_ERR_CHKANDJUMP1((rc == -1), mpi_errno, MPI_ERR_OTHER, "**lseek", "**lseek %s", MPIU_OSW_Strerror(MPIU_OSW_Get_errno())); ----------------------------------------------------------------------- Summary of changes: src/util/wrappers/mpiu_os_wrappers_pre.h | 2 +- src/util/wrappers/mpiu_shm_wrappers.h | 4 +- test/mpi/rma/Makefile.am | 1 + test/mpi/rma/testlist | 1 + test/mpi/rma/win_large_shm.c | 83 ++++++++++++++++++++++++++++++ 5 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 test/mpi/rma/win_large_shm.c hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org