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
b0a3c8d6
Commit
b0a3c8d6
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Align the tasks when allocated. Alignment set to 32 bytes.
parent
e15891f8
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!238
Pack the task types and re-arrange the task structure to go from 80 bytes to 64 bytes.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/scheduler.c
+9
-5
9 additions, 5 deletions
src/scheduler.c
src/task.h
+14
-11
14 additions, 11 deletions
src/task.h
with
23 additions
and
16 deletions
src/scheduler.c
+
9
−
5
View file @
b0a3c8d6
...
...
@@ -763,8 +763,9 @@ void scheduler_set_unlocks(struct scheduler *s) {
t
->
unlock_tasks
=
&
s
->
unlocks
[
offsets
[
k
]];
}
#ifdef SWIFT_DEBUG_CHECKS
/* Verify that there are no duplicate unlocks. */
/*
for (int k = 0; k < s->nr_tasks; k++) {
for
(
int
k
=
0
;
k
<
s
->
nr_tasks
;
k
++
)
{
struct
task
*
t
=
&
s
->
tasks
[
k
];
for
(
int
i
=
0
;
i
<
t
->
nr_unlock_tasks
;
i
++
)
{
for
(
int
j
=
i
+
1
;
j
<
t
->
nr_unlock_tasks
;
j
++
)
{
...
...
@@ -772,7 +773,8 @@ void scheduler_set_unlocks(struct scheduler *s) {
error
(
"duplicate unlock!"
);
}
}
} */
}
#endif
/* Clean up. */
free
(
counts
);
...
...
@@ -861,9 +863,11 @@ void scheduler_reset(struct scheduler *s, int size) {
if
(
s
->
tasks_ind
!=
NULL
)
free
(
s
->
tasks_ind
);
/* Allocate the new lists. */
if
((
s
->
tasks
=
(
struct
task
*
)
malloc
(
sizeof
(
struct
task
)
*
size
))
==
NULL
||
(
s
->
tasks_ind
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
size
))
==
NULL
)
if
(
posix_memalign
((
void
*
)
&
s
->
tasks
,
task_align
,
size
*
sizeof
(
struct
task
))
!=
0
)
error
(
"Failed to allocate task array."
);
if
((
s
->
tasks_ind
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
size
))
==
NULL
)
error
(
"Failed to allocate task lists."
);
}
...
...
This diff is collapsed.
Click to expand it.
src/task.h
+
14
−
11
View file @
b0a3c8d6
...
...
@@ -29,6 +29,8 @@
#include
"cell.h"
#include
"cycle.h"
#define task_align 32
/**
* @brief The different task types.
*/
...
...
@@ -103,6 +105,16 @@ struct task {
/*! Start and end time of this task */
ticks
tic
,
toc
;
#ifdef WITH_MPI
/*! Buffer for this task's communications */
void
*
buff
;
/*! MPI request corresponding to this task */
MPI_Request
req
;
#endif
/*! Flags used to carry additional information (e.g. sort directions) */
int
flags
;
...
...
@@ -121,16 +133,6 @@ struct task {
/*! Number of unsatisfied dependencies */
short
int
wait
;
#ifdef WITH_MPI
/*! Buffer for this task's communications */
void
*
buff
;
/*! MPI request corresponding to this task */
MPI_Request
req
;
#endif
/*! Type of the task */
enum
task_types
type
;
...
...
@@ -145,7 +147,8 @@ struct task {
/*! Is this task implicit (i.e. does not do anything) ? */
char
implicit
;
};
}
__attribute__
((
aligned
(
task_align
)));
/* Function prototypes. */
void
task_unlock
(
struct
task
*
t
);
...
...
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