Skip to content

Commit b7fdd9b

Browse files
committed
Merging from master
2 parents c8d73b9 + 1794ba7 commit b7fdd9b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+6240
-5448
lines changed

.clang-format

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
BasedOnStyle: LLVM
3+
UseTab: Never
4+
IndentWidth: 4
5+
TabWidth: 4
6+
BreakBeforeBraces: Linux
7+
AllowShortIfStatementsOnASingleLine: false
8+
IndentCaseLabels: true
9+
IndentGotoLabels: false
10+
IndentPPDirectives: AfterHash
11+
ColumnLimit: 80
12+
AccessModifierOffset: -4
13+
AlignAfterOpenBracket: DontAlign
14+
AlignConsecutiveMacros: true
15+
AlwaysBreakAfterReturnType: All
16+
SpaceAfterCStyleCast: true
17+
ForEachMacros: ['HG_QUEUE_FOREACH', 'HG_LIST_FOREACH']
18+
...

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
.vscode

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ cache:
1414
- $HOME/install
1515

1616
env:
17-
global:
18-
- MERCURY_NO_LOOP="true"
1917
jobs:
2018
- MERCURY_BUILD_CONFIGURATION="Debug"
2119
- MERCURY_BUILD_CONFIGURATION="RelWithDebInfo"
@@ -35,7 +33,7 @@ jobs:
3533
- libtsan0
3634
- libasan5
3735
- liblsan0
38-
env: MERCURY_MEMORYCHECK_TYPE="ThreadSanitizer"
36+
env: MERCURY_BUILD_CONFIGURATION="Tsan"
3937
- os: linux
4038
compiler: gcc
4139
addons:
@@ -48,7 +46,7 @@ jobs:
4846
- libtsan0
4947
- libasan5
5048
- liblsan0
51-
env: MERCURY_MEMORYCHECK_TYPE="AddressSanitizer"
49+
env: MERCURY_BUILD_CONFIGURATION="Asan"
5250
- os: linux
5351
compiler: gcc
5452
addons:
@@ -65,6 +63,7 @@ branches:
6563
- master
6664

6765
before_install:
66+
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then git fetch origin pull/${TRAVIS_PULL_REQUEST}/head:pr${TRAVIS_PULL_REQUEST}; git checkout pr${TRAVIS_PULL_REQUEST}; fi
6867
- echo "Existing directories in $HOME" && ls $HOME
6968
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
7069
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask uninstall --force oclint; fi

