Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lorenz Huedepohl
ftimings
Commits
0896521b
Commit
0896521b
authored
Jan 27, 2014
by
Lorenz Huedepohl
Browse files
Compile with OpenMP, if available
parent
a30087ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
0896521b
AUTOMAKE_OPTIONS
=
subdir-objects
ACLOCAL_AMFLAGS
=
${ACLOCAL_FLAGS}
-I
m4
AM_CFLAGS
=
@AM_CFLAGS@
AM_LDFLAGS
=
-L
$(libdir)
-Wl
,-rpath
-Wl
,
$(libdir)
@AM_LDFLAGS@
AM_CFLAGS
=
@AM_CFLAGS@
$(OPENMP_CFLAGS)
AM_LDFLAGS
=
-L
$(libdir)
-Wl
,-rpath
-Wl
,
$(libdir)
@AM_LDFLAGS@
$(OPENMP_CFLAGS)
AM_FCFLAGS
=
@AM_FCFLAGS@
$(OPENMP_FCFLAGS)
# libraries
lib_LTLIBRARIES
=
libftimings-@FTIMINGS_API_VERSION@-@FC@.la
...
...
configure.ac
View file @
0896521b
...
...
@@ -6,11 +6,17 @@ AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_LANG([C])
AM_PROG_CC_C_O
AC_OPENMP
AC_LANG([Fortran])
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
AC_FC_FREEFORM
AC_OPENMP
LT_INIT
...
...
@@ -19,6 +25,7 @@ PKG_PROG_PKG_CONFIG
AC_SUBST([FTIMINGS_SO_VERSION], [0:1:0])
AC_SUBST([FTIMINGS_API_VERSION], [0.1])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_FCFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([Makefile
...
...
test/test_timings.F90
View file @
0896521b
...
...
@@ -34,12 +34,14 @@ program test_timings
write
(
*
,
*
)
"Iteration"
,
i
call
timer
%
start
(
"cycle"
,
replace
=
.true.
)
!$ call timer%start("parallel")
!$omp parallel do
do
j
=
1
,
3
do
j
=
1
,
3
0
call
a
()
call
b
()
end
do
!$omp end parallel do
!$ call timer%stop("parallel")
call
timer
%
stop
(
"cycle"
)
if
(
timer
%
is_enabled
())
then
...
...
@@ -55,7 +57,11 @@ program test_timings
write
(
*
,
'(a,f9.6)'
)
" c part: "
,
timer
%
in_entries
(
"c"
)
/
timer
%
get
(
"program"
,
"cycle"
)
write
(
*
,
'(a,f9.6)'
)
" b part: "
,
timer
%
in_entries
(
"b"
)
/
timer
%
get
(
"program"
,
"cycle"
)
write
(
*
,
'(a,f9.6)'
)
" cycle total : "
,
timer
%
get
(
"program"
,
"cycle"
)
#ifndef _OPENMP
write
(
*
,
'(a,f9.6)'
)
" cycle -> a -> b -> c : "
,
timer
%
get
(
"program"
,
"cycle"
,
"a"
,
"b"
,
"c"
)
#else
write
(
*
,
'(a,f9.6)'
)
" cycle -> a -> b -> c : "
,
timer
%
get
(
"program"
,
"cycle"
,
"parallel"
,
"a"
,
"b"
,
"c"
)
#endif
write
(
*
,
*
)
endif
end
do
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment