Exemple #1
0
def get_ser_result(task_id):
    """Get the result of the function.
    """
    fxc = FuncXClient(funcx_service_address='https://dev.funcx.org/api/v1')
    res = fxc.get(f"/tasks/{task_id}")
    print(res)
    return res
Exemple #2
0
    #hello_function = fxc.register_function(matrix)
    ress = np.dot(mat1, mat2)
    #end1 = time.time()
    #registertime = ((end1 - start1) * 1000)
    #print("The register time is:", registertime)
    start2 = time.time()
    # res = fxc.run(items, endpoint_id='7601789e-8569-413f-be3e-e573d04c5799', function_id=sum_function)
    res = fxc.run(ress,
                  endpoint_id='2e3061ea-ef19-4cbb-bc81-82f8cc47baa9',
                  function_id=hello_function)
    end2 = time.time()
    runtime = ((end2 - start2) * 1000)
    print("The runtime is:", runtime)
    # get the raw json response
    start = time.time()
    result = fxc.get(f"tasks/{res}")
    while result['status'] != 'success':
        time.sleep(1)
        result = fxc.get(f"tasks/{res}")

    completion_time = result['completion_t']
    exec_time = (float(completion_time) - start) * 1000
    print("The function execution time is:", exec_time)
    # add the result to the list
    estimate.append(exec_time)  #overhead.append(Overheadtime)
    sheet.write(index, 0, exec_time3)
    sheet.write(index, 1, registertime)
    sheet.write(index, 2, runtime)
    sheet.write(index, 3, exec_time)
    index += 1
book.save('Latencyreadingsforcomplex1.csv')