CMake/CheckAsan.cmake

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
set(ASAN_FLAG "-fsanitize=address")
2+
set(ASAN_C_FLAGS "-O1 -g ${ASAN_FLAG} -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-optimize-sibling-calls")
3+
set(ASAN_CXX_FLAGS ${ASAN_C_FLAGS})
4+
5+
get_property(ASAN_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
6+
foreach(lang ${ASAN_LANGUAGES})
7+
set(ASAN_${lang}_LANG_ENABLED 1)
8+
endforeach()
9+
10+
if(ASAN_C_LANG_ENABLED)
11+
include(CheckCCompilerFlag)
12+
set(CMAKE_REQUIRED_LINK_OPTIONS ${ASAN_FLAG})
13+
check_c_compiler_flag(${ASAN_FLAG} ASAN_C_FLAG_SUPPORTED)
14+
if(NOT ASAN_C_FLAG_SUPPORTED)
15+
message(STATUS "Asan flags are not supported by the C compiler.")
16+
else()
17+
if(NOT CMAKE_C_FLAGS_ASAN)
18+
set(CMAKE_C_FLAGS_ASAN ${ASAN_C_FLAGS} CACHE STRING "Flags used by the C compiler during ASAN builds." FORCE)
19+
endif()
20+
endif()
21+
unset(CMAKE_REQUIRED_LINK_OPTIONS)
22+
endif()
23+
24+
if(ASAN_CXX_LANG_ENABLED)
25+
include(CheckCXXCompilerFlag)
26+
set(CMAKE_REQUIRED_LINK_OPTIONS ${ASAN_FLAG})
27+
check_cxx_compiler_flag(${ASAN_FLAG} ASAN_CXX_FLAG_SUPPORTED)
28+
if(NOT ASAN_CXX_FLAG_SUPPORTED)
29+
message(STATUS "Asan flags are not supported by the CXX compiler.")
30+
else()
31+
if(NOT CMAKE_CXX_FLAGS_ASAN)
32+
set(CMAKE_CXX_FLAGS_ASAN ${ASAN_CXX_FLAGS} CACHE STRING "Flags used by the CXX compiler during ASAN builds." FORCE)
33+
endif()
34+
endif()
35+
unset(CMAKE_REQUIRED_LINK_OPTIONS)
36+
endif()
37+

CMake/CheckTsan.cmake

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
set(TSAN_FLAG "-fsanitize=thread")
2+
set(TSAN_C_FLAGS "-O1 -g ${TSAN_FLAG}")
3+
set(TSAN_CXX_FLAGS ${TSAN_C_FLAGS})
4+
5+
get_property(TSAN_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
6+
foreach(lang ${TSAN_LANGUAGES})
7+
set(TSAN_${lang}_LANG_ENABLED 1)
8+
endforeach()
9+
10+
if(TSAN_C_LANG_ENABLED)
11+
include(CheckCCompilerFlag)
12+
set(CMAKE_REQUIRED_LINK_OPTIONS ${TSAN_FLAG})
13+
check_c_compiler_flag(${TSAN_FLAG} TSAN_C_FLAG_SUPPORTED)
14+
if(NOT TSAN_C_FLAG_SUPPORTED)
15+
message(STATUS "Asan flags are not supported by the C compiler.")
16+
else()
17+
if(NOT CMAKE_C_FLAGS_TSAN)
18+
set(CMAKE_C_FLAGS_TSAN ${TSAN_C_FLAGS} CACHE STRING "Flags used by the C compiler during TSAN builds." FORCE)
19+
endif()
20+
endif()
21+
unset(CMAKE_REQUIRED_LINK_OPTIONS)
22+
endif()
23+
24+
if(TSAN_CXX_LANG_ENABLED)
25+
include(CheckCXXCompilerFlag)
26+
set(CMAKE_REQUIRED_LINK_OPTIONS ${TSAN_FLAG})
27+
check_cxx_compiler_flag(${TSAN_FLAG} TSAN_CXX_FLAG_SUPPORTED)
28+
if(NOT TSAN_CXX_FLAG_SUPPORTED)
29+
message(STATUS "Asan flags are not supported by the CXX compiler.")
30+
else()
31+
if(NOT CMAKE_CXX_FLAGS_TSAN)
32+
set(CMAKE_CXX_FLAGS_TSAN ${TSAN_CXX_FLAGS} CACHE STRING "Flags used by the CXX compiler during TSAN builds." FORCE)
33+
endif()
34+
endif()
35+
unset(CMAKE_REQUIRED_LINK_OPTIONS)
36+
endif()
37+

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,18 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
138138
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
139139
# Set the possible values of build type for cmake-gui
140140
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
141-
"MinSizeRel" "RelWithDebInfo")
141+
"MinSizeRel" "RelWithDebInfo" "Asan" "Tsan")
142142
endif()
143143

144144
if(NOT CMAKE_C_FLAGS AND CMAKE_COMPILER_IS_GNUCC)
145145
message(STATUS "GCC detected, setting additional flags")
146146
set(CMAKE_C_FLAGS "-Wall -Wextra -Winline -Wcast-qual -std=gnu99 -Wshadow" CACHE STRING "Flags used by the compiler during all build types." FORCE)
147147
endif()
148148

149+
# Detect Asan and Tsan compiler flags
150+
include(CheckAsan)
151+
include(CheckTsan)
152+
149153
#-----------------------------------------------------------------------------
150154
# Targets built within this project are exported at Install time for use
151155
# by other projects.
@@ -212,10 +216,12 @@ function(mercury_set_lib_options libtarget libname libtype)
212216

213217
set_target_properties(${libtarget}
214218
PROPERTIES
215-
DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME}
216-
RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME}
217-
MINSIZEREL_OUTPUT_NAME ${LIB_RELEASE_NAME}
218-
RELWITHDEBINFO_OUTPUT_NAME ${LIB_RELEASE_NAME}
219+
OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME}
220+
OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME}
221+
OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME}
222+
OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME}
223+
OUTPUT_NAME_ASAN ${LIB_DEBUG_NAME}
224+
OUTPUT_NAME_TSAN ${LIB_DEBUG_NAME}
219225
VERSION ${LIB_VERSION}
220226
SOVERSION ${API_VERSION}
221227
)

CTestConfig.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
set(CTEST_PROJECT_NAME "MERCURY")
99
set(CTEST_NIGHTLY_START_TIME "00:00:00 CST")
1010

