Skip to content

Commit

Permalink
Merge branch 'development' into bug-118-threadsafety
Browse files Browse the repository at this point in the history
  • Loading branch information
devreal committed Jan 12, 2017
2 parents f7358b0 + 3180ac5 commit 4347086
Show file tree
Hide file tree
Showing 31 changed files with 12,043 additions and 334 deletions.
102 changes: 88 additions & 14 deletions CMakeExt/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,88 @@
# -rdynamic Instructs the linker to add all symbols, not only used ones,
# to the dynamic symbol table

set (DASH_DEVELOPER_COMPILE_FLAGS
"-Weffc++ -Wcast-align -Wcast-qual -Wno-ctor-dtor-privacy "
"-Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations "
"-Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual "
"-Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo "
"-Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor "
"-Wreorder -Wdeprecated -Wno-float-equal")


set (CXX_WARN_FLAG "")
set (CC_WARN_FLAG "")


# The following warning options are intentionally not enabled:
#
# ,--------------------------.-------------------------------------------.
# | Flag | Reason |
# :--------------------------+-------------------------------------------:
# | -Wmissing-declarations | Arguably only relevant for code style |
# | -Wshadow | Very unlikely to cause unintended effects |
# | -Weffc++ | Spurious false positives |
# '--------------------------'-------------------------------------------'

set(ENABLE_DEVELOPER_COMPILER_WARNINGS ${ENABLE_DEVELOPER_COMPILER_WARNINGS}
PARENT_SCOPE)

set(ENABLE_EXTENDED_COMPILER_WARNINGS ${ENABLE_EXTENDED_COMPILER_WARNINGS}
PARENT_SCOPE)

if (ENABLE_DEVELOPER_COMPILER_WARNINGS OR ENABLE_EXTENDED_COMPILER_WARNINGS)

set (DASH_DEVELOPER_CCXX_FLAGS
"${DASH_DEVELOPER_CCXX_FLAGS} -Wcast-align -Wcast-qual")
set (DASH_DEVELOPER_CCXX_FLAGS
"${DASH_DEVELOPER_CCXX_FLAGS} -Wdisabled-optimization -Wformat")
set (DASH_DEVELOPER_CCXX_FLAGS
"${DASH_DEVELOPER_CCXX_FLAGS} -Winit-self -Wopenmp-simd")
set (DASH_DEVELOPER_CCXX_FLAGS
"${DASH_DEVELOPER_CCXX_FLAGS} -Wmissing-include-dirs -Wenum-compare")
set (DASH_DEVELOPER_CCXX_FLAGS
"${DASH_DEVELOPER_CCXX_FLAGS} -Wstrict-overflow=3 -Wswitch")
set (DASH_DEVELOPER_CCXX_FLAGS
"${DASH_DEVELOPER_CCXX_FLAGS} -Wunused -Wtrigraphs")
set (DASH_DEVELOPER_CCXX_FLAGS
"${DASH_DEVELOPER_CCXX_FLAGS} -Wdeprecated -Wno-float-equal")

# C++-only warning flags

set (DASH_DEVELOPER_CXX_FLAGS "${DASH_DEVELOPER_CCXX_FLAGS}")

set (DASH_DEVELOPER_CXX_FLAGS
"${DASH_DEVELOPER_CXX_FLAGS} -Wno-ctor-dtor-privacy")

if (ENABLE_EXTENDED_COMPILER_WARNINGS)
# this flag causes warnings on DASH_ASSERT_RETURNS
set (DASH_DEVELOPER_CXX_FLAGS
"${DASH_DEVELOPER_CXX_FLAGS} -Wsign-promo")
# this flag might help spot overflows in index computation but is too verbose in general
set (DASH_DEVELOPER_CXX_FLAGS
"${DASH_DEVELOPER_CXX_FLAGS} -Wstrict-overflow=3")
# some good hints, but too style-related to be used in general
set (DASH_DEVELOPER_CXX_FLAGS
"${DASH_DEVELOPER_CXX_FLAGS} -Weffc++")
endif()

set (DASH_DEVELOPER_CXX_FLAGS
"${DASH_DEVELOPER_CXX_FLAGS} -Wreorder -Wnon-virtual-dtor")
set (DASH_DEVELOPER_CXX_FLAGS
"${DASH_DEVELOPER_CXX_FLAGS} -Woverloaded-virtual")

# C-only warning flags

