IntelLabs / HPAT.jl

High Performance Analytics Toolkit (HPAT) is a Julia-based framework for big data analytics on clusters.
BSD 2-Clause "Simplified" License
120 stars 16 forks source link

Remove ":if" Expr from output of distributed pass. #3

Closed DrTodd13 closed 8 years ago

DrTodd13 commented 8 years ago

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)