11-
set(CTEST_DROP_METHOD "http")
12-
set(CTEST_DROP_SITE "149.28.123.102/CDash")
11+
set(CTEST_DROP_METHOD "https")
12+
set(CTEST_DROP_SITE "mercury-cdash.hdfgroup.org")
1313
set(CTEST_DROP_LOCATION "/submit.php?project=Mercury")
1414
set(CTEST_DROP_SITE_CDASH TRUE)
1515

Testing/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ set(MERCURY_TESTS
305305
rpc
306306
bulk
307307
)
308+
build_mercury_test(lookup)
308309

309310
# List of serial tests
310311
set(MERCURY_SERIAL_TESTS

Testing/driver/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
22
project(MERCURY_TEST_DRIVER CXX)
33

4+
include(CheckAsan)
5+
include(CheckTsan)
6+
47
set(KWSYS_NAMESPACE mercury_sys)
58
set(KWSYS_USE_SystemTools 1)
69
set(KWSYS_USE_Process 1)

Testing/mercury_test.c

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
/* Local Type and Struct Definition */
2828
/************************************/
2929

30-
struct hg_test_lookup_arg {
31-
hg_addr_t *addr_ptr;
32-
hg_request_t *request;
33-
};
34-
3530
/********************/
3631
/* Local Prototypes */
3732
/********************/
@@ -54,9 +49,6 @@ static hg_return_t
5449
hg_test_handle_create_cb(hg_handle_t handle, void *arg);
5550
#endif
5651

57-
static hg_return_t
58-
hg_test_addr_lookup_cb(const struct hg_cb_info *callback_info);
59-
6052
static hg_return_t
6153
hg_test_finalize_rpc(struct hg_test_info *hg_test_info, hg_uint8_t target_id);
6254

@@ -205,20 +197,6 @@ hg_test_handle_create_cb(hg_handle_t handle, void *arg)
205197
}
206198
#endif
207199

208-
/*---------------------------------------------------------------------------*/
209-
static hg_return_t
210-
hg_test_addr_lookup_cb(const struct hg_cb_info *callback_info)
211-
{
212-
struct hg_test_lookup_arg *request_args =
213-
(struct hg_test_lookup_arg *) callback_info->arg;
214-
215-
*request_args->addr_ptr = callback_info->info.lookup.addr;
216-
217-
hg_request_complete(request_args->request);
218-
219-
return HG_SUCCESS;
220-
}
221-
222200
/*---------------------------------------------------------------------------*/
223201
static hg_return_t
224202
hg_test_finalize_rpc(struct hg_test_info *hg_test_info, hg_uint8_t target_id)
@@ -559,9 +537,6 @@ HG_Test_init(int argc, char *argv[], struct hg_test_info *hg_test_info)
559537
HG_Error_to_string(ret));
560538
} else {
561539
char test_addr_name[NA_TEST_MAX_ADDR_NAME] = { '\0' };
562-
hg_request_t *request = NULL;
563-
unsigned int flag = 0;
564-
struct hg_test_lookup_arg lookup_args;
565540

566541
#ifdef HG_TEST_HAS_PARALLEL
567542
/* If static client must wait for server to write config file */
@@ -582,25 +557,11 @@ HG_Test_init(int argc, char *argv[], struct hg_test_info *hg_test_info)
582557
printf("# Target name read: %s\n",
583558
hg_test_info->na_test_info.target_name);
584559

585-
/* Look up target addr using target name info */
586-
request = hg_request_create(hg_test_info->request_class);
587-
lookup_args.addr_ptr = &hg_test_info->target_addr;
588-
lookup_args.request = request;
589-
590560
/* Forward call to remote addr and get a new request */
591-
ret = HG_Addr_lookup(hg_test_info->context, hg_test_addr_lookup_cb,
592-
&lookup_args, hg_test_info->na_test_info.target_name,
593-
HG_OP_ID_IGNORE);
561+
ret = HG_Addr_lookup2(hg_test_info->hg_class,
562+
hg_test_info->na_test_info.target_name, &hg_test_info->target_addr);
594563
HG_TEST_CHECK_HG_ERROR(done, ret, "HG_Addr_lookup() failed (%s)",
595564
HG_Error_to_string(ret));
596-
597-
/* Wait for request to be marked completed */
598-
hg_request_wait(request, HG_MAX_IDLE_TIME, &flag);
599-
HG_TEST_CHECK_ERROR(flag == 0, done, ret, HG_TIMEOUT,
600-
"Operation did not complete");
601-
602-
/* Free request */
603-
hg_request_destroy(request);
604565
}
605566

606567
done:

0 commit comments

Comments
 (0)