From 4ab20849919766773abd2d4f905de37a3c3e554d Mon Sep 17 00:00:00 2001 From: Mark Berrill Date: Tue, 28 Jan 2014 15:11:19 -0500 Subject: [PATCH] Renaming include folder to common. Adding Communication file to help seperate some of the communication --- CMakeLists.txt | 2 +- cmake/macros.cmake | 1 + {include => common}/Array.cpp | 0 {include => common}/Array.h | 0 common/Communication.cpp | 0 common/Communication.h | 146 ++++++++++++++++++++++++++++++++ {include => common}/Domain.h | 0 {include => common}/PointList.h | 0 {include => common}/pmmc.h | 0 tests/cpu/lb2_Color_wia_mpi.cpp | 129 +--------------------------- tests/gpu/lb2_Color_wia_mpi.cpp | 127 +-------------------------- 11 files changed, 151 insertions(+), 254 deletions(-) rename {include => common}/Array.cpp (100%) rename {include => common}/Array.h (100%) create mode 100644 common/Communication.cpp create mode 100644 common/Communication.h rename {include => common}/Domain.h (100%) rename {include => common}/PointList.h (100%) rename {include => common}/pmmc.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea5c039b..a5a27ef7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ SET( LBPM_LIBS lbpm-wia ) # Add the src directories IF ( NOT ONLY_BUILD_DOCS ) BEGIN_PACKAGE_CONFIG( lbpm-wia ) - ADD_PACKAGE_SUBDIRECTORY( include ) + ADD_PACKAGE_SUBDIRECTORY( common ) IF ( USE_CUDA ) ADD_PACKAGE_SUBDIRECTORY( gpu ) ELSE() diff --git a/cmake/macros.cmake b/cmake/macros.cmake index 2756c025..cb15f757 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -474,6 +474,7 @@ MACRO( ADD_DISTCLEAN ) cpu gpu example + common ) ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution) IF (UNIX) diff --git a/include/Array.cpp b/common/Array.cpp similarity index 100% rename from include/Array.cpp rename to common/Array.cpp diff --git a/include/Array.h b/common/Array.h similarity index 100% rename from include/Array.h rename to common/Array.h diff --git a/common/Communication.cpp b/common/Communication.cpp new file mode 100644 index 00000000..e69de29b diff --git a/common/Communication.h b/common/Communication.h new file mode 100644 index 00000000..398270df --- /dev/null +++ b/common/Communication.h @@ -0,0 +1,146 @@ +#ifndef COMMUNICATION_H_INC +#define COMMUNICATION_H_INC + +// ********** COMMUNICTION ************************************** +/* + //.............................................................. + // Communication helper routines for MPI + //.............................................................. + */ + +using namespace std; + + +//*************************************************************************************** +inline void PackMeshData(int *list, int count, double *sendbuf, DoubleArray &Values){ + // Fill in the phase ID values from neighboring processors + // This packs up the values that need to be sent from one processor to another + int idx,n; + for (idx=0; idx