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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SLMS
loadbalancing
Commits
6f6c41d0
Commit
6f6c41d0
authored
4 years ago
by
Stephan Schulz
Browse files
Options
Downloads
Patches
Plain Diff
update documentation regarding example projects
parent
b409eff3
No related branches found
No related tags found
1 merge request
!15
CMake projectconfig
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/Examples.rst
+64
-3
64 additions, 3 deletions
docs/Examples.rst
with
64 additions
and
3 deletions
docs/Examples.rst
+
64
−
3
View file @
6f6c41d0
...
@@ -5,8 +5,69 @@ Examples
...
@@ -5,8 +5,69 @@ Examples
In the ``/examples`` sub directory several C++ and Fortran example
In the ``/examples`` sub directory several C++ and Fortran example
programs are placed.
programs are placed.
Projects
--------
CMake
^^^^^
In the ``/examples`` directory are two example CMake projects. One uses a
separately installed (or at least compiled) ALL, and the other includes
the library as a subdirectory and builds it along with the main project.
When copying the example projects, make sure the symbolic links are still
resolved. The example programs of the project are just linked from the
examples, with the exception of ``ALL_test.cpp``. This program is
modified, so different feature flags are used for VTK and Voronoi, to test
external usage of these features. The change happens in the shell script
building the project.
In both cases, if VTK output is enabled, CMake must be able to find it. If
it is not able to by default, or a specific version should be used, set
VTK_DIR to the directory containing VTK's CMake configuration. For our
test system, which uses VTK 7.1, this is the ``/lib/cmake/vtk-7.1``
subdirectory of the install prefix of VTK.
Package
"""""""
The example project using ``find_package`` is available in
``/example/CMakeProject``. The full build steps are visible from
``build_all.sh``, which first compiles the library and then the example
project, after setting ``ALL_DIR`` (and ``VTK_DIR``).
In general, it suffices to just use ``find_package(ALL 0.9)`` in your
project's ``CMakeLists.txt`` and then link the corresponding executables
against this using ``target_link_library(YOUR_TARGET PUBLIC ALL:ALL)``.
The libraries targets are exported in the ``ALL::`` namespace. The Fortran
module is then ``ALL::ALL_fortran``.
Subdirectory
""""""""""""
This project includes the library directly in the source tree via
``add_subdirectory``. To avoid cyclic symbolic links, this version does
not run out of the box, since we need the source tree of the library as a
subdirectory of the project's directory. So copy the contents of
``/example/CMakeProjectSubdir``. The files assume the library to reside in
the subdirectory ``all`` and, if VTK is enabled, the VTK installation
in ``vtk_bin``. Also remember, that the symbolic links still resolve. Then
you can just run CMake and the project, along with the library, will be
build. This is also referenced in ``build_all.sh``.
The targets you have to link your executables against are, however, ``ALL``
or ``ALL_fortran`` respectively. The library is only namespaced if using
the aforementioned ``find_package`` method. And some name collisions may
therefore also occur. Using this method causes the library to be
automatically be build, but also to be rebuild every time the build
directory is cleaned.
Programs
--------
``ALL_test``
``ALL_test``
------------
^^^^^^^^^^^^
MPI C++ code that generates a particle distribution over the domains. At
MPI C++ code that generates a particle distribution over the domains. At
program start the domains form an orthogonal decomposition of the cubic 3d
program start the domains form an orthogonal decomposition of the cubic 3d
system. Each domain has the same volume as each other domain. Depending
system. Each domain has the same volume as each other domain. Depending
...
@@ -57,7 +118,7 @@ not already exist. The resulting output can be visualized with tools like
...
@@ -57,7 +118,7 @@ not already exist. The resulting output can be visualized with tools like
ParaView or VisIt.
ParaView or VisIt.
``ALL_test_f`` and ``ALL_test_f_obj``
``ALL_test_f`` and ``ALL_test_f_obj``
-------------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Fortran example provides a more basic version of the test program
The Fortran example provides a more basic version of the test program
``ALL_test``, as its main goal is to show the functionality of the Fortran
``ALL_test``, as its main goal is to show the functionality of the Fortran
interface. The code creates a basic uniform orthogonal domain
interface. The code creates a basic uniform orthogonal domain
...
@@ -67,7 +128,7 @@ out the domain distribution of the start configuration and of the final
...
@@ -67,7 +128,7 @@ out the domain distribution of the start configuration and of the final
configuration.
configuration.
``ALL_Staggered`` and ``ALL_Staggered_f``
``ALL_Staggered`` and ``ALL_Staggered_f``
-----------------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
These create a very simple load balancing situation with fixed load and
These create a very simple load balancing situation with fixed load and
domains placed along the z direction. The C++ and Fortran versions are
domains placed along the z direction. The C++ and Fortran versions are
functionally the same, so the differences between the interfaces can be
functionally the same, so the differences between the interfaces can be
...
...
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