• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #856

28 Dec 2022 02:00AM UTC coverage: 86.602% (+0.05%) from 86.55%
#856

push

StellarBot
Merge #6119

6119: Update CMakeLists.txt r=hkaiser a=khuck

updating the default APEX version


Co-authored-by: Kevin Huck <khuck@cs.uoregon.edu>

174566 of 201573 relevant lines covered (86.6%)

1876093.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.9
/libs/core/version/src/version.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
//  Copyright (c) 2011 Bryce Lelbach
3
//  Copyright (c) 2011-2017 Hartmut Kaiser
4
//
5
//  SPDX-License-Identifier: BSL-1.0
6
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
7
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8
////////////////////////////////////////////////////////////////////////////////
9

10
#include <hpx/config.hpp>
11
#include <hpx/config/config_strings.hpp>
12
#include <hpx/config/version.hpp>
13
#include <hpx/modules/config_registry.hpp>
14
#include <hpx/modules/format.hpp>
15
#include <hpx/prefix/find_prefix.hpp>
16
#include <hpx/preprocessor/stringize.hpp>
17
#include <hpx/version.hpp>
18

19
#include <boost/config.hpp>
20
#include <boost/version.hpp>
21

22
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI)) ||      \
23
    defined(HPX_HAVE_MODULE_MPI_BASE)
24
#if defined(__clang__)
25
#pragma clang diagnostic push
26
#pragma clang diagnostic ignored "-Wcast-qual"
27
#elif defined(__GNUC__)
28
#pragma GCC diagnostic push
29
#pragma GCC diagnostic ignored "-Wcast-qual"
30
#endif
31

32
// Intel MPI does not like to be included after stdio.h. As such, we include mpi.h
33
// as soon as possible.
34
#include <mpi.h>
35

36
#if defined(__clang__)
37
#pragma clang diagnostic pop
38
#elif defined(__GNUC__)
39
#pragma GCC diagnostic pop
40
#endif
41

42
#endif
43

44
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI)) ||      \
45
    defined(HPX_HAVE_MODULE_LCI_BASE)
46
#include <lci.h>
47
#endif
48

49
#include <hwloc.h>
50

51
#include <algorithm>
52
#include <cstdint>
53
#include <sstream>
54
#include <string>
55

56
///////////////////////////////////////////////////////////////////////////////
57
namespace hpx {
58

59
    std::uint8_t major_version()
×
60
    {
61
        return HPX_VERSION_MAJOR;
×
62
    }
63

64
    std::uint8_t minor_version()
×
65
    {
66
        return HPX_VERSION_MINOR;
×
67
    }
68

69
    std::uint8_t subminor_version()
×
70
    {
71
        return HPX_VERSION_SUBMINOR;
×
72
    }
73

74
    std::uint32_t full_version()
×
75
    {
76
        return HPX_VERSION_FULL;
×
77
    }
78

79
    std::string full_version_as_string()
4✔
80
    {
81
        return hpx::util::format("{}.{}.{}",    //-V609
8✔
82
            HPX_VERSION_MAJOR, HPX_VERSION_MINOR, HPX_VERSION_SUBMINOR);
4✔
83
    }
84

85
    std::uint8_t agas_version()
×
86
    {
87
        return HPX_AGAS_VERSION;
×
88
    }
89

90
    std::string tag()
×
91
    {
92
        return HPX_VERSION_TAG;
×
93
    }
×
94

95
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI)) ||      \
96
    defined(HPX_HAVE_MODULE_MPI_BASE)
97
    std::string mpi_version()
98
    {
99
        std::ostringstream strm;
100

101
        // add type and library version
102
#if defined(OPEN_MPI)
103
        hpx::util::format_to(strm, "OpenMPI V{}.{}.{}", OMPI_MAJOR_VERSION,
104
            OMPI_MINOR_VERSION, OMPI_RELEASE_VERSION);
105
#elif defined(MPICH)
106
        hpx::util::format_to(strm, "MPICH V{}", MPICH_VERSION);
107
#elif defined(MVAPICH2_VERSION)
108
        hpx::util::format_to(strm, "MVAPICH2 V{}", MVAPICH2_VERSION);
109
#elif defined(MSMPI_VER)
110
        hpx::util::format_to(strm, "MSMPI V{}", MSMPI_VER);
111
#else
112
        strm << "Unknown MPI";
113
#endif
114
        // add general MPI version
115
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
116
        hpx::util::format_to(strm, ", MPI V{}.{}", MPI_VERSION, MPI_SUBVERSION);
117
#else
118
        strm << ", unknown MPI version";
119
#endif
120
        return strm.str();
121
    }
