Пример #1
0
    std::string complete_version()
    {
        boost::format logo(
            "Versions:\n"
            "  HPX: %s\n"
            "  Boost: %s\n"
#if defined(HPX_HAVE_HWLOC)
            "  Hwloc: %s\n"
#endif
            "\n"
            "Build:\n"
            "  Type: %s\n"
            "  Date: %s\n"
            "  Platform: %s\n"
            "  Compiler: %s\n"
            "  Standard Library: %s");

        return boost::str(logo %
            build_string() %
            boost_version() %
#if defined(HPX_HAVE_HWLOC)
            hwloc_version() %
#endif
            build_type() %
            build_date_time() %
            boost_platform() %
            boost_compiler() %
            boost_stdlib());
    }
Пример #2
0
 // Returns the HPX full build information string.
 std::string full_build_string()
 {
     hpx::util::osstream strm;
     strm << "{version}: " << build_string() << "\n"
          << "{boost}: " << boost_version() << "\n"
          << "{build-type}: " << build_type() << "\n"
          << "{date}: " << build_date_time() << "\n"
          << "{platform}: " << boost_platform() << "\n"
          << "{compiler}: " << boost_compiler() << "\n"
          << "{stdlib}: " << boost_stdlib() << "\n";
     return util::osstream_get_string(strm);
 }
Пример #3
0
    // Returns the HPX full build information string.
    std::string full_build_string()
    {
        std::ostringstream strm;
        strm << "{config}:\n" << configuration_string()
             << "{version}: " << build_string() << "\n"
             << "{boost}: " << boost_version() << "\n"
             << "{build-type}: " << build_type() << "\n"
             << "{date}: " << build_date_time() << "\n"
             << "{platform}: " << boost_platform() << "\n"
             << "{compiler}: " << boost_compiler() << "\n"
             << "{stdlib}: " << boost_stdlib() << "\n";

        return strm.str();
    }
Пример #4
0
    std::string complete_version()
    {
        boost::format logo(
            "Versions:\n"
            "  HPX: %s\n"
            "  Boost: %s\n"
#if defined(HPX_HAVE_HWLOC)
            "  Hwloc: %s\n"
#endif
#if defined(HPX_HAVE_PARCELPORT_MPI)
            "  MPI: %s\n"
#endif
            "\n"
            "Build:\n"
            "  Type: %s\n"
            "  Date: %s\n"
            "  Platform: %s\n"
            "  Compiler: %s\n"
            "  Standard Library: %s\n");

        std::string version = boost::str(logo %
            build_string() %
            boost_version() %
#if defined(HPX_HAVE_HWLOC)
            hwloc_version() %
#endif
#if defined(HPX_HAVE_PARCELPORT_MPI)
            mpi_version() %
#endif
            build_type() %
            build_date_time() %
            boost_platform() %
            boost_compiler() %
            boost_stdlib());

#if defined(HPX_HAVE_MALLOC)
            version += "  Allocator: " + malloc_version() + "\n";
#endif

            return version;
    }
Пример #5
0
    std::string complete_version()
    {
        boost::format logo(
            "Versions:\n"
            "  HPX: %s\n"
            "  Boost: %s\n"
            "\n"
            "Build:\n"
            "  Type: %s\n"
            "  Date: %s\n"
            "  Platform: %s\n"
            "  Compiler: %s\n"
            "  Standard Library: %s\n");

        return boost::str(logo %
            build_string() %
            boost_version() %
            build_type() %
            build_date_time() %
            boost_platform() %
            boost_compiler() %
            boost_stdlib());
    }
Пример #6
0
    ///////////////////////////////////////////////////////////////////////////
    // Extract the diagnostic information embedded in the given exception and
    // return a string holding a formatted message.
    std::string diagnostic_information(boost::exception const& e)
    {
        util::osstream strm;
        strm << "\n";

        std::string const* back_trace =
            boost::get_error_info<hpx::detail::throw_stacktrace>(e);
        if (back_trace && !back_trace->empty()) {
            // FIXME: add indentation to stack frame information
            strm << "[stack_trace]: " << *back_trace << "\n";
        }

        // Try a cast to std::exception - this should handle boost.system
        // error codes in addition to the standard library exceptions.
        std::exception const* se = dynamic_cast<std::exception const*>(&e);
        if (se)
            strm << "[what]: " << se->what() << "\n";

        boost::uint32_t const* locality =
            boost::get_error_info<hpx::detail::throw_locality>(e);
        if (locality)
            strm << "[locality-id]: " << *locality << "\n";

        std::string const* hostname_ =
            boost::get_error_info<hpx::detail::throw_hostname>(e);
        if (hostname_ && !hostname_->empty())
            strm << "[hostname]: " << *hostname_ << "\n";

        boost::int64_t const* pid_ =
            boost::get_error_info<hpx::detail::throw_pid>(e);
        if (pid_ && -1 != *pid_)
            strm << "[process-id]: " << *pid_ << "\n";

        char const* const* func =
            boost::get_error_info<boost::throw_function>(e);
        if (func) {
            strm << "[function]: " << *func << "\n";
        }
        else {
            std::string const* s =
                boost::get_error_info<hpx::detail::throw_function>(e);
            if (s)
                strm << "[function]: " << *s << "\n";
        }

        char const* const* file =
            boost::get_error_info<boost::throw_file>(e);
        if (file) {
            strm << "[file]: " << *file << "\n";
        }
        else {
            std::string const* s =
                boost::get_error_info<hpx::detail::throw_file>(e);
            if (s)
                strm << "[file]: " << *s << "\n";
        }

        int const* line =
            boost::get_error_info<boost::throw_line>(e);
        if (line)
            strm << "[line]: " << *line << "\n";

        std::size_t const* shepherd =
            boost::get_error_info<hpx::detail::throw_shepherd>(e);
        if (shepherd && std::size_t(-1) != *shepherd)
            strm << "[os-thread]: " << *shepherd << "\n";

        std::size_t const* thread_id =
            boost::get_error_info<hpx::detail::throw_thread_id>(e);
        if (thread_id && *thread_id)
            strm << (boost::format("[thread-id]: %016x\n") % *thread_id);

        std::string const* thread_description =
            boost::get_error_info<hpx::detail::throw_thread_name>(e);
        if (thread_description && !thread_description->empty())
            strm << "[thread-description]: " << *thread_description << "\n";

        // add system information
        // FIXME: collect at throw site
        strm << "[version]: " << build_string() << "\n";
        strm << "[boost]: " << boost_version() << "\n";
        strm << "[build-type]: " << build_type() << "\n";
        strm << "[date]: " << build_date_time() << "\n";
        strm << "[platform]: " << boost_platform() << "\n";
        strm << "[compiler]: " << boost_compiler() << "\n";
        strm << "[stdlib]: " << boost_stdlib() << "\n";

        return util::osstream_get_string(strm);
    }