Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
9b661a16
Commit
9b661a16
authored
9 years ago
by
René Fritze
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into travis
parents
dc6154b5
136fe069
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/stuff/common/parallel/threadmanager.cc
+9
-2
9 additions, 2 deletions
dune/stuff/common/parallel/threadmanager.cc
dune/stuff/test/common_string.cc
+2
-2
2 additions, 2 deletions
dune/stuff/test/common_string.cc
with
11 additions
and
4 deletions
dune/stuff/common/parallel/threadmanager.cc
+
9
−
2
View file @
9b661a16
...
...
@@ -20,6 +20,13 @@
#include
<Eigen/Core>
#endif
// some assertions only make sense if dune-fem's threading manager is non-trivial
#if defined(USE_PTHREADS) || defined(_OPENMP)
#define WITH_DUNE_FEM_AND_THREADING(expr) WITH_DUNE_FEM(expr)
#else
#define WITH_DUNE_FEM_AND_THREADING(expr)
#endif
#if HAVE_TBB
#include
<thread>
...
...
@@ -27,14 +34,14 @@
size_t
Dune
::
Stuff
::
ThreadManager
::
max_threads
()
{
const
auto
threads
=
DSC_CONFIG_GET
(
"threading.max_count"
,
1
);
WITH_DUNE_FEM
(
assert
(
Dune
::
Fem
::
ThreadManager
::
maxThreads
()
==
threads
);)
WITH_DUNE_FEM
_AND_THREADING
(
assert
(
Dune
::
Fem
::
ThreadManager
::
maxThreads
()
==
threads
);)
return
threads
;
}
size_t
Dune
::
Stuff
::
ThreadManager
::
current_threads
()
{
const
auto
threads
=
max_threads
();
WITH_DUNE_FEM
(
assert
(
long
(
Dune
::
Fem
::
ThreadManager
::
currentThreads
())
==
long
(
threads
));)
WITH_DUNE_FEM
_AND_THREADING
(
assert
(
long
(
Dune
::
Fem
::
ThreadManager
::
currentThreads
())
==
long
(
threads
));)
return
threads
;
}
...
...
This diff is collapsed.
Click to expand it.
dune/stuff/test/common_string.cc
+
2
−
2
View file @
9b661a16
...
...
@@ -32,7 +32,7 @@ struct MatrixStringTestDouble : public ::testing::Test
{
void
check
()
const
{
EXPECT_EQ
(
"[1
.000000 2.000000; 3.000000 4.000000
]"
,
toString
(
fromString
<
MatrixType
>
(
"[1.0 2; 3.0 4]"
)));
EXPECT_EQ
(
"[1
2; 3 4
]"
,
toString
(
fromString
<
MatrixType
>
(
"[1.0 2; 3.0 4]"
)));
EXPECT_THROW
(
fromString
<
MatrixType
>
(
"[1 2; 3 4]"
,
3
,
3
),
Dune
::
Stuff
::
Exceptions
::
conversion_error
);
}
};
...
...
@@ -52,7 +52,7 @@ struct VectorStringTestDouble : public ::testing::Test
{
void
check
()
const
{
EXPECT_EQ
(
"[1
.000000 2.000000 3.000000
]"
,
toString
(
fromString
<
VectorType
>
(
"[1.0 2 3.0]"
)));
EXPECT_EQ
(
"[1
2 3
]"
,
toString
(
fromString
<
VectorType
>
(
"[1.0 2 3.0]"
)));
EXPECT_THROW
(
fromString
<
VectorType
>
(
"[1.0 2 3.0]"
,
4
),
Dune
::
Stuff
::
Exceptions
::
conversion_error
);
}
};
...
...
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