-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partitioning HDRF and Other #137
Conversation
(TODO check how to use CoordinatedRecord to clean memory ) Signed-off-by: ZigRazor <zigrazor@gmail.com>
CodeSee Review Map:Review in an interactive map View more CodeSee Maps Legend |
Corrected crash on print out Graph and Partition Corrected test Corrected Thread Safety for CoordinatePartitionState Signed-off-by: ZigRazor <zigrazor@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #137 +/- ##
==========================================
+ Coverage 97.15% 97.26% +0.11%
==========================================
Files 41 41
Lines 4748 4647 -101
==========================================
- Hits 4613 4520 -93
+ Misses 135 127 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This pull request introduces 1 alert and fixes 1 when merging d65dd75 into 6fb620a - view on LGTM.com new alerts:
fixed alerts:
|
Added also tests for this algorithm. Signed-off-by: ZigRazor <zigrazor@gmail.com>
srand(time(NULL)); | ||
|
||
int choice = rand() % candidates.size(); | ||
unsigned int seed = (unsigned int)time(NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a lot of C-style casting. Is there any strong reason not to user C++ static_cast<> syntax? It is safer.
This can be a big change, so it can be open in another ticket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think can be a good issue
@@ -157,11 +159,12 @@ namespace CXXGRAPH | |||
int CoordinatedPartitionState<T>::getTotalReplicas() | |||
{ | |||
//TODO | |||
std::lock_guard<std::mutex> lock(*record_map_mutex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pro "const" wherever we can and even more for critical things, like mutex, thread-related objects etc.
Then we could say that the code is more protected from unexpected modification related bugs, detected in compiling time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZigRazor , I added a couple of comments about using "const" anc C++ casting style.
Both observations are motivated for having a safer code from unexpected errors/bugs which normally are way harder to find/debug
Signed-off-by: ZigRazor <zigrazor@gmail.com>
Signed-off-by: ZigRazor <zigrazor@gmail.com>
This pull request introduces 3 alerts and fixes 1 when merging 82a4a0c into e735fc6 - view on LGTM.com new alerts:
fixed alerts:
|
Partitioning HDRF and Other algorithm, with general mechanism