-
Notifications
You must be signed in to change notification settings - Fork 61
Fix boost runtime issue on Ubuntu16.04 with gcc 5.4 #92
Changes from 1 commit
e4ea748
1b27660
2d064ca
ae09438
6d1154f
a093a76
5a068d0
2943a6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,14 +309,14 @@ static PyObject* csv_chunk_reader(std::istream * f, size_t fsz, bool is_parallel | |
std::vector<size_t> line_offset = count_lines(f, hpat_dist_get_node_portion(fsz, nranks, rank)); | ||
size_t no_lines = line_offset.size(); | ||
// get total number of lines using allreduce | ||
size_t tot_no_lines(0); | ||
int64_t tot_no_lines = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code readability and consistence. I think this is more common way to initialize variables. From the compiler point of view, in this particular place, they are equal. |
||
|
||
hpat_dist_reduce(reinterpret_cast<char *>(&no_lines), reinterpret_cast<char *>(&tot_no_lines), HPAT_ReduceOps::SUM, HPAT_CTypes::UINT64); | ||
|
||
// Now we need to communicate the distribution as we really want it | ||
// First determine which is our first line (which is the sum of previous lines) | ||
size_t byte_first_line = hpat_dist_exscan_i8(no_lines); | ||
size_t byte_last_line = byte_first_line + no_lines; | ||
int64_t byte_first_line = hpat_dist_exscan_i8(no_lines); | ||
int64_t byte_last_line = byte_first_line + no_lines; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do change to signed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because later it participated in comparison with signed input argument. In this case tne compiler show the warning. |
||
|
||
// We now determine the chunks of lines that begin and end in our byte-chunk | ||
|
||
|
@@ -351,8 +351,8 @@ static PyObject* csv_chunk_reader(std::istream * f, size_t fsz, bool is_parallel | |
|
||
// We iterate through chunk boundaries (defined by line-numbers) | ||
// we start with boundary 1 as 0 is the beginning of file | ||
for(int i=1; i<nranks; ++i) { | ||
size_t i_bndry = skiprows + hpat_dist_get_start(n_lines_to_read, (int)nranks, i); | ||
for(size_t i=1; i<nranks; ++i) { | ||
int64_t i_bndry = skiprows + hpat_dist_get_start(n_lines_to_read, (int)nranks, i); | ||
// Note our line_offsets mark the end of each line! | ||
// we check if boundary is on our byte-chunk | ||
if(i_bndry > byte_first_line && i_bndry <= byte_last_line) { | ||
|
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.
How close is this code to the original CPython version?
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.
Not sure about CPython but these variables used nowhere.