Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 552628a

Browse files
author
Ehsan Totoni
committed
local_len() for 1D_Var of str arr
1 parent 0e61489 commit 552628a

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

hpat/distributed_analysis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ def _analyze_call_hpat_dist(self, lhs, func_name, args, array_dists):
600600
"""analyze distributions of hpat distributed functions
601601
(hpat.distributed_api.func_name)
602602
"""
603+
if func_name == 'local_len':
604+
return
603605
if func_name == 'parallel_print':
604606
return
605607

hpat/distributed_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ def getitem_impl(arr, slice_index, start, count):
334334
return getitem_impl
335335

336336

337+
@numba.njit
338+
def local_len(A):
339+
return len(A)
340+
337341
# send_data, recv_data, send_counts, recv_counts, send_disp, recv_disp, typ_enum
338342
c_alltoallv = types.ExternalFunction("c_alltoallv", types.void(types.voidptr,
339343
types.voidptr, types.voidptr, types.voidptr, types.voidptr, types.voidptr, types.int32))

hpat/hiframes/series_kernels.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def _series_dropna_float_impl(S): # pragma: no cover
7171
return hpat.hiframes.api.init_series(A)
7272

7373
def _series_dropna_str_alloc_impl(B): # pragma: no cover
74-
old_len = len(B)
74+
# local_len to enable 1D_Var dist
75+
# TODO: test
76+
# TODO: generalize
77+
old_len = hpat.distributed_api.local_len(B)
7578
# TODO: more efficient null counting
7679
new_len = old_len - hpat.hiframes.api.init_series(B).isna().sum()
7780
num_chars = hpat.str_arr_ext.num_total_chars(B)

0 commit comments

Comments
 (0)