Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
elpa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
elpa
elpa
Commits
6bd4170e
Commit
6bd4170e
authored
Dec 01, 2017
by
Andreas Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optional error code for autotune setup
parent
5be9556b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
14 deletions
+44
-14
src/elpa_api.F90
src/elpa_api.F90
+8
-3
src/elpa_impl.F90
src/elpa_impl.F90
+30
-8
test/C/autotune_c_version.c
test/C/autotune_c_version.c
+3
-1
test/Fortran/test_autotune.F90
test/Fortran/test_autotune.F90
+3
-2
No files found.
src/elpa_api.F90
View file @
6bd4170e
...
...
@@ -230,12 +230,17 @@ module elpa_api
!> \param domain integer: domain (real/complex) which should be tuned
!> \result tune_state class(elpa_autotune_t): the autotuning object
abstract
interface
function
elpa_autotune_setup_i
(
self
,
level
,
domain
)
result
(
tune_state
)
function
elpa_autotune_setup_i
(
self
,
level
,
domain
,
error
)
result
(
tune_state
)
import
elpa_t
,
elpa_autotune_t
implicit
none
class
(
elpa_t
),
intent
(
inout
),
target
::
self
integer
,
intent
(
in
)
::
level
,
domain
class
(
elpa_autotune_t
),
pointer
::
tune_state
integer
,
intent
(
in
)
::
level
,
domain
class
(
elpa_autotune_t
),
pointer
::
tune_state
#ifdef USE_FORTRAN2008
integer
,
optional
::
error
#else
integer
::
error
#endif
end
function
end
interface
...
...
src/elpa_impl.F90
View file @
6bd4170e
...
...
@@ -2609,16 +2609,34 @@ module elpa_impl
!> \param level integer: the "thoroughness" of the planed autotuning
!> \param domain integer: the domain (real/complex) which should be tuned
!> \result tune_state class(elpa_autotune_t): the created autotuning object
function
elpa_autotune_setup
(
self
,
level
,
domain
)
result
(
tune_state
)
function
elpa_autotune_setup
(
self
,
level
,
domain
,
error
)
result
(
tune_state
)
class
(
elpa_impl_t
),
intent
(
inout
),
target
::
self
integer
,
intent
(
in
)
::
level
,
domain
type
(
elpa_autotune_impl_t
),
pointer
::
ts_impl
class
(
elpa_autotune_t
),
pointer
::
tune_state
#ifdef USE_FORTRAN2008
integer
(
kind
=
c_int
),
optional
::
error
#else
integer
(
kind
=
c_int
)
::
error
#endif
#ifdef USE_FORTRAN2008
if
(
present
(
error
))
then
error
=
ELPA_OK
endif
#else
error
=
ELPA_OK
#endif
if
(
elpa_get_api_version
()
<
EARLIEST_AUTOTUNE_VERSION
)
then
write
(
error_unit
,
"(a,i0,a)"
)
"ELPA: Error API version: Autotuning does not support"
,
elpa_get_api_version
()
stop
write
(
error_unit
,
"(a,i0,a)"
)
"ELPA: Error API version: Autotuning does not support "
,
elpa_get_api_version
()
#ifdef USE_FORTRAN2008
if
(
present
(
error
))
then
error
=
ELPA_ERROR
endif
#else
error
=
ELPA_ERROR
#endif
return
endif
allocate
(
ts_impl
)
...
...
@@ -2644,8 +2662,8 @@ module elpa_impl
!c> * \param int domain: real/complex autotuning
!c> * \result elpa_autotune_t handle: on the autotune object
!c> */
!c> elpa_autotune_t elpa_autotune_setup(elpa_t handle, int level, int domain);
function
elpa_autotune_setup_c
(
handle
,
level
,
domain
)
result
(
ptr
)
bind
(
C
,
name
=
"elpa_autotune_setup"
)
!c> elpa_autotune_t elpa_autotune_setup(elpa_t handle, int level, int domain
, int *error
);
function
elpa_autotune_setup_c
(
handle
,
level
,
domain
,
error
)
result
(
ptr
)
bind
(
C
,
name
=
"elpa_autotune_setup"
)
type
(
c_ptr
),
intent
(
in
),
value
::
handle
type
(
elpa_impl_t
),
pointer
::
self
class
(
elpa_autotune_t
),
pointer
::
tune_state
...
...
@@ -2653,14 +2671,18 @@ module elpa_impl
integer
(
kind
=
c_int
),
intent
(
in
),
value
::
level
integer
(
kind
=
c_int
),
intent
(
in
),
value
::
domain
type
(
c_ptr
)
::
ptr
#ifdef USE_FORTRAN2008
integer
(
kind
=
c_int
)
,
intent
(
in
),
optional
::
error
#else
integer
(
kind
=
c_int
)
,
intent
(
in
)
::
error
#endif
print
*
,
"Calling c_f_pointer handle"
call
c_f_pointer
(
handle
,
self
)
print
*
,
"Calling setup"
print
*
,
level
,
domain
tune_state
=>
self
%
autotune_setup
(
level
,
domain
)
tune_state
=>
self
%
autotune_setup
(
level
,
domain
,
error
)
print
*
,
"After setup"
select
type
(
tune_state
)
class
is
(
elpa_autotune_impl_t
)
...
...
test/C/autotune_c_version.c
View file @
6bd4170e
...
...
@@ -238,7 +238,9 @@ int main(int argc, char** argv) {
mpierr
=
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
autotune_handle
=
elpa_autotune_setup
(
handle
,
ELPA_AUTOTUNE_FAST
,
ELPA_AUTOTUNE_DOMAIN_REAL
);
autotune_handle
=
elpa_autotune_setup
(
handle
,
ELPA_AUTOTUNE_FAST
,
ELPA_AUTOTUNE_DOMAIN_REAL
,
&
error
);
assert_elpa_ok
(
error
);
/* mimic 10 scf steps */
for
(
i
=
0
;
i
<
20
;
i
++
)
{
...
...
test/Fortran/test_autotune.F90
View file @
6bd4170e
...
...
@@ -197,13 +197,14 @@ program test
assert_elpa_ok
(
error
)
#endif
call
e
%
set
(
"timings"
,
1
)
call
e
%
set
(
"debug"
,
1
)
!
call e%set("debug",1)
assert_elpa_ok
(
e
%
setup
())
if
(
myid
==
0
)
print
*
,
""
tune_state
=>
e
%
autotune_setup
(
ELPA_AUTOTUNE_FAST
,
AUTOTUNE_DOMAIN
)
tune_state
=>
e
%
autotune_setup
(
ELPA_AUTOTUNE_FAST
,
AUTOTUNE_DOMAIN
,
error
)
assert_elpa_ok
(
error
)
do
while
(
e
%
autotune_step
(
tune_state
))
call
e
%
eigenvectors
(
a
,
ev
,
z
,
error
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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