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 {
49 t_int component_j = compindices[vector_i];
53 components[component_j],
55 { oname, cname } ),
56 component_registries[component_j] );
57 }
58
59
60
62
63 std::vector<std::future<void>> punits;
64
65 unsigned long long int c = 0;
66
67 for ( auto const & g : components )
68 {
69 size_t const component_size = g.vertex_set().size();
70
73 {
74 if ( --max_punits )
75 {
76 std::string output_file
77 {
this_dest_prefix + std::string (
"_" ) + std::to_string ( ++c ) + std::string (
".dot" ) };
78
79 try
80 {
81 punits.push_back ( std::async ( std::launch::async,
graph::write, g, output_file ) );
82 }
83 catch ( std::system_error const & e )
84 {
85 if ( e.code() == std::errc::resource_unavailable_try_again )
86 {
87
89 "Could not launch another thread", e.what(), "for file:", output_file,
90 "try to launch in deferred" );
91
92 punits.push_back (
93 std::async ( std::launch::deferred,
graph::write, g, output_file ) );
94
96 "File write policy change", "Program execution correction", " for file:",
97 output_file, " launched in deferred" );
98
99 }
100 else
101 {
102 throw e;
103 }
104 }
105 }
106 else
107 {
108
109
110
111
112 punits.clear();
114 }
115 }
116 }
117
118 return EXIT_SUCCESS;
119}
static configobject::tref get(dbe::cokey const &desc)
#define GTOOL_MAX_THREADS