122
#endif
123

124
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI)) ||      \
125
    defined(HPX_HAVE_MODULE_LCI_BASE)
126
    std::string lci_version()
127
    {
128
        std::ostringstream strm;
129
        strm << "the one and only LCI";
130
        return strm.str();
131
    }
132
#endif
133

134
    std::string copyright()
×
135
    {
136
        char const* const copyright =
×
137
            "HPX - The C++ Standard Library for Parallelism and Concurrency\n"
138
            "(A general purpose parallel C++ runtime system for distributed "
139
            "applications\n"
140
            "of any scale).\n\n"
141
            "Copyright (c) 2007-2022, The STE||AR Group,\n"
142
            "http://stellar-group.org, email:hpx-users@stellar-group.org\n\n"
143
            "Distributed under the Boost Software License, "
144
            "Version 1.0. (See accompanying\n"
145
            "file LICENSE_1_0.txt or copy at "
146
            "http://www.boost.org/LICENSE_1_0.txt)\n";
147
        return copyright;
×
148
    }
×
149

150
    // Returns the HPX full build information string.
151
    std::string full_build_string()
2✔
152
    {
153
        std::ostringstream strm;
2✔
154
        strm << "{config}:\n"
4✔
155
             << configuration_string() << "{version}: " << build_string()
2✔
156
             << "\n"
2✔
157
             << "{boost}: " << boost_version() << "\n"
2✔
158
             << "{build-type}: " << build_type() << "\n"
2✔
159
             << "{date}: " << build_date_time() << "\n"
2✔
160
             << "{platform}: " << boost_platform() << "\n"
2✔
161
             << "{compiler}: " << boost_compiler() << "\n"
2✔
162
             << "{stdlib}: " << boost_stdlib() << "\n";
2✔
163

164
        return strm.str();
2✔
165
    }
2✔
166

167
    ///////////////////////////////////////////////////////////////////////////
168
    //
169
    //  HPX_HAVE_THREAD_PARENT_REFERENCE=1
170
    //  HPX_HAVE_THREAD_PHASE_INFORMATION=1
171
    //  HPX_HAVE_THREAD_DESCRIPTION=1
172
    //  HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION=1
173
    //  HPX_THREAD_BACKTRACE_ON_SUSPENSION_DEPTH=5
174
    //  HPX_HAVE_THREAD_TARGET_ADDRESS=1
175
    //  HPX_HAVE_THREAD_QUEUE_WAITTIME=0
176

177
    std::string configuration_string()
2,538✔
178
    {
179
        std::ostringstream strm;
2,538✔
180

181
        strm << "Core library:\n";
2,538✔
182

183
#if defined(HPX_AGAS_LOCAL_CACHE_SIZE)
184
        hpx::util::format_to(strm, "  HPX_AGAS_LOCAL_CACHE_SIZE={}\n",
5,076✔
185
            HPX_AGAS_LOCAL_CACHE_SIZE);
2,538✔
186
#endif
187
#if defined(HPX_HAVE_MALLOC)
188
        hpx::util::format_to(strm, "  HPX_HAVE_MALLOC={}\n", HPX_HAVE_MALLOC);
2,538✔
189
#endif
190
#if defined(HPX_PARCEL_MAX_CONNECTIONS)
191
        hpx::util::format_to(strm, "  HPX_PARCEL_MAX_CONNECTIONS={}\n",
5,076✔
192
            HPX_PARCEL_MAX_CONNECTIONS);
2,538✔
193
#endif
194
#if defined(HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY)
195
        hpx::util::format_to(strm,
5,076✔
196
            "  HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY={}\n",
2,538✔
197
            HPX_PARCEL_MAX_CONNECTIONS_PER_LOCALITY);
2,538✔
198
#endif
199

200
        const char* prefix = util::hpx_prefix();
2,538✔
201
        if (prefix == nullptr)
2,538✔
202
        {
203
            strm << "  HPX_PREFIX (configured)=unknown\n";
×
204
#if !defined(__ANDROID__) && !defined(ANDROID) && !defined(__MIC)
205
            strm << "  HPX_PREFIX=unknown\n";
×
206
#endif
207
        }
×
208
        else
209
        {
210
            strm << "  HPX_PREFIX (configured)=" << prefix << "\n";
2,538✔
211
#if !defined(__ANDROID__) && !defined(ANDROID) && !defined(__MIC)
212
            strm << "  HPX_PREFIX=" << util::find_prefix() << "\n";
2,538✔
213
#endif
214
        }
215
        strm << "\n";
2,538✔
216

217
        char const* const* p = hpx::config_strings;
2,538✔
218
        while (*p)
131,956✔
219
            strm << "  " << *p++ << "\n";
129,413✔
220
        strm << "\n";
2,538✔
221

222
        // print module configurations
223
        auto configs = hpx::config_registry::get_module_configs();
2,538✔
224
        std::sort(configs.begin(), configs.end(),
2,537✔
225
            [](auto& a, auto& b) { return a.module_name < b.module_name; });
20,291✔
226
        for (auto& c : configs)
15,224✔
227
        {
228
            if (!c.config_entries.empty())
12,684✔
229
            {
230
                strm << "Module " << c.module_name << ":\n";
10,147✔
231

232
                for (auto const& e : c.config_entries)
32,991✔
233
                {
234
                    strm << "  " << e << std::endl;
22,832✔
235
                }
236

237
                strm << "\n";
10,150✔
238
            }
10,150✔
239
        }
240

241
        return strm.str();
2,538✔
242
    }
