Skip to content

Commit 2ac948c

Browse files
authored
Merge pull request #1663 from DARMA-tasking/develop
Merge recent changes to release branch
2 parents eb8bccd + 176190c commit 2ac948c

Some content is hidden

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

68 files changed

+880
-277
lines changed

ci/azure/azure-gcc-7-ubuntu-mpich.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ stages:
6969
- job: Build
7070
displayName: Build
7171
pool:
72-
name: 'vt-agent-pool'
72+
vmImage: 'ubuntu-18.04'
7373
timeoutInMinutes: 180
7474
steps:
7575
- task: Bash@3
7676
displayName: Job setup
7777
inputs:
7878
targetType: 'inline'
7979
script: |
80-
source /etc/docker-setup.sh
80+
echo setup
8181
- task: Bash@3
8282
displayName: Build timestamp for caching
8383
continueOnError: true
@@ -134,14 +134,14 @@ stages:
134134
containerregistrytype: 'Container Registry'
135135
dockerComposeFile: '**/docker-compose.yml'
136136
action: 'Run a Docker Compose command'
137-
dockerComposeCommand: '$(compose_command) ubuntu-cpp-clean'
137+
dockerComposeCommand: '$(compose_command) ubuntu-cpp-clean-noinstall'
138138
- task: DockerCompose@0
139139
displayName: Build container
140140
inputs:
141141
containerregistrytype: 'Container Registry'
142142
dockerComposeFile: '**/docker-compose.yml'
143143
action: 'Run a Docker Compose command'
144-
dockerComposeCommand: 'run ubuntu-cpp-clean'
144+
dockerComposeCommand: 'run ubuntu-cpp-clean-noinstall'
145145
env:
146146
CODECOV_TOKEN: $(codecov_token)
147147
- task: Bash@3
@@ -172,7 +172,7 @@ stages:
172172
dockerRegistryEndpoint: 'dockerRegistryConnection1'
173173
dockerComposeFile: '**/docker-compose.yml'
174174
action: 'Run a Docker Compose command'
175-
dockerComposeCommand: 'push ubuntu-cpp-clean'
175+
dockerComposeCommand: 'push ubuntu-cpp-clean-noinstall'
176176
- task: Bash@3
177177
displayName: Create artifacts
178178
continueOnError: true

ci/build_cpp.sh

-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ then
156156
git checkout master
157157
cd ../
158158

159-
sed -i 's/assert len(self.children) < 16 and len(self.results) < 2048/\#removed assertion/' ./m.css/documentation/_search.py
160-
161159
"$MCSS/documentation/doxygen.py" Doxyfile-mcss
162160
cp -R docs "$GHPAGE"
163161
cd "$GHPAGE"

cmake-modules/SetCXXCompilerFlags.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ elseif (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
2323
endif ()
2424

2525
if (vt_asan_enabled)
26-
list(APPEND TARGET_PUBLIC_CXX_FLAGS -fsanitize=address -fno-omit-frame-pointer)
26+
list(APPEND TARGET_PUBLIC_CXX_FLAGS -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls)
2727
endif()
2828

2929
if (vt_ubsan_enabled)

cmake/link_vt.cmake

+10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function(link_target_with_vt)
2424
LINK_ATOMIC
2525
LINK_MPI
2626
LINK_FMT
27+
LINK_ENG_FORMAT
2728
LINK_ZLIB
2829
LINK_FCONTEXT
2930
LINK_CHECKPOINT
@@ -163,6 +164,15 @@ function(link_target_with_vt)
163164
)
164165
endif()
165166

167+
if (NOT DEFINED ARG_LINK_ENG_FORMAT AND ${ARG_DEFAULT_LINK_SET} OR ARG_LINK_ENG_FORMAT)
168+
if (${ARG_DEBUG_LINK})
169+
message(STATUS "link_target_with_vt: EngFormat-Cpp=${ARG_LINK_ENG_FORMAT}")
170+
endif()
171+
target_link_libraries(
172+
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${ENG_FORMAT_LIBRARY}
173+
)
174+
endif()
175+
166176
if (NOT DEFINED ARG_LINK_CHECKPOINT AND ${ARG_DEFAULT_LINK_SET} OR ARG_LINK_CHECKPOINT)
167177
if (${ARG_DEBUG_LINK})
168178
message(STATUS "link_target_with_vt: checkpoint=${ARG_LINK_CHECKPOINT}")

