42{
43 typedef long unsigned int t_int;
45 std::vector<t_int> compindices ( boost::num_vertices ( G ) );
46 t_int total_connected = boost::connected_components ( G, &compindices[0] );
47
48 std::vector<gtool::t_graph> components ( total_connected );
49 std::vector<gtool::t_registry> component_registries ( total_connected );
50
51
52 for ( t_int vector_i = 0; vector_i != compindices.size(); ++vector_i )
53 {
54 t_int component_j = compindices[vector_i];
58 components[component_j],
60 { oname, cname } ),
61 component_registries[component_j] );
62 }
63
64
65
67
68 std::vector<std::future<void>> punits;
69
70 unsigned long long int c = 0;
71
72 for ( auto const & g : components )
73 {
74 size_t const component_size = g.vertex_set().size();
75
78 {
79 if ( --max_punits )
80 {
81 std::string output_file
82 {
this_dest_prefix + std::string (
"_" ) + std::to_string ( ++c ) + std::string (
".dot" ) };
83
84 try
85 {
86 punits.push_back ( std::async ( std::launch::async,
graph::write, g, output_file ) );
87 }
88 catch ( std::system_error const & e )
89 {
90 if ( e.code() == std::errc::resource_unavailable_try_again )
91 {
92
94 "Could not launch another thread", e.what(), "for file:", output_file,
95 "try to launch in deferred" );
96
97 punits.push_back (
98 std::async ( std::launch::deferred,
graph::write, g, output_file ) );
99
101 "File write policy change", "Program execution correction", " for file:",
102 output_file, " launched in deferred" );
103
104 }
105 else
106 {
107 throw e;
108 }
109 }
110 }
111 else
112 {
113
114
115
116
117 punits.clear();
119 }
120 }
121 }
122
123 return EXIT_SUCCESS;
124}
static configobject::tref get(dbe::cokey const &desc)
#define GTOOL_MAX_THREADS