Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loadbalancing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SLMS
loadbalancing
Commits
a2b1d43d
Commit
a2b1d43d
authored
Nov 20, 2020
by
Stephan Schulz
Browse files
Options
Downloads
Patches
Plain Diff
add multi dimensional setWork in Fortran interface (
#18
)
parent
98754cd3
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!8
Refactor
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ALL_fortran.cpp
+8
-0
8 additions, 0 deletions
src/ALL_fortran.cpp
src/ALL_module.F90
+20
-0
20 additions, 0 deletions
src/ALL_module.F90
with
28 additions
and
0 deletions
src/ALL_fortran.cpp
+
8
−
0
View file @
a2b1d43d
...
...
@@ -112,6 +112,14 @@ void all_set_work_c(ALL::ALL<double, double> *all_obj, double work) {
ALL_catch
}
// set multidimensional work
void
all_set_work_multi_c
(
ALL
::
ALL
<
double
,
double
>
*
all_obj
,
double
*
work
,
int
dim
)
{
ALL_try
std
::
vector
<
double
>
t_work
(
work
,
work
+
dim
);
all_obj
->
setWork
(
t_work
);
ALL_catch
}
// wrapper to set the vertices (using an array of double values and dimension)
void
all_set_vertices_c
(
ALL
::
ALL
<
double
,
double
>
*
all_obj
,
const
int
n
,
const
int
dim
,
const
double
*
vertices
)
{
...
...
This diff is collapsed.
Click to expand it.
src/ALL_module.F90
+
20
−
0
View file @
a2b1d43d
...
...
@@ -101,6 +101,12 @@ module ALL_module
type
(
c_ptr
),
value
::
obj
real
(
c_double
),
value
::
work
end
subroutine
subroutine
all_set_work_multi_c
(
obj
,
work
,
dim
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
),
value
::
dim
real
(
c_double
),
dimension
(
dim
)
::
work
end
subroutine
subroutine
all_set_vertices_c
(
obj
,
n
,
dim
,
vertices
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
...
...
@@ -178,6 +184,7 @@ module ALL_module
procedure
::
set_proc_tag
=>
ALL_set_proc_tag
procedure
::
set_min_domain_size
=>
ALL_set_min_domain_size
procedure
::
set_work
=>
ALL_set_work
procedure
::
set_work_multi
=>
ALL_set_work_multi
procedure
::
set_vertices
=>
ALL_set_vertices
#ifdef ALL_USE_F08
procedure
::
set_communicator
=>
ALL_set_communicator_f08
...
...
@@ -203,6 +210,7 @@ module ALL_module
public
::
ALL_set_proc_tag
public
::
ALL_set_min_domain_size
public
::
ALL_set_work
public
::
ALL_set_work_multi
public
::
ALL_set_vertices
public
::
ALL_set_communicator
public
::
ALL_setup
...
...
@@ -270,6 +278,18 @@ contains
real
(
c_double
),
intent
(
in
)
::
work
!< work of this domain
call
all_set_work_c
(
this
%
object
,
work
)
end
subroutine
!> Set multi dimensional work of this process
subroutine
ALL_set_work_multi
(
this
,
work
)
class
(
ALL_t
),
intent
(
in
)
::
this
real
(
c_double
),
dimension
(:),
intent
(
in
)
::
work
!< multi dimensional work of this domain
#ifndef NDEBUG
if
(
size
(
work
)
/
=
this
%
dim
)
then
write
(
error_unit
,
'(a)'
)
"ALL_set_work_multi: Wrong dimension for work"
stop
endif
#endif
call
all_set_work_multi_c
(
this
%
object
,
work
,
size
(
work
))
end
subroutine
!> Set new vertices
!!
!! @todo write interface for single rank array of vertices
...
...
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