Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pairs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
software
pairs
Commits
e0ffcc87
Commit
e0ffcc87
authored
2 months ago
by
Behzad Safaei
Browse files
Options
Downloads
Patches
Plain Diff
Fix: expose waLBerla dependencies of P4IRS to consumer projects
parent
128e3ca3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+14
-7
14 additions, 7 deletions
CMakeLists.txt
cmake/pairs-config.cmake.in
+0
-1
0 additions, 1 deletion
cmake/pairs-config.cmake.in
src/pairs/code_gen/cgen.py
+3
-0
3 additions, 0 deletions
src/pairs/code_gen/cgen.py
src/pairs/sim/simulation.py
+2
-0
2 additions, 0 deletions
src/pairs/sim/simulation.py
with
19 additions
and
8 deletions
CMakeLists.txt
+
14
−
7
View file @
e0ffcc87
...
...
@@ -64,7 +64,6 @@ set(PAIRS_TARGET "pairs")
# PAIRS dependencies
set
(
PAIRS_LINK_LIBRARIES
)
set
(
PAIRS_LINK_DIRS
${
CMAKE_CURRENT_BINARY_DIR
}
)
set
(
PAIRS_INCLUDE_DIRS
${
CMAKE_CURRENT_BINARY_DIR
}
)
# The target can either be an executable or a static library
...
...
@@ -72,7 +71,9 @@ if(USER_SOURCE_FILES)
add_executable
(
${
PAIRS_TARGET
}
${
RUNTIME_COMMON_FILES
}
)
else
()
add_library
(
${
PAIRS_TARGET
}
STATIC
${
RUNTIME_COMMON_FILES
}
)
list
(
APPEND PAIRS_LINK_LIBRARIES
${
PAIRS_TARGET
}
)
# TODO: Get the location with $<TARGET_FILE> generator expression (at build time)
list
(
APPEND PAIRS_LINK_LIBRARIES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/lib
${
PAIRS_TARGET
}
.a"
)
endif
()
# Include P4IRS 'runtime' dir
...
...
@@ -119,12 +120,18 @@ if(USE_WALBERLA)
waLBerla_import
()
# Recent issue from the waLBerla side: warnings about empty CUDA_ARCHITECTURES for walberla_gpu
set
(
PAIRS_WALBERLA_DEPENDENCIES walberla::blockforest walberla::core
)
target_link_libraries
(
${
PAIRS_TARGET
}
PUBLIC
${
PAIRS_WALBERLA_DEPENDENCIES
}
)
target_link_libraries
(
${
PAIRS_TARGET
}
PUBLIC
walberla::blockforest
walberla::domain_decomposition
walberla::core
stdc++fs
)
## TODO: PAIRS_LINK_DIRS and PAIRS_LINK_LIBRARIES for walberla modules *AND* their dependencies
## This implemention only works if the consumer of the library is itself a walberla app (made within the build system of walberla)
list
(
APPEND PAIRS_LINK_LIBRARIES
${
PAIRS_WALBERLA_DEPENDENCIES
}
)
# TODO: Get the location with $<TARGET_FILE> generator expression (at build time)
list
(
APPEND PAIRS_LINK_LIBRARIES
${
CMAKE_CURRENT_BINARY_DIR
}
/external/walberla/src/blockforest/libwalberla_blockforest.a
)
list
(
APPEND PAIRS_LINK_LIBRARIES
${
CMAKE_CURRENT_BINARY_DIR
}
/external/walberla/src/domain_decomposition/libwalberla_domain_decomposition.a
)
list
(
APPEND PAIRS_LINK_LIBRARIES
${
CMAKE_CURRENT_BINARY_DIR
}
/external/walberla/src/core/libwalberla_core.a
)
list
(
APPEND PAIRS_LINK_LIBRARIES stdc++fs
)
endif
()
#================================================================================
...
...
This diff is collapsed.
Click to expand it.
cmake/pairs-config.cmake.in
+
0
−
1
View file @
e0ffcc87
...
...
@@ -2,5 +2,4 @@ set ( pairs_SOURCE_DIR @pairs_SOURCE_DIR@ )
set ( pairs_BINARY_DIR @pairs_BINARY_DIR@ )
set ( PAIRS_LINK_LIBRARIES @PAIRS_LINK_LIBRARIES@ )
set ( PAIRS_LINK_DIRS @PAIRS_LINK_DIRS@ )
set ( PAIRS_INCLUDE_DIRS @PAIRS_INCLUDE_DIRS@ )
This diff is collapsed.
Click to expand it.
src/pairs/code_gen/cgen.py
+
3
−
0
View file @
e0ffcc87
...
...
@@ -147,6 +147,9 @@ class CGen:
self
.
print
(
"
#define PAIRS_TARGET_OPENMP
"
)
self
.
print
(
"
#include <omp.h>
"
)
if
self
.
sim
.
_use_walberla
:
self
.
print
(
"
#define USE_WALBERLA
"
)
self
.
print
(
"
#include <limits.h>
"
)
self
.
print
(
"
#include <math.h>
"
)
self
.
print
(
"
#include <stdbool.h>
"
)
...
...
This diff is collapsed.
Click to expand it.
src/pairs/sim/simulation.py
+
2
−
0
View file @
e0ffcc87
...
...
@@ -93,6 +93,7 @@ class Simulation:
# Domain partitioning
self
.
_dom_part
=
None
self
.
_partitioner
=
None
self
.
_use_walberla
=
False
self
.
_comm
=
None
# Contact history
...
...
@@ -122,6 +123,7 @@ class Simulation:
elif
partitioner
==
DomainPartitioners
.
BlockForest
:
self
.
_dom_part
=
BlockForest
(
self
)
self
.
_use_walberla
=
True
else
:
raise
Exception
(
"
Invalid domain partitioner.
"
)
...
...
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