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
aeeb6982
Commit
aeeb6982
authored
6 months ago
by
Luca Tornatore
Browse files
Options
Downloads
Patches
Plain Diff
shaped as a proper script
parent
dd6f7e87
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
+108
-5
108 additions, 5 deletions
src/compile
with
108 additions
and
5 deletions
src/compile
100644 → 100755
+
108
−
5
View file @
aeeb6982
#!/bin/bash
gcc -std=c2x -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.1 vect.1.c
gcc -std=c2x -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.1b vect.1b.c
print_help
()
{
echo
" an argument is needed at least"
echo
" compile -c name [-p]"
echo
" -c
\$
compiler_name : specifies the compiler to be used { gcc, icx }"
echo
" -p : activates PAPI support "
exit
0
}
gcc -std=c2x -DNDEBUG -I../headers -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops -o vect.2 vect.2.c
SRC_DIR
=
../src
X_DIR
=
.
INC_DIR
=
../headers
PAPI_OPTS
=
" -DUSE_PAPI "
PAPI_LIB
=
"-lpapi"
OPTS
=
" -std=c2x -DFILL=25 -DNDEBUG "
GCC_OPTS
=
" -O3 -march=native -mtune=native -ftree-vectorize -funroll-loops "
ICX_OPTS
=
" -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 "
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
\ No newline at end of file
compiler
=
0
gcc
=
1
icx
=
2
support_papi
=
0
CLOPTIONS
=
"c:ph"
if
[[
$#
-lt
1
]]
;
then
print_help
;
fi
while
getopts
${
CLOPTIONS
}
opt
;
do
case
${
opt
}
in
c
)
if
[[
$OPTARG
==
[
Gg][Cc][Cc]
]]
;
then
echo
"compile with gcc"
compiler
=
$gcc
elif
[[
"
$OPTARG
"
==
[
Ii][Cc][Xx]
]]
;
then
echo
"compile with icx"
compiler
=
$icx
else
echo
"unsupported compiler"
exit
1
fi
;;
p
)
support_papi
=
1
echo
"compile with PAPI support"
;;
h
)
print_help
;;
:
)
echo
"option -
${
OPTARG
}
requires an argument"
;;
?
)
echo
"invalid option -
${
OPTARG
}
"
;;
esac
done
if
[
${
compiler
}
==
${
gcc
}
]
;
then
suffix
=
.gcc
OPTIMIZATION
=
${
GCC_OPTS
}
cc
=
gcc
else
suffix
=
.icx
OPTIMIZATION
=
${
ICX_OPTS
}
cc
=
icx
fi
if
[[
${
support_papi
}
-eq
1
]]
;
then
ADD_PAPI_OPTS
=
${
PAPI_OPTS
}
ADD_PAPI_LIB
=
${
PAPI_LIB
}
suffix
=
${
suffix
}
.papi
else
ADD_PAPI_OPTS
=
""
ADD_PAPI_LIB
=
""
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
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.1b.c
# 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
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2.icx vect.2.c -lm
# icx -std=c2x -DFILL=25 -DNDEBUG -I../headers -O3 -xHost -vec -axCORE-AVX2,CORE-AVX512 -o vect.2b.icx vect.2b.c -lm
# 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