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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
8140bea2
Commit
8140bea2
authored
Sep 5, 2013
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
load tasks while runners are already waiting.
Former-commit-id: b93c21c2c9c91d6984fd56b0386a6caf75557596
parent
4ff6ec97
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.c
+24
-21
24 additions, 21 deletions
src/engine.c
src/scheduler.c
+1
-1
1 addition, 1 deletion
src/scheduler.c
with
25 additions
and
22 deletions
src/engine.c
+
24
−
21
View file @
8140bea2
...
...
@@ -213,7 +213,7 @@ void engine_repartition ( struct engine *e ) {
struct
task
*
t
,
*
tasks
=
e
->
sched
.
tasks
;
struct
cell
*
ci
,
*
cj
;
int
nr_nodes
=
e
->
nr_nodes
,
nodeID
=
e
->
nodeID
,
*
nodeIDs
;
float
wscale
=
0
.
01
;
float
wscale
=
0
.
00
01
;
/* Clear the repartition flag. */
e
->
forcerepart
=
0
;
...
...
@@ -1184,7 +1184,6 @@ void engine_rebuild ( struct engine *e ) {
void
engine_prepare
(
struct
engine
*
e
)
{
int
rebuild
;
struct
scheduler
*
sched
=
&
e
->
sched
;
TIMER_TIC
...
...
@@ -1210,21 +1209,6 @@ void engine_prepare ( struct engine *e ) {
scheduler_reweight
(
&
e
->
sched
);
e
->
tasks_age
+=
1
;
/* Start the scheduler. */
// ticks tic2 = getticks();
scheduler_start
(
sched
,
(
1
<<
task_type_sort
)
|
(
1
<<
task_type_self
)
|
(
1
<<
task_type_pair
)
|
(
1
<<
task_type_sub
)
|
(
1
<<
task_type_ghost
)
|
(
1
<<
task_type_kick2
)
|
(
1
<<
task_type_send_xv
)
|
(
1
<<
task_type_recv_xv
)
|
(
1
<<
task_type_send_rho
)
|
(
1
<<
task_type_recv_rho
)
|
(
1
<<
task_type_link
)
);
// message( "scheduler_start took %.3f ms." , (double)(getticks() - tic2)/CPU_TPS*1000 );
TIMER_TOC
(
timer_prepare
);
}
...
...
@@ -1426,9 +1410,13 @@ void engine_collect_kick2 ( struct cell *c ) {
*
* @param e The #engine.
* @param nr_runners The number of #runners to let loose.
* @param The task mask to launch.
*/
void
engine_launch
(
struct
engine
*
e
,
int
nr_runners
)
{
void
engine_launch
(
struct
engine
*
e
,
int
nr_runners
,
unsigned
int
mask
)
{
/* Prepare the scheduler. */
atomic_inc
(
&
e
->
sched
.
waiting
);
/* Cry havoc and let loose the dogs of war. */
e
->
barrier_launch
=
nr_runners
;
...
...
@@ -1436,6 +1424,12 @@ void engine_launch ( struct engine *e , int nr_runners ) {
if
(
pthread_cond_broadcast
(
&
e
->
barrier_cond
)
!=
0
)
error
(
"Failed to broadcast barrier open condition."
);
/* Load the tasks. */
scheduler_start
(
&
e
->
sched
,
mask
);
/* Remove the safeguard. */
atomic_dec
(
&
e
->
sched
.
waiting
);
/* Sit back and wait for the runners to come home. */
while
(
e
->
barrier_launch
||
e
->
barrier_running
)
if
(
pthread_cond_wait
(
&
e
->
barrier_cond
,
&
e
->
barrier_mutex
)
!=
0
)
...
...
@@ -1496,8 +1490,7 @@ void engine_step ( struct engine *e ) {
/* First kick. */
if
(
e
->
step
==
0
||
!
(
e
->
policy
&
engine_policy_fixdt
)
)
{
TIMER_TIC
scheduler_start
(
&
e
->
sched
,
(
1
<<
task_type_kick1
)
|
(
1
<<
task_type_link
)
);
engine_launch
(
e
,
(
e
->
nr_threads
>
8
)
?
8
:
e
->
nr_threads
);
engine_launch
(
e
,
(
e
->
nr_threads
>
8
)
?
8
:
e
->
nr_threads
,
(
1
<<
task_type_kick1
)
|
(
1
<<
task_type_link
)
);
TIMER_TOC
(
timer_kick1
);
}
...
...
@@ -1522,7 +1515,17 @@ void engine_step ( struct engine *e ) {
/* Send off the runners. */
TIMER_TIC
engine_launch
(
e
,
e
->
nr_threads
);
engine_launch
(
e
,
e
->
nr_threads
,
(
1
<<
task_type_sort
)
|
(
1
<<
task_type_self
)
|
(
1
<<
task_type_pair
)
|
(
1
<<
task_type_sub
)
|
(
1
<<
task_type_ghost
)
|
(
1
<<
task_type_kick2
)
|
(
1
<<
task_type_send_xv
)
|
(
1
<<
task_type_recv_xv
)
|
(
1
<<
task_type_send_rho
)
|
(
1
<<
task_type_recv_rho
)
|
(
1
<<
task_type_link
)
);
TIMER_TOC
(
timer_runners
);
// engine_single_force( e->s->dim , 8328423931905 , e->s->parts , e->s->nr_parts , e->s->periodic );
...
...
...
...
This diff is collapsed.
Click to expand it.
src/scheduler.c
+
1
−
1
View file @
8140bea2
...
...
@@ -476,7 +476,7 @@ void scheduler_splittasks ( struct scheduler *s ) {
else
if
(
scheduler_doforcesplit
&&
ci
->
split
&&
cj
->
split
&&
(
ci
->
count
>
space_maxsize
/
cj
->
count
)
)
{
message
(
"force splitting pair with %i and %i parts."
,
ci
->
count
,
cj
->
count
);
//
message( "force splitting pair with %i and %i parts." , ci->count , cj->count );
/* Replace the current task. */
t
->
type
=
task_type_none
;
...
...
...
...
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
sign in
to comment