Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
7dd2354a
Commit
7dd2354a
authored
Jan 04, 2018
by
Matthieu Schaller
Browse files
Better check in place to avoid invalid tasks after splittasks has been called.
parent
10e7b958
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
7dd2354a
...
...
@@ -2976,6 +2976,14 @@ void engine_maketasks(struct engine *e) {
/* Split the tasks. */
scheduler_splittasks
(
sched
);
#ifdef SWIFT_DEBUG_CHECKS
/* Verify that we are not left with invalid tasks */
for
(
int
i
=
0
;
i
<
e
->
sched
.
nr_tasks
;
++
i
)
{
const
struct
task
*
t
=
&
e
->
sched
.
tasks
[
i
];
if
(
t
->
ci
==
NULL
&&
t
->
cj
!=
NULL
&&
!
t
->
skip
)
error
(
"Invalid task"
);
}
#endif
/* Free the old list of cell-task links. */
if
(
e
->
links
!=
NULL
)
free
(
e
->
links
);
e
->
size_links
=
0
;
...
...
src/scheduler.c
View file @
7dd2354a
...
...
@@ -935,12 +935,6 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
enum
task_subtypes
subtype
,
int
flags
,
int
implicit
,
struct
cell
*
ci
,
struct
cell
*
cj
)
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
ci
==
NULL
&&
cj
!=
NULL
)
error
(
"Added a task with ci==NULL and cj!=NULL type=%s/%s"
,
taskID_names
[
type
],
subtaskID_names
[
subtype
]);
#endif
/* Get the next free task. */
const
int
ind
=
atomic_inc
(
&
s
->
tasks_next
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment