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
3a2b9c9f
Commit
3a2b9c9f
authored
Nov 14, 2019
by
Stephan Schulz
Browse files
Options
Downloads
Patches
Plain Diff
add initial new interface, temporarily called ALL_module_obj, only external interface for now
parent
eb559d04
No related branches found
No related tags found
1 merge request
!8
Refactor
Pipeline
#25943
failed
Nov 14, 2019
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ALL_module_obj.F90
+106
-0
106 additions, 0 deletions
src/ALL_module_obj.F90
src/CMakeLists.txt
+2
-2
2 additions, 2 deletions
src/CMakeLists.txt
with
108 additions
and
2 deletions
src/ALL_module_obj.F90
0 → 100644
+
106
−
0
View file @
3a2b9c9f
module
ALL_module_obj
use
iso_c_binding
implicit
none
private
! The different loadbalancing methods. Must be kept in sync with C side.
! TODO reuse those from C side (is that possible?)
integer
(
c_int
),
public
,
parameter
::
ALL_STAGGERED
=
0
integer
(
c_int
),
public
,
parameter
::
ALL_TENSOR
=
1
integer
(
c_int
),
public
,
parameter
::
ALL_UNSTRUCTURED
=
2
integer
(
c_int
),
public
,
parameter
::
ALL_VORONOI
=
3
integer
(
c_int
),
public
,
parameter
::
ALL_HISTOGRAM
=
4
! Direct interface with C wrapper
! TODO put this into separate file, and only have the wrappers and convenience functions here
! The interface should not be public! Only this module counts as the public API!
! We do not consider the C functions public! Can we somehow keep them private?
! TODO support optionally mpi_f08 using CMAKE_ALL_USE_F08 / ALL_USE_F08
! TODO add intent() to dummy arguments
interface
function
all_init_f
(
method
,
dim
,
gamma
)
result
(
this
)
bind
(
C
)
use
iso_c_binding
integer
(
c_int
),
value
::
method
integer
(
c_int
),
value
::
dim
integer
(
c_int
),
value
::
gamma
type
(
c_ptr
)
::
this
end
function
! TODO separate function to set tag
subroutine
all_set_proc_grid_params_f
(
obj
,
loc
,
nloc
,
size
,
nsize
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
),
dimension
(
nloc
)
::
loc
integer
(
c_int
),
value
::
nloc
integer
(
c_int
),
dimension
(
nsize
)
::
size
integer
(
c_int
),
value
::
nsize
end
subroutine
subroutine
all_set_min_domain_size_f
(
obj
,
dim
,
domain_size
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
),
value
::
dim
real
(
c_double
),
dimension
(
dim
)
::
domain_size
end
subroutine
subroutine
all_set_work_f
(
obj
,
work
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
real
(
c_double
),
value
::
work
end
subroutine
! TODO is dim here really necessary? How should the public API be, just vertices I assume
! check the C++ API
subroutine
all_set_vertices_f
(
obj
,
n
,
dim
,
vertices
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
),
value
::
n
integer
(
c_int
),
value
::
dim
real
(
c_double
),
dimension
(
n
*
dim
)
::
vertices
end
subroutine
! TODO Change for mpi_f08!
subroutine
all_set_communicator_f
(
obj
,
comm
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
,
value
::
comm
end
subroutine
subroutine
all_setup_f
(
obj
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
end
subroutine
subroutine
all_balance_f
(
obj
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
end
subroutine
subroutine
all_get_new_number_of_vertices_f
(
obj
,
n
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
)
::
n
end
subroutine
! TODO is n here needed? may it be inout?
! TODO automatically get number of vertices
! TODO check length of vertices (need dim for that, length is n*dim)
subroutine
all_get_vertices_f
(
obj
,
n
,
vertices
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
),
value
::
n
real
(
c_double
),
dimension
(
*
)
::
vertices
end
subroutine
! TODO same as all_get_vertices_f
subroutine
all_get_prev_vertices
(
obj
,
n
,
vertices
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
),
value
::
n
real
(
c_double
),
dimension
(
*
)
::
vertices
end
subroutine
subroutine
all_print_vtk_outlines_f
(
obj
,
step
)
bind
(
C
)
use
iso_c_binding
type
(
c_ptr
),
value
::
obj
integer
(
c_int
),
value
::
step
end
subroutine
end
interface
type
,
public
::
ALL_t
type
(
c_ptr
),
private
::
object
=
C_NULL_PTR
contains
procedure
::
init
=>
ALL_init
end
type
contains
!> Initializes the loadbalancing object
subroutine
ALL_init
(
this
)
class
(
ALL_t
),
intent
(
out
)
::
this
end
subroutine
end
module
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
2
−
2
View file @
3a2b9c9f
...
...
@@ -35,7 +35,7 @@ install(FILES ${ALL_HEADER_FILES}
if
(
CM_ALL_FORTRAN
)
set
(
CMAKE_Fortran_MODULE_DIRECTORY
${
CMAKE_BINARY_DIR
}
/modules
)
add_library
(
ALL_fortran ALL_module.f90
)
add_library
(
ALL_fortran ALL_module.f90
ALL_module_obj.F90
)
set_property
(
TARGET ALL_fortran PROPERTY LINKER_LANGUAGE Fortran
)
if
(
CM_ALL_VTK_OUTPUT
)
...
...
@@ -47,7 +47,7 @@ if (CM_ALL_FORTRAN)
# target_link_libraries(ALL_fortran PUBLIC ${CM_ALL_VORO_LIB})
#endif(CM_ALL_VORONOI)
target_include_directories
(
ALL_fortran PUBLIC
${
MPI_
CXX
_INCLUDE_PATH
}
)
target_include_directories
(
ALL_fortran PUBLIC
${
MPI_
Fortran
_INCLUDE_PATH
}
)
target_include_directories
(
ALL_fortran PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
${
ALL_INCLUDE_DIR
}
)
target_link_libraries
(
ALL_fortran PUBLIC
${
MPI_Fortran_LINK_FLAGS
}
${
MPI_Fortran_LIBRARIES
}
ALL
)
...
...
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