Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
c7a3acb0
Commit
c7a3acb0
authored
2 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Only expose pthread_setaffinity_np call when HAVE_SETAFFINITY is defined
parent
992ac5f3
No related branches found
No related tags found
3 merge requests
!1715
Update planetary strength after planetary plus's master rebase
,
!1693
More threapool plotting tweaks
,
!1687
Only expose pthread_setaffinity_np call when HAVE_SETAFFINITY is defined
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/threadpool.c
+4
-0
4 additions, 0 deletions
src/threadpool.c
with
4 additions
and
0 deletions
src/threadpool.c
+
4
−
0
View file @
c7a3acb0
...
@@ -44,8 +44,10 @@
...
@@ -44,8 +44,10 @@
static
pthread_key_t
threadpool_tid
;
static
pthread_key_t
threadpool_tid
;
/* Affinity mask shared by all threads, and if set. */
/* Affinity mask shared by all threads, and if set. */
#ifdef HAVE_SETAFFINITY
static
cpu_set_t
thread_affinity
;
static
cpu_set_t
thread_affinity
;
static
int
thread_affinity_set
=
0
;
static
int
thread_affinity_set
=
0
;
#endif
/* Local declarations. */
/* Local declarations. */
static
void
threadpool_apply_affinity_mask
(
void
);
static
void
threadpool_apply_affinity_mask
(
void
);
...
@@ -446,7 +448,9 @@ void threadpool_set_affinity_mask(cpu_set_t *affinity) {
...
@@ -446,7 +448,9 @@ void threadpool_set_affinity_mask(cpu_set_t *affinity) {
*
*
*/
*/
static
void
threadpool_apply_affinity_mask
(
void
)
{
static
void
threadpool_apply_affinity_mask
(
void
)
{
#ifdef HAVE_SETAFFINITY
if
(
thread_affinity_set
)
{
if
(
thread_affinity_set
)
{
pthread_setaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
thread_affinity
);
pthread_setaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
thread_affinity
);
}
}
#endif
}
}
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