cmake/load_bundled_libraries.cmake

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ add_subdirectory(${PROJECT_LIB_DIR}/CLI)
2323
set(FMT_LIBRARY fmt)
2424
add_subdirectory(${PROJECT_LIB_DIR}/fmt)
2525

26+
# EngFormat-Cpp always included in the build
27+
set(ENG_FORMAT_LIBRARY EngFormat-Cpp)
28+
add_subdirectory(${PROJECT_LIB_DIR}/EngFormat-Cpp)
29+
2630
# json library always included in the build
2731
set(JSON_BuildTests OFF)
2832
set(JSON_MultipleHeaders ON)
@@ -52,15 +56,15 @@ if (vt_asan_enabled)
5256
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR
5357
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
5458
CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
55-
message(STATUS "Building with address sanitizer enabled")
59+
message(STATUS "Building VT with AddressSanitizer enabled")
5660
endif()
5761
endif()
5862

5963
if (vt_ubsan_enabled)
6064
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR
6165
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
6266
CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
63-
message(STATUS "Building with undefined behavior sanitizer enabled")
67+
message(STATUS "Building VT with UndefinedBehaviorSanitizer enabled")
6468
else()
6569
message(SEND_ERROR "Cannot use UBSan without clang or gcc >= 4.8")
6670
endif()

cmake/trace_only_functions.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ function(create_trace_only_target)
9898
DESTINATION "include/vt-trace/fmt"
9999
)
100100

101+
install(
102+
FILES "${CMAKE_CURRENT_SOURCE_DIR}/../lib/EngFormat-Cpp/include/EngFormat-Cpp/eng_format.hpp"
103+
DESTINATION "include/vt-trace/EngFormat-Cpp"
104+
)
105+
101106
set(VT_TRACE_LIB vt-trace CACHE INTERNAL "" FORCE)
102107
add_library(
103108
${VT_TRACE_LIB}
@@ -114,6 +119,7 @@ function(create_trace_only_target)
114119
TARGET ${VT_TRACE_LIB}
115120
LINK_VT_LIB
116121
LINK_FMT 1
122+
LINK_ENG_FORMAT 1
117123
LINK_ZLIB 1
118124
LINK_MPI 1
119125
)

docker-compose.yml

+26
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,32 @@ services:
223223
/vt/ci/build_vt_sample.sh /vt /build &&
224224
/vt/ci/clean_cpp.sh /vt /build"
225225

226+
##############################################################################
227+
# C++ build/test/clean target for VT on ubuntu platform from container
228+
# baseline without installing.
229+
#
230+
# Example:
231+
# docker-compose run ubuntu-cpp-clean-noinstall
232+
ubuntu-cpp-clean-noinstall:
233+
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${COMPILER}-cpp
234+
build:
235+
context: .
236+
target: base
237+
dockerfile: ci/docker/ubuntu-${UBUNTU}-${COMPILER_TYPE}-cpp.dockerfile
238+
cache_from:
239+
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${COMPILER}-cpp
240+
args: *default-args
241+
ulimits: *ulimits
242+
environment:
243+
<<: *ccache
244+
<<: *vtopts
245+
volumes: *ubuntu-volumes
246+
command: &vt-build-test-clean-noinstall-cpp-command >
247+
/bin/bash -c "
248+
/vt/ci/build_cpp.sh /vt /build all &&
249+
/vt/ci/test_cpp.sh /vt /build &&
250+
/vt/ci/clean_cpp.sh /vt /build"
251+
226252
##############################################################################
227253
# Interactive C++ setup of VT on ubuntu platform from container baseline.
228254
#

