Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ST7-Intel
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Maréchal
ST7-Intel
Commits
c71263b6
Commit
c71263b6
authored
Mar 17, 2021
by
Matthieu Oberon
Browse files
Options
Downloads
Patches
Plain Diff
corect idents and compile outside ACO function
parent
4f07da0c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Appli-iso3dfd/ACO.py
+106
-103
106 additions, 103 deletions
Appli-iso3dfd/ACO.py
with
106 additions
and
103 deletions
Appli-iso3dfd/ACO.py
+
106
−
103
View file @
c71263b6
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment