Skip to content
Snippets Groups Projects
Commit 35a84cd7 authored by Matthieu Oberon's avatar Matthieu Oberon
Browse files

add time measurment

parent 49bd2e71
No related branches found
No related tags found
No related merge requests found
import numpy as np
import math
from mpi4py import MPI
import socket
import time
from mpi4py import MPI
import compute_path
import tools
......@@ -167,9 +168,14 @@ if __name__ == "__main__":
# Waiting for the compilation to end on other processes
comm.Barrier()
if Me == 0:
begin = time.time()
path_opti, cost_opti = ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter,
n1_max=n1_max, n2_max=n2_max, n3_max=n3_max, fancy_strategy=fancy_strategy,
nb_threads=nb_threads, reps=reps)
if Me == 0:
end = time.time()
print(f"Le temps d'exécution total est {end - begin} s.")
print(f"Le chemin optimal est {path_opti}.")
print(f"Le throughput associé est alors {-1*cost_opti} MPoints/s.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment