45b6de2c579c4dfcd25345f1124ce9d1638bfd32,pynndescent/threaded.py,,init_current_graph,#Any#Any#Any#Any#Any#Any#Any#Any#,121

Before Change


            n_tasks, current_graph, heap_updates, offsets, index
        )

    executor = concurrent.futures.ThreadPoolExecutor(max_workers=threads)
    // run map functions
    for index, count in executor.map(current_graph_map, range(n_tasks)):
        heap_update_counts[index] = count

    // sort and chunk heap updates so they can be applied in the reduce
    max_count = heap_update_counts.max()
    offsets = np.zeros((n_tasks, max_count), dtype=np.int64)

    def shuffle(index):
        return shuffle_jit(
            heap_updates, heap_update_counts, offsets, chunk_size, n_vertices, index
        )

    for _ in executor.map(shuffle, range(n_tasks)):
        pass

    // then run reduce functions
    for _ in executor.map(current_graph_reduce, range(n_tasks)):
        pass

    return current_graph


def make_init_rp_tree_map_jit(dist, dist_args):

After Change


        )

    // run map functions
    for index, count in parallel(parallel_calls(current_graph_map, n_tasks)):
        heap_update_counts[index] = count

    // sort and chunk heap updates so they can be applied in the reduce
    max_count = heap_update_counts.max()
    offsets = np.zeros((n_tasks, max_count), dtype=np.int64)

    def shuffle(index):
        return shuffle_jit(
            heap_updates, heap_update_counts, offsets, chunk_size, n_vertices, index
        )

    parallel(parallel_calls(shuffle, n_tasks))

    // then run reduce functions
    parallel(parallel_calls(current_graph_reduce, n_tasks))

    return current_graph

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 28

Instances


Project Name: lmcinnes/pynndescent
Commit Name: 45b6de2c579c4dfcd25345f1124ce9d1638bfd32
Time: 2019-05-17
Author: tom.e.white@gmail.com
File Name: pynndescent/threaded.py
Class Name:
Method Name: init_current_graph


Project Name: lmcinnes/pynndescent
Commit Name: 45b6de2c579c4dfcd25345f1124ce9d1638bfd32
Time: 2019-05-17
Author: tom.e.white@gmail.com
File Name: pynndescent/threaded.py
Class Name:
Method Name: new_build_candidates


Project Name: lmcinnes/pynndescent
Commit Name: 45b6de2c579c4dfcd25345f1124ce9d1638bfd32
Time: 2019-05-17
Author: tom.e.white@gmail.com
File Name: pynndescent/threaded.py
Class Name:
Method Name: init_current_graph


Project Name: lmcinnes/pynndescent
Commit Name: 45b6de2c579c4dfcd25345f1124ce9d1638bfd32
Time: 2019-05-17
Author: tom.e.white@gmail.com
File Name: pynndescent/threaded.py
Class Name:
Method Name: init_rp_tree