set (DASH_DEVELOPER_CC_FLAGS "${DASH_DEVELOPER_CCXX_FLAGS}")

set (DASH_DEVELOPER_CC_FLAGS
"${DASH_DEVELOPER_CC_FLAGS} -Wbad-function-cast -Wc99-c11-compat")
set (DASH_DEVELOPER_CC_FLAGS
"${DASH_DEVELOPER_CC_FLAGS} -Wnested-externs")
set (DASH_DEVELOPER_CC_FLAGS
"${DASH_DEVELOPER_CC_FLAGS} -Wmissing-parameter-type -Wpointer-sign")
set (DASH_DEVELOPER_CC_FLAGS
"${DASH_DEVELOPER_CC_FLAGS} -Wmissing-declarations")

endif()


set (CC_WARN_FLAG "${DASH_DEVELOPER_CC_FLAGS}")
set (CXX_WARN_FLAG "${DASH_DEVELOPER_CXX_FLAGS}")

if (ENABLE_COMPILER_WARNINGS)
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Cray")
# Flags for C and C++:
set (CXX_WARN_FLAG "-Wall -Wextra -pedantic")
set (CXX_WARN_FLAG "${CXX_WARN_FLAG} -Wall -Wextra -Wpedantic")
set (CXX_WARN_FLAG "${CXX_WARN_FLAG} -Wno-unused-function")
set (CXX_WARN_FLAG "${CXX_WARN_FLAG} -Wno-missing-braces")
set (CXX_WARN_FLAG "${CXX_WARN_FLAG} -Wno-format")
Expand Down Expand Up @@ -86,6 +153,13 @@ elseif ("${CMAKE_C_COMPILER_ID}" MATCHES "Cray")
CACHE STRING "C compiler std flag")
endif()


set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -Wa,-adhln=test-O3.s -g -fverbose-asm -masm=intel")

set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_DEBUG} -Wa,-adhln=test-O3.s -g -fverbose-asm -masm=intel")

set(CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} ${CC_ENV_SETUP_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG
Expand All @@ -98,12 +172,12 @@ set(CMAKE_CXX_FLAGS_RELEASE
set(CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} ${CC_STD_FLAG} ${CXX_OMP_FLAG} ${CC_REPORT_FLAG} ${CC_WARN_FLAG} -O0 -DDASH_DEBUG ${CC_GDB_FLAG}")
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} ${CXX_STD_FLAG} ${CXX_OMP_FLAG} ${CC_REPORT_FLAG} ${CC_WARN_FLAG} -O0 -DDASH_DEBUG ${CXX_GDB_FLAG}")
"${CMAKE_CXX_FLAGS_DEBUG} ${CXX_STD_FLAG} ${CXX_OMP_FLAG} ${CC_REPORT_FLAG} ${CXX_WARN_FLAG} -O0 -DDASH_DEBUG ${CXX_GDB_FLAG}")

set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} ${CC_STD_FLAG} ${CXX_OMP_FLAG} ${CXX_LTO_FLAG} ${CC_REPORT_FLAG} ${CC_WARN_FLAG} -Ofast -DDASH_RELEASE")
set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${CXX_STD_FLAG} ${CXX_OMP_FLAG} ${CXX_LTO_FLAG} ${CC_REPORT_FLAG} ${CC_WARN_FLAG} -Ofast -DDASH_RELEASE")
"${CMAKE_CXX_FLAGS_RELEASE} ${CXX_STD_FLAG} ${CXX_OMP_FLAG} ${CXX_LTO_FLAG} ${CC_REPORT_FLAG} ${CXX_WARN_FLAG} -Ofast -DDASH_RELEASE")

