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

corect idents and compile outside ACO function

parent 4f07da0c
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ import compute_tau ...@@ -7,7 +7,7 @@ import compute_tau
import launcher_SUBP import launcher_SUBP
def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1=256, n2=256, n3=256, def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1=256, n2=256, n3=256,
nb_threads=4, reps=100,optimization="-O3", simd="avx512"): nb_threads=8, reps=100):
""" Ant colony optimization of the cache blocking parameters for the execution of """ Ant colony optimization of the cache blocking parameters for the execution of
the iso3dfd programm. the iso3dfd programm.
...@@ -26,8 +26,6 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1=256, n2=256, n3 ...@@ -26,8 +26,6 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1=256, n2=256, n3
n3 (int, optional): Third dimension of matrix. Defaults to 256. n3 (int, optional): Third dimension of matrix. Defaults to 256.
nb_threads (int, optional): Number of threads per MPI process. Defaults to 4. nb_threads (int, optional): Number of threads per MPI process. Defaults to 4.
reps (int, optional): Max number of iteration before stopping the process. Defaults to 100. reps (int, optional): Max number of iteration before stopping the process. Defaults to 100.
optimization (str, optional): Optimization flaf. Defaults to "-O3".
simd (str, optional): Vectorization flag. Defaults to "avx512".
Returns: Returns:
(np.array, float): optimal path [cbx, cby, cbz] and the associated cost (np.array, float): optimal path [cbx, cby, cbz] and the associated cost
...@@ -104,11 +102,16 @@ if __name__ == "__main__": ...@@ -104,11 +102,16 @@ if __name__ == "__main__":
optimization = "-O3" optimization = "-O3"
simd = "avx512" simd = "avx512"
if Me == 0 :
# Compiling the code
launcher_SUBP.compileSUBP(optimization=optimization, simd=simd)
# Waiting for the compilation to end on other processes
comm.Barrier()
if Me == 0: if Me == 0:
path_opti, cost_opti = ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1, n2, n3, path_opti, cost_opti = ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1, n2, n3,
nb_threads, reps, optimization, simd) nb_threads, reps)
print(path_opti) print(path_opti)
print(cost_opti) print(cost_opti)
else: else:
ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1, n2, n3, nb_threads, reps, ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1, n2, n3, nb_threads, reps)
optimization, simd)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment