37{
38 typedef long unsigned int t_int;
40 std::vector<t_int> compindices(boost::num_vertices(G));
41 t_int total_connected = boost::connected_components(G, &compindices[0]);
42
43 std::vector<gtool::t_graph> components(total_connected);
44 std::vector<gtool::t_registry> component_registries(total_connected);
45
46
47 for (t_int vector_i = 0; vector_i != compindices.size(); ++vector_i) {
48 t_int component_j = compindices[vector_i];
53 }
54
55
56
58
59 std::vector<std::future<void>> punits;
60
61 unsigned long long int c = 0;
62
63 for (auto const& g : components) {
64 size_t const component_size = g.vertex_set().size();
65
67 if (--max_punits) {
68 std::string output_file{
this_dest_prefix + std::string(
"_") + std::to_string(++c) + std::string(
".dot") };
69
70 try {
71 punits.push_back(std::async(std::launch::async,
graph::write, g, output_file));
72 } catch (std::system_error const& e) {
73 if (e.code() == std::errc::resource_unavailable_try_again) {
74
75 ERROR(
"Could not launch another thread", e.what(),
"for file:", output_file,
"try to launch in deferred");
76
77 punits.push_back(std::async(std::launch::deferred,
graph::write, g, output_file));
78
79 WARN(
"File write policy change",
80 "Program execution correction",
81 " for file:",
82 output_file,
83 " launched in deferred");
84
85 } else {
86 throw e;
87 }
88 }
89 } else {
90
91
92
93
94 punits.clear();
96 }
97 }
98 }
99
100 return EXIT_SUCCESS;
101}
static configobject::tref get(dbe::cokey const &desc)
#define GTOOL_MAX_THREADS