2,538✔
243

244
    std::string build_string()
3✔
245
    {
246
        return hpx::util::format("V{}{} (AGAS: V{}.{}), Git: {:.10}",    //-V609
6✔
247
            full_version_as_string(), HPX_VERSION_TAG, HPX_AGAS_VERSION / 0x10,
3✔
248
            HPX_AGAS_VERSION % 0x10, HPX_HAVE_GIT_COMMIT);
3✔
249
    }
×
250

251
    std::string boost_version()
2✔
252
    {
253
        // BOOST_VERSION: 107100
254
        return hpx::util::format("V{}.{}.{}", BOOST_VERSION / 100000,
4✔
255
            BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
2✔
256
    }
257

258
    std::string hwloc_version()
×
259
    {
260
        // HWLOC_API_VERSION: 0x00010700
261
        return hpx::util::format("V{}.{}.{}", HWLOC_API_VERSION / 0x10000,
×
262
            HWLOC_API_VERSION / 0x100 % 0x100, HWLOC_API_VERSION % 0x100);
×
263
    }
264

265
#if defined(HPX_HAVE_MALLOC)
266
    std::string malloc_version()
×
267
    {
268
        return HPX_HAVE_MALLOC;
×
269
    }
×
270
#endif
271

272
    std::string boost_platform()
2✔
273
    {
274
        return BOOST_PLATFORM;
2✔
275
    }
×
276

277
    std::string boost_compiler()
2✔
278
    {
279
        return BOOST_COMPILER;
2✔
280
    }
×
281

282
    std::string boost_stdlib()
2✔
283
    {
284
        return BOOST_STDLIB;
2✔
285
    }
×
286

287
    std::string complete_version()
×
288
    {
289
        std::string version = hpx::util::format("Versions:\n"
×
290
                                                "  HPX: {}\n"
291
                                                "  Boost: {}\n"
292
                                                "  Hwloc: {}\n"
293
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI)) ||      \
294
    defined(HPX_HAVE_MODULE_LCI_BASE)
295
                                                "  LCI: {}\n"
296
#endif
297
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI)) ||      \
298
    defined(HPX_HAVE_MODULE_MPI_BASE)
299
                                                "  MPI: {}\n"
300
#endif
301
                                                "\n"
302
                                                "Build:\n"
303
                                                "  Type: {}\n"
304
                                                "  Date: {}\n"
305
                                                "  Platform: {}\n"
306
                                                "  Compiler: {}\n"
307
                                                "  Standard Library: {}\n",
308
            build_string(), boost_version(), hwloc_version(),
×
309
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI)) ||      \
310
    defined(HPX_HAVE_MODULE_LCI_BASE)
311
            lci_version(),
312
#endif
313
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI)) ||      \
314
    defined(HPX_HAVE_MODULE_MPI_BASE)
315
            mpi_version(),
316
#endif
317
            build_type(), build_date_time(), boost_platform(), boost_compiler(),
×
318
            boost_stdlib());
×
319

320
#if defined(HPX_HAVE_MALLOC)
321
        version += "  Allocator: " + malloc_version() + "\n";
×
322
#endif
323

324
        return version;
×
325
    }
×
326

327
    std::string build_type()
2✔
328
    {
329
        return HPX_PP_STRINGIZE(HPX_BUILD_TYPE);
2✔
330
    }
×
331

332
    std::string build_date_time()
2✔
333
    {
334
        return std::string(__DATE__) + " " + __TIME__;
2✔
335
    }
×
336
}    // namespace hpx
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc