Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nbody-vectorization-toy-lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luca Tornatore
nbody-vectorization-toy-lab
Commits
f54803c9
Commit
f54803c9
authored
6 months ago
by
Luca Tornatore
Browse files
Options
Downloads
Patches
Plain Diff
just some maquillage
parent
b30daea9
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
src/compile
+54
-38
54 additions, 38 deletions
src/compile
with
54 additions
and
38 deletions
src/compile
+
54
−
38
View file @
f54803c9
...
@@ -2,28 +2,49 @@
...
@@ -2,28 +2,49 @@
print_help
()
{
print_help
()
{
echo
" a
n
argument is needed
at least
"
echo
" a
t least the -c
argument is needed"
echo
" compile -c name [-p]"
echo
" compile -c name [-p]"
echo
" -c
\$
compiler_name : specifies the compiler to be used { gcc, icx }"
echo
" -c
\$
compiler_name : specifies the compiler to be used { gcc, icx }"
echo
" -p : activates PAPI support "
echo
" -p : activates PAPI support "
exit
0
exit
0
}
}
SRC_DIR
=
../src
X_DIR
=
.
# the relevant folders
INC_DIR
=
../headers
#
PAPI_OPTS
=
" -DUSE_PAPI "
SRC_DIR
=
../src
# this setup is useful if you want to compile
X_DIR
=
.
# not in src/ but in a sibling folder
INC_DIR
=
../headers
#
# options that you need to compile
#
OPTS
=
" -std=c2x -DFILL=25 "
# specific options
#
ASSERT_OPT
=
" -DNDEBUG "
PAPI_OPT
=
" -DUSE_PAPI "
PAPI_LIB
=
" -lpapi "
PAPI_LIB
=
" -lpapi "
OPTS
=
" -std=c2x -DFILL=25 -DNDEBUG "
GCC_OPTS
=
" -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops "
GCC_OPTS
=
" -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops "
ICX_OPTS
=
" -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 "
ICX_OPTS
=
" -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 "
# variables that control the behaviour
#
compiler
=
0
compiler
=
0
gcc
=
1
gcc
=
1
icx
=
2
icx
=
2
assert_on
=
0
support_papi
=
0
support_papi
=
0
CLOPTIONS
=
"c:ph"
#
# ==================================================
#
# parse the arguments
#
CLOPTIONS
=
"c:aph"
if
[[
$#
-lt
1
]]
;
then
print_help
;
fi
if
[[
$#
-lt
1
]]
;
then
print_help
;
fi
...
@@ -42,6 +63,10 @@ while getopts ${CLOPTIONS} opt; do
...
@@ -42,6 +63,10 @@ while getopts ${CLOPTIONS} opt; do
fi
fi
;;
;;
a
)
assert_on
=
1
echo
"compile with asserts on"
;;
p
)
support_papi
=
1
p
)
support_papi
=
1
echo
"compile with PAPI support"
echo
"compile with PAPI support"
;;
;;
...
@@ -57,7 +82,11 @@ while getopts ${CLOPTIONS} opt; do
...
@@ -57,7 +82,11 @@ while getopts ${CLOPTIONS} opt; do
done
done
#
# ===========================================
#
# set-up things
#
if
[
${
compiler
}
==
${
gcc
}
]
;
if
[
${
compiler
}
==
${
gcc
}
]
;
then
then
...
@@ -70,43 +99,30 @@ else
...
@@ -70,43 +99,30 @@ else
cc
=
icx
cc
=
icx
fi
fi
if
[[
${
assert_on
}
-eq
1
]]
;
then
ASSERT_OPT
=
""
fi
if
[[
${
support_papi
}
-eq
1
]]
;
if
[[
${
support_papi
}
-eq
1
]]
;
then
then
ADD_PAPI_OPT
S
=
${
PAPI_OPT
S
}
ADD_PAPI_OPT
=
${
PAPI_OPT
}
ADD_PAPI_LIB
=
${
PAPI_LIB
}
ADD_PAPI_LIB
=
${
PAPI_LIB
}
suffix
=
${
suffix
}
.papi
suffix
=
${
suffix
}
.papi
else
else
ADD_PAPI_OPT
S
=
""
ADD_PAPI_OPT
=
""
ADD_PAPI_LIB
=
""
ADD_PAPI_LIB
=
""
fi
fi
cc
${
OPTS
}
${
ADD_PAPI_OPTS
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.1
${
suffix
}
${
SRC_DIR
}
/vect.1.c
${
ADD_PAPI_LIB
}
2> compile.log.out
#
cc
${
OPTS
}
${
ADD_PAPI_OPTS
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.1b
${
suffix
}
${
SRC_DIR
}
/vect.1b.c
-lm
${
ADD_PAPI_LIB
}
2>> compile.log.out
# ===========================================
#
cc
${
OPTS
}
${
ADD_PAPI_OPTS
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.2
${
suffix
}
${
SRC_DIR
}
/vect.2.c
${
ADD_PAPI_LIB
}
2>> compile.log.out
# compile
cc
${
OPTS
}
${
ADD_PAPI_OPTS
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.2b
${
suffix
}
${
SRC_DIR
}
/vect.2b.c
-lm
${
ADD_PAPI_LIB
}
2>> compile.log.out
#
# gcc -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.1b.gcc vect.1b.c
# gcc -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.1b.gcc.papi ../src/vect.1b.c -lm -lpapi
# gcc -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.2.gcc vect.2.c -lm
# gcc -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.2b.gcc vect.2b.c -lm
# gcc -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.2b.gcc.papi ../src/vect.2b.c -lm -lpapi
# gcc -std=c2x -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o compare_outputs compare_outputs.c
# gcc -std=c2x -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o compare_outputs_vforce compare_outputs_vforce.c
# # ------------------- icx
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.1.icx vect.1.c
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.1b.icx
vect.1
b
.c
cc
${
OPTS
}
${
ADD_PAPI_OPT
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.1
${
suffix
}
${
SRC_DIR
}
/
vect.1.c
${
ADD_PAPI_LIB
}
2> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.1b.icx.papi ../src/vect.1b.c -lm -lpapi
cc
${
OPTS
}
${
ADD_PAPI_OPT
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.1b
${
suffix
}
${
SRC_DIR
}
/vect.1b.c
-lm
${
ADD_PAPI_LIB
}
2>> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2.icx vect.2.c -lm
cc
${
OPTS
}
${
ADD_PAPI_OPT
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.2
${
suffix
}
${
SRC_DIR
}
/vect.2.c
${
ADD_PAPI_LIB
}
2>> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2b.icx vect.2b.c -lm
cc
${
OPTS
}
${
ADD_PAPI_OPT
}
-I
${
INC_DIR
}
${
OPTIMIZATION
}
-o
${
X_DIR
}
/vect.2b
${
suffix
}
${
SRC_DIR
}
/vect.2b.c
-lm
${
ADD_PAPI_LIB
}
2>> compile.log.out
# icx -std=c2x -DFILL=25 -DNDEBUG -DUSE_PAPI -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2b.icx.papi ../src/vect.2b.c -lm -lpapi
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