if (BUILD_COVERAGE_TESTS)
# Profiling is only supported for Debug builds:
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ option(BUILD_DOCS
"Whether doxygen documentation should be installed" off)
option(BUILD_EXAMPLES
"Specify whether to build examples" on)
option(ENABLE_COMPILER_WARNINGS
"Specify whether strict compiler warnings should be enabled" on)
option(ENABLE_DEVELOPER_COMPILER_WARNINGS
"Specify whether excessive compiler warnings should be enabled" off)
option(WARNINGS_AS_ERRORS
"Specify whether warnings should be treated as errors" off)
option(ENABLE_LT_OPTIMIZATION
"Specify whether link-time-optimization should be used" off)
option(ENABLE_CC_REPORTS
"Specify whether compiler reports should be generated" on)
option(ENABLE_COMPTIME_RED
"Specify whether opts to reduce the build time should be used" ${DEFAULT_COMPTIME_RED})
"Specify whether opts to reduce the build time should be used"
${DEFAULT_COMPTIME_RED})
option(ENABLE_LOGGING
"Specify whether logging should be enabled" off)
option(ENABLE_TEST_LOGGING
Expand Down
2 changes: 1 addition & 1 deletion build.cov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ rm -Rf $BUILD_DIR/*
-DDART_IF_VERSION=3.2 \
-DINSTALL_PREFIX=$HOME/opt/dash-0.3.0/ \
-DDART_IMPLEMENTATIONS=mpi \
-DENABLE_COMPILER_WARNINGS=ON \
-DENABLE_DEVELOPER_COMPILER_WARNINGS=OFF \
-DENABLE_LT_OPTIMIZATION=OFF \
-DENABLE_ASSERTIONS=ON \
\
Expand Down
3 changes: 2 additions & 1 deletion build.dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ rm -Rf $BUILD_DIR/*
-DDART_IMPLEMENTATIONS=mpi \
-DENABLE_ASSERTIONS=ON \
-DENABLE_LT_OPTIMIZATION=OFF \
-DENABLE_COMPILER_WARNINGS=ON \
-DENABLE_DEVELOPER_COMPILER_WARNINGS=ON \
-DENABLE_EXTENDED_COMPILER_WARNINGS=ON \
\
-DENABLE_SHARED_WINDOWS=ON \
-DENABLE_UNIFIED_MEMORY_MODEL=ON \
Expand Down
3 changes: 2 additions & 1 deletion build.mic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ rm -Rf $BUILD_DIR/*
-DDART_IF_VERSION=3.2 \
-DINSTALL_PREFIX=$HOME/opt/dash-0.3.0-mic/ \
-DDART_IMPLEMENTATIONS=mpi \
-DENABLE_COMPILER_WARNINGS=ON \
-DENABLE_DEVELOPER_COMPILER_WARNINGS=OFF \
-DENABLE_EXTENDED_COMPILER_WARNINGS=OFF \
-DENABLE_ASSERTIONS=OFF \
\
-DENABLE_SHARED_WINDOWS=ON \
Expand Down
3 changes: 2 additions & 1 deletion build.minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ rm -Rf $BUILD_DIR/*
-DDART_IF_VERSION=3.2 \
-DINSTALL_PREFIX=$HOME/opt/dash-0.3.0/ \
-DDART_IMPLEMENTATIONS=mpi \
-DENABLE_COMPILER_WARNINGS=ON \
-DENABLE_DEVELOPER_COMPILER_WARNINGS=OFF \
-DENABLE_EXTENDED_COMPILER_WARNINGS=OFF \
-DENABLE_LT_OPTIMIZATION=OFF \
-DENABLE_ASSERTIONS=ON \
\
Expand Down
3 changes: 2 additions & 1 deletion build.nasty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ rm -Rf $BUILD_DIR/*
-DDART_IF_VERSION=3.2 \
-DINSTALL_PREFIX=$HOME/opt/dash-0.3.0-nasty \
-DDART_IMPLEMENTATIONS=mpi \
-DENABLE_COMPILER_WARNINGS=ON \
-DENABLE_DEVELOPER_COMPILER_WARNINGS=OFF \
-DENABLE_EXTENDED_COMPILER_WARNINGS=OFF \
-DENABLE_LT_OPTIMIZATION=OFF \
-DENABLE_ASSERTIONS=ON \
\
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ rm -Rf $BUILD_DIR/*
-DDART_IF_VERSION=3.2 \
-DINSTALL_PREFIX=$HOME/opt/dash-0.3.0/ \
-DDART_IMPLEMENTATIONS=mpi \
-DENABLE_COMPILER_WARNINGS=ON \
-DENABLE_DEVELOPER_COMPILER_WARNINGS=OFF \
-DENABLE_EXTENDED_COMPILER_WARNINGS=OFF \
-DENABLE_LT_OPTIMIZATION=OFF \
-DENABLE_ASSERTIONS=ON \
\
Expand Down
6 changes: 3 additions & 3 deletions dart-if/v3.2/include/dash/dart/if/dart_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ typedef enum


#if (UINT32_MAX == SIZE_MAX)
#define DART_TYPE_SIZET DART_TYPE_UINT
# define DART_TYPE_SIZET DART_TYPE_UINT
#elif (UINT64_MAX == SIZE_MAX)
#define DART_TYPE_SIZET DART_TYPE_LONGLONG
# define DART_TYPE_SIZET DART_TYPE_LONGLONG
#else
#error "Cannot determine DART type for size_t!"
# error "Cannot determine DART type for size_t!"
#endif


Expand Down
4 changes: 2 additions & 2 deletions dart-impl/base/src/internal/domain_locality.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ dart_ret_t dart__base__locality__domain__parent(
subdomains_prefix[subdomains_prefix_len] = '\0';
}
if (subdomains_prefix_len == 0) {
*domain_out = (dart_domain_locality_t *)(domain_in);
*domain_out = (const dart_domain_locality_t *)(domain_in);
return DART_OK;
}

Expand Down Expand Up @@ -665,7 +665,7 @@ dart_ret_t dart__base__locality__domain__create_module_subdomains(
module_domain->num_units, module_domain->global_index);

DART_LOG_TRACE_ARRAY(
"dart__base__locality__domain__create_module_subdomains", "%d",
"dart__base__locality__domain__create_module_subdomains", "%lu",
module_domain->unit_ids, module_domain->num_units);
/*
* NOTE: Locality scopes may be heterogeneous but are expected
Expand Down
55 changes: 8 additions & 47 deletions dart-impl/mpi/include/dash/dart/mpi/dart_team_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,53 +183,6 @@ typedef struct dart_team_data {
extern dart_team_data_t dart_team_data[DART_MAX_TEAM_NUMBER];



#if 0

/* @brief Translate the given teamid (indicated uniquely by the index) into its corresponding communicator.
*
* After locating the given teamid in the teamlist,
* we find that teamlist[i] equals to teamid, which means teams[i]
* will be the corresponding communicator of teamid.
*/
extern MPI_Comm dart_teams[DART_MAX_TEAM_NUMBER];

/* @brief Store the sub-communicator with regard to certain node, where the units can
* communicate via shared memory.
*
* The units running in certain node vary
* according to the specified team.
* The values of dart_sharedmem_comm_list[i] are different for the units belonging to different nodes.
*/
#if !defined(DART_MPI_DISABLE_SHARED_WINDOWS)
extern MPI_Comm dart_sharedmem_comm_list[DART_MAX_TEAM_NUMBER];

/* @brief Sets of units who are located in the same node for each unit in MAX_TEAM_NUMBER teams.
*
* Each element of this array will relate to certain team A.
* Set of units belonging to the same node vary for different team.
* Each unit stores all the IDs of those units (including itself) who are parts of team A and
* located in the same node as it is.
*/
//extern int* dart_unit_mapping[MAX_TEAM_NUMBER];

/* @brief This table is represented as a hash table
* , which is used to determine the units who are located in the same node.
*
* Each element of this array will relate to certain team.
*/
extern int* dart_sharedmem_table[DART_MAX_TEAM_NUMBER];

/* @brief Set of the size of node for each unit in MAX_TEAM_NUMBER teams.
*/
extern int dart_sharedmemnode_size[DART_MAX_TEAM_NUMBER];
#endif

/* @brief Set of MPI dynamic window objects corresponding to MAX_TEAM_NUMBER teams. */
extern MPI_Win dart_win_lists[DART_MAX_TEAM_NUMBER];

#endif // 0

#if !defined(DART_MPI_DISABLE_SHARED_WINDOWS)

extern char* *dart_sharedmem_local_baseptr_set;
Expand Down Expand Up @@ -270,5 +223,13 @@ int dart_adapt_teamlist_recycle(uint16_t index, int pos);
*/
int dart_adapt_teamlist_convert (dart_team_t teamid, uint16_t* index);

#if !defined(DART_MPI_DISABLE_SHARED_WINDOWS)
/*
* Allocate shared memory communicator for the given \c team_data.
* Shared between \c dart_initialize and \c dart_team_create.
*/
dart_ret_t dart_allocate_shared_comm(dart_team_data_t *team_data);
#endif // !defined(DART_MPI_DISABLE_SHARED_WINDOWS)

#endif /*DART_ADAPT_TEAMNODE_H_INCLUDED*/

Loading

0 comments on commit 4347086

Please sign in to comment.