You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (int i = 0; i < v_edgeWeight.size(); i++)
{
int threadNo = omp_get_thread_num();
int thread_num = threadNo % n_streams;
cudaStream_t stream = raft::resource::get_stream_from_stream_pool(res, thread_num);
rmm::cuda_stream_view stream_view(stream);
std::vector<EdgeWeight> v_edges = v_edgeWeight[i];
for (long j=0; j<v_edges; j++)
{
bool valid1=true;
if (isPathExist((long)vv1_t, (long)vv2_t, stream_view) ){
valid1 = false;
}
-----------------------------------------------
bool isPathExist(int64_t v1, int64_t v2,rmm::cuda_stream_view stream_view) {
if (!GraphX::graphView) {
std::cerr << "Graph is not constructed. Please call constructGraphInGPU first." << std::endl;
return false;
}
std::vector<int64_t> sources={v1};
// Prepare device vectors for BFS output
rmm::device_uvector<int64_t> distances(GraphX::graphView->number_of_vertices(), stream_view);
rmm::device_uvector<int64_t> predecessors(GraphX::graphView->number_of_vertices(), stream_view);
rmm::device_uvector<int64_t> d_sources(sources.size(), handle.get_stream());
raft::update_device(d_sources.data(), sources.data(), sources.size(), handle.get_stream());
//rmm::device_scalar<int64_t> d_source(v1, stream);
cugraph::bfs(
handle,
*graphView,
distances.data(),
predecessors.data(),
d_sources.data(),
d_sources.size(),
false,
std::numeric_limits<int64_t>::max(),
false);
-------------------------------------------------
How can I efficiently launch multiple BFS searches on multiple threads using RAFT to reduce the processing time? I am considering making modifications to the graph each time I find a path and then reconstructing both the graph and its view, which I have set to be shared.
Code of Conduct
I agree to follow cuGraph's Code of Conduct
I have searched the open issues and have found no duplicates for this question
The text was updated successfully, but these errors were encountered:
We don't have a good solution for this scenario. We have a couple of cases where we take advantage of stream pools internally, but nothing at the top level API. We can explore a better long-term solution.
Here's a hack you could try in the long term... untested:
raft::handle_t new_handle{stream_view};
then use the new_handle when you call BFS. That should create the handle with the stream_view from the stream pool as the default stream.
raft::resources res;
int n_streams = raft::resource::get_stream_pool_size(res);
#pragma omp parallel num_threads(MIN(m_threadMax, v_edgeWeight.size()))
{
#pragma omp for
Code of Conduct
The text was updated successfully, but these errors were encountered: