- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hii all. iam a student. i implemented the parallel version of kruskal using tbb as a project. iam attaching the code files. now the problem i hav is wen the number of nodes is greater than 300 the the edges and weights of the edges are changing to 1. i.e., after calling parallel_sort function in kruskalApply function. i donno the reason :( it works fine for small number of nodes. iam intrested in any suggestions as well. thankyou
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - ktrfrk
hii all. iam a student. i implemented the parallel version of kruskal using tbb as a project. iam attaching the code files. now the problem i hav is wen the number of nodes is greater than 300 the the edges and weights of the edges are changing to 1. i.e., after calling parallel_sort function in kruskalApply function. i donno the reason :( it works fine for small number of nodes. iam intrested in any suggestions as well. thankyou
You only use parallel_sort from TBB . Try replacing it with std::sort and see if there is any problem with the serial version. Have it working and make it parallel later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - ninhngt
You only use parallel_sort from TBB . Try replacing it with std::sort and see if there is any problem with the serial version. Have it working and make it parallel later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you used the map in a wrong way. In maps, you have to use pairs but you use the weights as key. It seems wrong. please review this:http://www.cplusplus.com/reference/stl/map/.
Another point, you call "ed.push_back(e);" but what is ed? it is not declared.
You can give a try with TBB 3.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page