Ejemplo n.º 1
0
def main():
    start = hpx.time_now()
    num_ranks = hpx.get_num_ranks()
    and_lco = hpx.And(num_ranks)
    for i in range(num_ranks):
        worker(hpx.THERE(i), i, num_ranks, rsync_lco=and_lco)
    and_lco.wait()
    print(hpx.time_elapsed_ms(start))
    hpx.exit()
Ejemplo n.º 2
0
def main(num_action):
    start = hpx.time_now()

    and_lco = hpx.And(num_action)
    for i in range(num_action):
        calculate(
            hpx.HERE(), 5765760 // num_action,
            rsync_lco=and_lco)  # 5040 is lcm(2,3,4,5,6,7,8,9,10,12,14,15,16)
    and_lco.wait()

    print(hpx.time_elapsed_ms(start))
    hpx.exit()
Ejemplo n.º 3
0
def main():
    num_ranks = hpx.get_num_ranks()
    print(num_ranks)
    array = hpx.GlobalMemory.alloc_cyclic(num_ranks, (64, 1024, 1024),
                                          dtype=np.dtype(float))

    start = hpx.time_now()
    and_lco = hpx.And(num_ranks)
    for i in range(num_ranks):
        copy_from_array(hpx.THERE(i), array, i, num_ranks, rsync_lco=and_lco)
    and_lco.wait()
    print(hpx.time_elapsed_ms(start))
    hpx.exit()
Ejemplo n.º 4
0
def main():
    time = np.zeros((18, ))
    for j in range(18):
        num_gil = 2**j
        start = hpx.time_now()
        and_lco = hpx.And(num_action)
        for i in range(num_action):
            calculate(hpx.HERE(), num_gil, rsync_lco=and_lco)
        and_lco.wait()
        current_time = hpx.time_elapsed_ms(start)
        print(current_time)
        time[j] = current_time

    print(time)
    time.dump("time.bin")
    hpx.exit()