Commit a2a87884 authored by Tiago Peixoto's avatar Tiago Peixoto

Improve parallelism in motifs()

parent a5ef466f
Pipeline #257 failed with stage
in 175 minutes and 39 seconds
......@@ -372,8 +372,6 @@ struct get_all_motifs
typename wrap_undirected::apply<Graph>::type ug(g);
get_subgraphs(ug, v, k, subgraphs, sampler);
#pragma omp critical (gather)
{
for (size_t j = 0; j < subgraphs.size(); ++j)
{
d_graph_t sub;
......@@ -382,14 +380,19 @@ struct get_all_motifs
make_subgraph(subgraphs[j], g, usub);
get_sig(usub, sig);
#pragma omp critical (gather)
{
bool skip = false;
auto iter = sub_list.find(sig);
if(iter == sub_list.end())
{
if (!fill_list)
continue; // avoid inserting an element in sub_list
skip = true; // avoid inserting an element in sub_list
sub_list[sig].clear();
}
if (!skip)
{
bool found = false;
size_t pos;
auto sl = sub_list.find(sig);
......@@ -443,6 +446,7 @@ struct get_all_motifs
}
}
}
}
};
} //graph-tool namespace
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment