Remove ":if" Expr from output of distributed pass.
Closed this issue · 0 comments
DrTodd13 commented
The distributed pass creates the following:
__hpat_dist_arr_count_1 = if __hpat_node_id == __hpat_num_pes - 1
__hpat_h5_dim_size_1_1 - __hpat_node_id * __hpat_dist_arr_div_1
else
__hpat_dist_arr_div_1
end
CompilerTools is not prepared to deal with these ":if" nodes and for consistency with the rest of the AST I suggest something like the following:
function __hpat_get_work_count(node_id, num_pes, dim_size, arr_div)
if node_id == num_pes - 1
return dim_size - node_id * arr_div
else
return dist_arr_div
end
__hpat_dist_arr_count_1 = __hpat_get_work_count(__hpat_node_id, __hpat_num_pes, __hpat_h5_dim_size_1_1, __hpat_dist_arr_div_1)