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
67e68694
Commit
67e68694
authored
May 23, 2017
by
Andreas Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get method for C interface
parent
23334f01
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
src/elpa_impl.F90
src/elpa_impl.F90
+32
-0
test/C/test.c
test/C/test.c
+4
-1
No files found.
src/elpa_impl.F90
View file @
67e68694
...
...
@@ -301,6 +301,22 @@ module elpa_impl
end
if
end
function
!c> int elpa_get_integer(elpa_t handle, const char *name, int *error);
function
elpa_get_integer_for_c
(
handle
,
name_p
,
error
)
result
(
value
)
bind
(
C
,
name
=
"elpa_get_integer"
)
type
(
c_ptr
),
intent
(
in
),
value
::
handle
type
(
elpa_impl_t
),
pointer
::
self
type
(
c_ptr
),
intent
(
in
),
value
::
name_p
character
(
len
=
elpa_strlen_c
(
name_p
)),
pointer
::
name
integer
(
kind
=
c_int
)
::
value
integer
(
kind
=
c_int
),
optional
,
intent
(
inout
)
::
error
call
c_f_pointer
(
handle
,
self
)
call
c_f_pointer
(
name_p
,
name
)
value
=
elpa_get_integer
(
self
,
name
,
error
)
end
function
!> \brief function to check whether a key/value pair is set
!> Parameters
!> \param self class(elpa_impl_t) the allocated ELPA object
...
...
@@ -419,6 +435,22 @@ module elpa_impl
end
if
end
function
!c> int elpa_get_double(elpa_t handle, const char *name, int *error);
function
elpa_get_double_for_c
(
handle
,
name_p
,
error
)
result
(
value
)
bind
(
C
,
name
=
"elpa_get_double"
)
type
(
c_ptr
),
intent
(
in
),
value
::
handle
type
(
elpa_impl_t
),
pointer
::
self
type
(
c_ptr
),
intent
(
in
),
value
::
name_p
character
(
len
=
elpa_strlen_c
(
name_p
)),
pointer
::
name
real
(
kind
=
c_double
)
::
value
integer
(
kind
=
c_int
),
optional
,
intent
(
inout
)
::
error
call
c_f_pointer
(
handle
,
self
)
call
c_f_pointer
(
name_p
,
name
)
value
=
elpa_get_double
(
self
,
name
,
error
)
end
function
function
elpa_associate_int
(
self
,
name
)
result
(
value
)
use
iso_c_binding
...
...
test/C/test.c
View file @
67e68694
...
...
@@ -107,7 +107,7 @@ int main(int argc, char** argv) {
elpa_t
handle
;
int
value
;
#ifdef WITH_MPI
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
nprocs
);
...
...
@@ -217,6 +217,9 @@ int main(int argc, char** argv) {
assert_elpa_ok
(
error
);
#endif
value
=
elpa_get_integer
(
handle
,
"solver"
,
&
error
);
printf
(
"Solver is set to %d
\n
"
,
value
);
/* Solve EV problem */
elpa_solve
(
handle
,
a
,
ev
,
z
,
&
error
);
assert_elpa_ok
(
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