examples/collection/lb_iter.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ int main(int argc, char** argv) {
124124
.wait();
125125

126126
for (int i = 0; i < num_iter; i++) {
127-
auto cur_time = vt::timing::Timing::getCurrentTime();
127+
auto cur_time = vt::timing::getCurrentTime();
128128

129129
vt::runInEpochCollective([=]{
130130
proxy.broadcastCollective<IterCol::IterMsg,&IterCol::iterWork>(10, i);
131131
});
132132

133-
auto total_time = vt::timing::Timing::getCurrentTime() - cur_time;
133+
auto total_time = vt::timing::getCurrentTime() - cur_time;
134134
if (this_node == 0) {
135135
fmt::print("iteration: iter={},time={}\n", i, total_time);
136136
}

lib/EngFormat-Cpp/CMakeLists.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
project(EngFormat-Cpp CXX)
2+
cmake_minimum_required(VERSION 3.0)
3+
4+
add_library(${PROJECT_NAME} include/EngFormat-Cpp/eng_format.hpp src/eng_format.cpp)
5+
6+
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
7+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
8+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
9+
10+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
11+
include(CTest)
12+
if(BUILD_TESTING)
13+
target_compile_definitions(${PROJECT_NAME} PRIVATE ENG_FORMAT_MICRO_GLYPH="u")
14+
add_subdirectory(test)
15+
endif()
16+
endif()
17+
18+
install(
19+
DIRECTORY include/EngFormat-Cpp
20+
DESTINATION include
21+
CONFIGURATIONS ${build_type_list}
22+
FILES_MATCHING PATTERN "*"
23+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// Copyright (C) 2005-2009 by Jukka Korpela
2+
// Copyright (C) 2009-2013 by David Hoerl
3+
// Copyright (C) 2013 by Martin Moene
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
23+
#ifndef ENG_FORMAT_H_INCLUDED
24+
#define ENG_FORMAT_H_INCLUDED
25+
26+
#include <string>
27+
28+
/**
29+
* convert a double to the specified number of digits in SI (prefix) or
30+
* exponential notation, optionally followed by a unit.
31+
*/
32+
std::string
33+
to_engineering_string( double value, int digits, bool exponential, std::string unit = "", std::string separator = " " );
34+
35+
/**
36+
* convert the output of to_engineering_string() into a double.
37+
*/
38+
double
39+
from_engineering_string( std::string text );
40+
41+
/**
42+
* step a value by the smallest possible increment.
43+
*/
44+
std::string
45+
step_engineering_string( std::string text, int digits, bool exponential, bool increment );
46+
47+
//
48+
// Extended interface:
49+
//
50+
51+
/**
52+
* \var eng_prefixed
53+
* \brief select SI (prefix) presentation: to_engineering_string(), step_engineering_string().
54+
*/
55+
56+
/**
57+
* \var eng_exponential
58+
* \brief select exponential presentation: to_engineering_string(), step_engineering_string().
59+
*/
60+
61+
extern struct eng_prefixed_t {} eng_prefixed;
62+
extern struct eng_exponential_t {} eng_exponential;
63+
64+
/**
65+
* \var eng_increment
66+
* \brief let step_engineering_string() make a postive step.
67+
*/
68+
69+
/**
70+
* \var eng_decrement
71+
* \brief let step_engineering_string() make a negative step.
72+
*/
73+
74+
constexpr bool eng_increment = true;
75+
constexpr bool eng_decrement = false;
76+
77+
/**
78+
* convert a double to the specified number of digits in SI (prefix) notation,
79+
* optionally followed by a unit.
80+
*/
81+
inline std::string
82+
to_engineering_string( double value, int digits, eng_prefixed_t, std::string unit = "", std::string separator = " " )
83+
{
84+
return to_engineering_string( value, digits, false, unit, separator );
85+
}
86+
87+
/**
88+
* convert a double to the specified number of digits in exponential notation,
89+
* optionally followed by a unit.
90+
*/
91+
inline std::string
92+
to_engineering_string( double value, int digits, eng_exponential_t, std::string unit = "", std::string separator = " " )
93+
{
94+
return to_engineering_string( value, digits, true, unit, separator );
95+
}
96+
97+
/**
98+
* step a value by the smallest possible increment, using SI notation.
99+
*/
100+
inline std::string
101+
step_engineering_string( std::string text, int digits, eng_prefixed_t, bool increment )
102+
{
103+
return step_engineering_string( text, digits, false, increment );
104+
}
105+
106+
/**
107+
* step a value by the smallest possible increment, using exponential notation.
108+
*/
109+
inline std::string
110+
step_engineering_string( std::string text, int digits, eng_exponential_t, bool increment )
111+
{
112+
return step_engineering_string( text, digits, true, increment );
113+
}
114+
115+
#endif // ENG_FORMAT_H_INCLUDED

0 commit comments

Comments
 (0)