> [Tanguay:node:(11) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 1111111111 !
> [Morin:node:(12) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 11111111111 !
> [Ethernet:node:(13) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 11111111111 !
+> [Morin:node:(12) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
> [Tanguay:node:(11) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [McGee:node:(8) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [TeX:node:(4) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
> [iRMX:node:(7) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
> [Gatien:node:(9) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
+> [TeX:node:(4) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
> [Laroche:node:(10) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Geoff:node:(5) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
> [Disney:node:(6) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Ethernet:node:(13) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
-> [Morin:node:(12) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Boivin:node:(2) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
-> [Jacquelin:node:(1) 900.000000] [lua/INFO] 0/8 FIND_NODE have succedded
+> [Geoff:node:(5) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
+> [McGee:node:(8) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
> [Jean_Yves:node:(3) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
+> [Jacquelin:node:(1) 900.000000] [lua/INFO] 0/8 FIND_NODE have succedded
+> [Boivin:node:(2) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
+> [Ethernet:node:(13) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
+
> [PM0:master_:(1) 0.000000] [msg_test/INFO] ### Put a task on a PM
> [PM0:compute:(2) 0.010000] [msg_test/INFO] PM0:compute task executed 0.01
> [PM0:master_:(1) 2.000000] [msg_test/INFO] ### Put two tasks on a PM
-> [PM0:compute:(3) 2.020000] [msg_test/INFO] PM0:compute task executed 0.02
> [PM0:compute:(4) 2.020000] [msg_test/INFO] PM0:compute task executed 0.02
+> [PM0:compute:(3) 2.020000] [msg_test/INFO] PM0:compute task executed 0.02
> [PM0:master_:(1) 4.000000] [msg_test/INFO] ### Put a task on each PM
-> [PM1:compute:(6) 4.010000] [msg_test/INFO] PM1:compute task executed 0.01
> [PM0:compute:(5) 4.010000] [msg_test/INFO] PM0:compute task executed 0.01
+> [PM1:compute:(6) 4.010000] [msg_test/INFO] PM1:compute task executed 0.01
> [PM0:master_:(1) 6.000000] [msg_test/INFO] ## Test 1 (ended)
> [PM0:master_:(1) 6.000000] [msg_test/INFO] ## Test 2 (started): check impact of running a task inside a VM (there is no degradation for the moment)
> [PM0:master_:(1) 6.000000] [msg_test/INFO] ### Put a VM on a PM, and put a task to the VM
> [PM0:master_:(1) 10.000000] [msg_test/INFO] ### Put two VMs on a PM, and put a task to each VM
> [10.000000] [surf_vm_workstation/INFO] Create VM(VM0)@PM(PM0) with 0 mounted disks
> [10.000000] [surf_vm_workstation/INFO] Create VM(VM1)@PM(PM0) with 0 mounted disks
-> [VM1:compute:(10) 10.020000] [msg_test/INFO] VM1:compute task executed 0.02
> [VM0:compute:(9) 10.020000] [msg_test/INFO] VM0:compute task executed 0.02
+> [VM1:compute:(10) 10.020000] [msg_test/INFO] VM1:compute task executed 0.02
> [PM0:master_:(1) 12.000000] [msg_test/INFO] ### Put a VM on each PM, and put a task to each VM
> [12.000000] [surf_vm_workstation/INFO] Create VM(VM0)@PM(PM0) with 0 mounted disks
> [12.000000] [surf_vm_workstation/INFO] Create VM(VM1)@PM(PM1) with 0 mounted disks
-> [VM1:compute:(12) 12.010000] [msg_test/INFO] VM1:compute task executed 0.01
> [VM0:compute:(11) 12.010000] [msg_test/INFO] VM0:compute task executed 0.01
+> [VM1:compute:(12) 12.010000] [msg_test/INFO] VM1:compute task executed 0.01
> [PM0:master_:(1) 14.000000] [msg_test/INFO] ## Test 4 (ended)
> [PM0:master_:(1) 14.000000] [msg_test/INFO] ## Test 5 (started): Analyse network impact
> [PM0:master_:(1) 14.000000] [msg_test/INFO] ### Make a connection between PM0 and PM1
$ gtnets/gtnets ${srcdir:=.}/gtnets/crosstraffic-p.xml ${srcdir:=.}/gtnets/crosstraffic-d.xml --cfg=network/crosstraffic:1
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/crosstraffic' to '1'
-> [S1:slave:(8) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[1] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
-> [S1:slave:(8) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[2] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
-> [S1:slave:(8) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[3] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
-> [S1:slave:(8) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[4] : 3179.012519 ; message from C1 to S1 with remaining : 0.000000
+> [C1:slave:(4) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[1] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
+> [C1:slave:(4) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[2] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
+> [C1:slave:(4) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[3] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
+> [C1:slave:(4) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[4] : 3179.012519 ; message from C1 to S1 with remaining : 0.000000
\ No newline at end of file
> [ 0.000000] (11:node@Tanguay) Hi, I'm going to join the network with id 000003ff
> [ 0.000000] (12:node@Morin) Hi, I'm going to join the network with id 000007ff
> [ 0.000000] (13:node@Ethernet) Hi, I'm going to join the network with id 00000fff
-> [900.000000] ( 0:@) Messages created: 1283
+> [900.000000] ( 0:@) Messages created: 1277
> [900.000000] ( 0:@) Simulated time: 900
> [900.000000] ( 1:node@Jacquelin) 8/8 FIND_NODE have succeeded
> [900.000000] ( 2:node@Boivin) 7/7 FIND_NODE have succeeded
> [900.000000] ( 3:node@Jean_Yves) 6/6 FIND_NODE have succeeded
> [900.000000] ( 4:node@TeX) 6/6 FIND_NODE have succeeded
-> [900.000000] ( 5:node@Geoff) 7/7 FIND_NODE have succeeded
+> [900.000000] ( 5:node@Geoff) 6/6 FIND_NODE have succeeded
> [900.000000] ( 6:node@Disney) 6/6 FIND_NODE have succeeded
> [900.000000] ( 7:node@iRMX) 6/6 FIND_NODE have succeeded
> [900.000000] ( 8:node@McGee) 7/7 FIND_NODE have succeeded
> [900.000000] ( 9:node@Gatien) 6/6 FIND_NODE have succeeded
> [900.000000] (10:node@Laroche) 6/6 FIND_NODE have succeeded
-> [900.000000] (11:node@Tanguay) 7/7 FIND_NODE have succeeded
+> [900.000000] (11:node@Tanguay) 6/6 FIND_NODE have succeeded
> [900.000000] (12:node@Morin) 7/7 FIND_NODE have succeeded
> [900.000000] (13:node@Ethernet) 7/7 FIND_NODE have succeeded
#! ./tesh
-p Testing the Parallel Matrix Multiplication
+p Testing the Parallel Matrix Multiplication
! timeout 120
$ ./pmm/msg_pmm --log=msg_pmm.thres:verbose --log=no_loc ${srcdir:=.}/../platforms/cluster.xml ${srcdir:=.}/pmm/pmm_9_deploy.xml
> [c-0.me:node:(1) 0.000000] [msg_pmm/VERBOSE] Create job 7
> [c-0.me:node:(1) 0.000000] [msg_pmm/VERBOSE] Create job 8
> [c-0.me:node:(1) 0.000000] [msg_pmm/VERBOSE] Broadcast Jobs
+> [c-2.me:node:(3) 0.007813] [msg_pmm/VERBOSE] Got Job (0,2)
+> [c-2.me:node:(3) 0.007813] [msg_pmm/VERBOSE] Start Multiplication's Main-loop
+> [c-2.me:node:(3) 0.007813] [msg_pmm/VERBOSE] Broadcast sB(0,2) to col 2
+> [c-1.me:node:(2) 0.007813] [msg_pmm/VERBOSE] Got Job (0,1)
+> [c-1.me:node:(2) 0.007813] [msg_pmm/VERBOSE] Start Multiplication's Main-loop
+> [c-1.me:node:(2) 0.007813] [msg_pmm/VERBOSE] Broadcast sB(0,1) to col 1
> [c-8.me:node:(9) 0.007813] [msg_pmm/VERBOSE] Got Job (2,2)
> [c-8.me:node:(9) 0.007813] [msg_pmm/VERBOSE] Start Multiplication's Main-loop
> [c-8.me:node:(9) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
> [c-3.me:node:(4) 0.007813] [msg_pmm/VERBOSE] Got Job (1,0)
> [c-3.me:node:(4) 0.007813] [msg_pmm/VERBOSE] Start Multiplication's Main-loop
> [c-3.me:node:(4) 0.007813] [msg_pmm/VERBOSE] Broadcast sA(1,0) to row 1
-> [c-2.me:node:(3) 0.007813] [msg_pmm/VERBOSE] Got Job (0,2)
-> [c-2.me:node:(3) 0.007813] [msg_pmm/VERBOSE] Start Multiplication's Main-loop
-> [c-2.me:node:(3) 0.007813] [msg_pmm/VERBOSE] Broadcast sB(0,2) to col 2
-> [c-1.me:node:(2) 0.007813] [msg_pmm/VERBOSE] Got Job (0,1)
-> [c-1.me:node:(2) 0.007813] [msg_pmm/VERBOSE] Start Multiplication's Main-loop
-> [c-1.me:node:(2) 0.007813] [msg_pmm/VERBOSE] Broadcast sB(0,1) to col 1
-> [c-6.me:node:(7) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-3.me:node:(4) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
> [c-2.me:node:(3) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
> [c-1.me:node:(2) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-6.me:node:(7) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-3.me:node:(4) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
> [c-0.me:node:(1) 0.007813] [msg_pmm/VERBOSE] Start Multiplication's Main-loop
> [c-0.me:node:(1) 0.007813] [msg_pmm/VERBOSE] Broadcast sA(0,0) to row 0
> [c-0.me:node:(1) 0.007813] [msg_pmm/VERBOSE] Broadcast sB(0,0) to col 0
> [c-0.me:node:(1) 0.007813] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-5.me:node:(6) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-7.me:node:(8) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
> [c-4.me:node:(5) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
> [c-8.me:node:(9) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-7.me:node:(8) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-5.me:node:(6) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
> [c-6.me:node:(7) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-3.me:node:(4) 0.015619] [msg_pmm/VERBOSE] Broadcast sB(1,0) to col 0
> [c-2.me:node:(3) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-3.me:node:(4) 0.015619] [msg_pmm/VERBOSE] Broadcast sB(1,0) to col 0
> [c-1.me:node:(2) 0.015619] [msg_pmm/VERBOSE] Broadcast sA(0,1) to row 0
> [c-3.me:node:(4) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
> [c-1.me:node:(2) 0.015619] [msg_pmm/VERBOSE] Get sub-matrix
> [c-8.me:node:(9) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-6.me:node:(7) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-0.me:node:(1) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-5.me:node:(6) 0.023426] [msg_pmm/VERBOSE] Broadcast sB(1,2) to col 2
> [c-2.me:node:(3) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
> [c-7.me:node:(8) 0.023426] [msg_pmm/VERBOSE] Broadcast sA(2,1) to row 2
+> [c-5.me:node:(6) 0.023426] [msg_pmm/VERBOSE] Broadcast sB(1,2) to col 2
+> [c-6.me:node:(7) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
> [c-4.me:node:(5) 0.023426] [msg_pmm/VERBOSE] Broadcast sA(1,1) to row 1
-> [c-5.me:node:(6) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-0.me:node:(1) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
> [c-7.me:node:(8) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-5.me:node:(6) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
> [c-4.me:node:(5) 0.023426] [msg_pmm/VERBOSE] Broadcast sB(1,1) to col 1
> [c-4.me:node:(5) 0.023426] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-6.me:node:(7) 0.031233] [msg_pmm/VERBOSE] Broadcast sB(2,0) to col 0
+> [c-2.me:node:(3) 0.031233] [msg_pmm/VERBOSE] Broadcast sA(0,2) to row 0
> [c-0.me:node:(1) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-6.me:node:(7) 0.031233] [msg_pmm/VERBOSE] Broadcast sB(2,0) to col 0
> [c-8.me:node:(9) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-2.me:node:(3) 0.031233] [msg_pmm/VERBOSE] Broadcast sA(0,2) to row 0
-> [c-7.me:node:(8) 0.031233] [msg_pmm/VERBOSE] Broadcast sB(2,1) to col 1
-> [c-1.me:node:(2) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
> [c-5.me:node:(6) 0.031233] [msg_pmm/VERBOSE] Broadcast sA(1,2) to row 1
> [c-3.me:node:(4) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-6.me:node:(7) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-1.me:node:(2) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-7.me:node:(8) 0.031233] [msg_pmm/VERBOSE] Broadcast sB(2,1) to col 1
> [c-2.me:node:(3) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-7.me:node:(8) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-6.me:node:(7) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
> [c-5.me:node:(6) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-3.me:node:(4) 0.039040] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-7.me:node:(8) 0.031233] [msg_pmm/VERBOSE] Get sub-matrix
> [c-0.me:node:(1) 0.039040] [msg_pmm/VERBOSE] Get sub-matrix
-> [c-4.me:node:(5) 0.039040] [msg_pmm/VERBOSE] Get sub-matrix
> [c-1.me:node:(2) 0.039040] [msg_pmm/VERBOSE] Get sub-matrix
> [c-8.me:node:(9) 0.039040] [msg_pmm/VERBOSE] Broadcast sA(2,2) to row 2
+> [c-3.me:node:(4) 0.039040] [msg_pmm/VERBOSE] Get sub-matrix
+> [c-4.me:node:(5) 0.039040] [msg_pmm/VERBOSE] Get sub-matrix
> [c-8.me:node:(9) 0.039040] [msg_pmm/VERBOSE] Broadcast sB(2,2) to col 2
> [c-8.me:node:(9) 0.039040] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
+> [c-1.me:node:(2) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
> [c-4.me:node:(5) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
> [c-3.me:node:(4) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
-> [c-1.me:node:(2) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
> [c-0.me:node:(1) 0.046847] [msg_pmm/VERBOSE] Multiplication done.
> [c-0.me:node:(1) 0.046847] [msg_pmm/VERBOSE] Receive Results.
-> [c-5.me:node:(6) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
+> [c-6.me:node:(7) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
> [c-2.me:node:(3) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
+> [c-5.me:node:(6) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
> [c-7.me:node:(8) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
-> [c-6.me:node:(7) 0.046847] [msg_pmm/VERBOSE] Multiplication done. Send the sub-result.
> [0.054659] [msg_pmm/CRITICAL] Simulated time: 0.0546594
> [ 0.000000] (4:slave@c-3.me) Hello!
> [ 0.000000] (5:slave@c-4.me) Hello!
> [ 0.000000] (6:slave@c-5.me) Hello!
+> [ 10.000000] (6:slave@c-5.me) OK, goodbye now.
> [ 10.000000] (1:master@c-0.me) OK, goodbye now.
> [ 10.000000] (2:slave@c-1.me) OK, goodbye now.
> [ 10.000000] (3:slave@c-2.me) OK, goodbye now.
> [ 10.000000] (4:slave@c-3.me) OK, goodbye now.
> [ 10.000000] (5:slave@c-4.me) OK, goodbye now.
-> [ 10.000000] (6:slave@c-5.me) OK, goodbye now.
> [ 10.000000] (0:@) Simulation time 10
p Test1 Process with start time
> [0.000000] [rank 0] Pstates: 3; Powers: 100000000, 50000000, 20000000
> [0.000000] [rank 1] Current pstate: 0; Current power: 100000000
> [0.000000] [rank 0] Current pstate: 0; Current power: 100000000
-> [10.000000] [rank 0] Energy consumed: 2000 Joules.
> [10.000000] [rank 1] Energy consumed: 2000 Joules.
+> [10.000000] [rank 0] Energy consumed: 2000 Joules.
> [10.000000] [rank 0] Current pstate: 1; Current power: 50000000
> [30.000000] [rank 0] Energy consumed: 5400 Joules.
> [30.000000] [rank 0] Current pstate: 2; Current power: 20000000
> [ 0.] [rank 0] Power: 20000000.
> [ 0.] [rank 1] Current pstate: 0; Current power: 100000000.
> [ 0.] [rank 0] Current pstate: 0; Current power: 100000000.
-> [ 10.] [rank 0] Energy consumed (Joules): 2000.
> [ 10.] [rank 1] Energy consumed (Joules): 2000.
+> [ 10.] [rank 0] Energy consumed (Joules): 2000.
> [ 10.] [rank 0] Current pstate: 1; Current power: 50000000.
> [ 30.] [rank 0] Energy consumed (Joules): 5400.
> [ 30.] [rank 0] Current pstate: 2; Current power: 20000000.
> [ 0.0000000000000000 ] [rank 0 ] Power: 20000000.000000000
> [ 0.0000000000000000 ] [rank 1 ] Current pstate: 0 ; Current power: 100000000.00000000
> [ 0.0000000000000000 ] [rank 0 ] Current pstate: 0 ; Current power: 100000000.00000000
-> [ 10.000000000000000 ] [rank 0 ] Energy consumed (Joules): 2000.0000000000000
> [ 10.000000000000000 ] [rank 1 ] Energy consumed (Joules): 2000.0000000000000
+> [ 10.000000000000000 ] [rank 0 ] Energy consumed (Joules): 2000.0000000000000
> [ 10.000000000000000 ] [rank 0 ] Current pstate: 1 ; Current power: 50000000.000000000
> [ 30.000000000000000 ] [rank 0 ] Energy consumed (Joules): 5400.0000000000000
> [ 30.000000000000000 ] [rank 0 ] Current pstate: 2 ; Current power: 20000000.000000000
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1'
> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
> [Tremblay:0:(0) 0.004041] [smpi_replay/VERBOSE] 0 allToAll 500 500 0.004041
-> [Fafard:2:(0) 0.006920] [smpi_replay/VERBOSE] 2 allToAll 500 500 0.006920
> [Jupiter:1:(0) 0.006920] [smpi_replay/VERBOSE] 1 allToAll 500 500 0.006920
-> [Jupiter:1:(0) 0.006920] [smpi_replay/INFO] Simulation time 0.006920
+> [Fafard:2:(0) 0.006920] [smpi_replay/VERBOSE] 2 allToAll 500 500 0.006920
+> [Fafard:2:(0) 0.006920] [smpi_replay/INFO] Simulation time 0.006920
$ rm -f replay/one_trace
}
if (getUpdateMechanism() == UM_LAZY) {
- p_actionHeap = new ActionHeap();
+ p_actionHeap = xbt_heap_new(8, NULL);
+ xbt_heap_set_update_callback(p_actionHeap, surf_action_lmm_update_index_heap);
p_modifiedSet = new ActionLmmList();
p_maxminSystem->keep_track = p_modifiedSet;
}
p_maxminSystem = NULL;
if (p_actionHeap)
- delete p_actionHeap;
+ xbt_heap_free(p_actionHeap);
delete p_modifiedSet;
surf_cpu_model_pm = NULL;
lmm_update_variable_weight(getModel()->getMaxminSystem(),
action->getVariable(), 0.0);
if (getModel()->getUpdateMechanism() == UM_LAZY) { // remove action from the heap
- action->heapRemove();
+ action->heapRemove(getModel()->getActionHeap());
// this is necessary for a variable with weight 0 since such
// variables are ignored in lmm and we need to set its max_duration
// correctly at the next call to share_resources
{
m_suspended = 0;
if (model->getUpdateMechanism() == UM_LAZY) {
+ m_indexHeap = -1;
m_lastUpdate = surf_get_clock();
m_lastValue = 0.0;
}
void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
{
CpuActionPtr action;
- while ((!getActionHeap()->empty())
- && (double_equals(getActionHeap()->topKey(), now, sg_surf_precision))) {
-
- action = static_cast<CpuActionPtr>(getActionHeap()->topValue());
- getActionHeap()->pop();
+ while ((xbt_heap_size(getActionHeap()) > 0)
+ && (double_equals(xbt_heap_maxkey(getActionHeap()), now, sg_surf_precision))) {
+ action = static_cast<CpuActionPtr>(xbt_heap_pop(getActionHeap()));
XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
#ifdef HAVE_TRACING
if (TRACE_is_enabled()) {
/* set the remains to 0 due to precision problems when updating the remaining amount */
action->setRemains(0);
action->setState(SURF_ACTION_DONE);
+ action->heapRemove(getActionHeap()); //FIXME: strange call since action was already popped
}
#ifdef HAVE_TRACING
if (TRACE_is_enabled()) {
void CpuTiAction::cancel()
{
this->setState(SURF_ACTION_FAILED);
- heapRemove();
+ xbt_heap_remove(getModel()->getActionHeap(), this->m_indexHeap);
xbt_swag_insert(p_cpu, static_cast<CpuTiModelPtr>(getModel())->p_modifiedCpu);
return;
}
XBT_IN("(%p)", this);
if (m_suspended != 2) {
m_suspended = 1;
- heapRemove();
+ xbt_heap_remove(getModel()->getActionHeap(), m_indexHeap);
xbt_swag_insert(p_cpu, static_cast<CpuTiModelPtr>(getModel())->p_modifiedCpu);
}
XBT_OUT();
min_finish = getFinishTime();
/* add in action heap */
- heapRemove();
- heapInsert(min_finish, NOTSET);
+ if (m_indexHeap >= 0) {
+ CpuTiActionPtr heap_act = (CpuTiActionPtr)
+ xbt_heap_remove(getModel()->getActionHeap(), m_indexHeap);
+ if (heap_act != this)
+ DIE_IMPOSSIBLE;
+ }
+ xbt_heap_push(getModel()->getActionHeap(), this, min_finish);
+
XBT_OUT();
}
SURF_LINK_FATPIPE, NULL));
if (p_updateMechanism == UM_LAZY) {
- p_actionHeap = new ActionHeap();
+ p_actionHeap = xbt_heap_new(8, NULL);
+ xbt_heap_set_update_callback(p_actionHeap, surf_action_lmm_update_index_heap);
p_modifiedSet = new ActionLmmList();
p_maxminSystem->keep_track = p_modifiedSet;
}
void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
{
NetworkCm02ActionPtr action;
- while ((!p_actionHeap->empty())
- && (double_equals(p_actionHeap->topKey(), now, sg_surf_precision))) {
- action = (NetworkCm02ActionPtr) p_actionHeap->topValue();
- p_actionHeap->pop();
+ while ((xbt_heap_size(p_actionHeap) > 0)
+ && (double_equals(xbt_heap_maxkey(p_actionHeap), now, sg_surf_precision))) {
+ action = (NetworkCm02ActionPtr) xbt_heap_pop(p_actionHeap);
XBT_DEBUG("Something happened to action %p", action);
#ifdef HAVE_TRACING
if (TRACE_is_enabled()) {
#endif
// if I am wearing a latency hat
- if (action->getHeapActionType() == LATENCY) {
+ if (action->getHat() == LATENCY) {
XBT_DEBUG("Latency paid for action %p. Activating", action);
lmm_update_variable_weight(p_maxminSystem, action->getVariable(), action->m_weight);
- action->heapRemove();
+ action->heapRemove(p_actionHeap);
action->refreshLastUpdate();
// if I am wearing a max_duration or normal hat
- } else if (action->getHeapActionType() == MAX_DURATION ||
- action->getHeapActionType() == NORMAL) {
+ } else if (action->getHat() == MAX_DURATION ||
+ action->getHat() == NORMAL) {
// no need to communicate anymore
// assume that flows that reached max_duration have remaining of 0
XBT_DEBUG("Action %p finished", action);
action->setRemains(0);
action->finish();
action->setState(SURF_ACTION_DONE);
- action->heapRemove();
+ action->heapRemove(p_actionHeap);
action->gapRemove();
}
action->m_rate = rate;
if (p_updateMechanism == UM_LAZY) {
+ action->m_indexHeap = -1;
action->m_lastUpdate = surf_get_clock();
}
// add to the heap the event when the latency is payed
XBT_DEBUG("Added action (%p) one latency event at date %f", action,
action->m_latency + action->m_lastUpdate);
-
- action->heapInsert(action->m_latency + action->m_lastUpdate, xbt_dynar_is_empty(route) ? NORMAL : LATENCY);
+ action->heapInsert(p_actionHeap, action->m_latency + action->m_lastUpdate, xbt_dynar_is_empty(route) ? NORMAL : LATENCY);
}
} else
action->p_variable = lmm_variable_new(p_maxminSystem, action, 1.0, -1.0, constraints_per_variable);
finish();
setState(SURF_ACTION_DONE);
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
} else if (((m_maxDuration != NO_MAX_DURATION)
&& (m_maxDuration <= 0))) {
finish();
setState(SURF_ACTION_DONE);
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
}
m_lastUpdate = now;
if (p_maxminSystem)
lmm_system_free(p_maxminSystem);
if (p_actionHeap)
- delete p_actionHeap;
+ xbt_heap_free(p_actionHeap);
if (p_modifiedSet)
delete p_modifiedSet;
}
continue;
/* bogus priority, skip it */
- if (action->getPriority() <= 0 || action->getHeapActionType()==LATENCY)
+ if (action->getPriority() <= 0 || action->getHat()==LATENCY)
continue;
action->updateRemainingLazy(now);
action->getMaxDuration());
if (min != -1) {
- action->heapRemove();
- action->heapInsert(min, max_dur_flag ? MAX_DURATION : NORMAL);
+ action->heapRemove(p_actionHeap);
+ action->heapInsert(p_actionHeap, min, max_dur_flag ? MAX_DURATION : NORMAL);
XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min,
now);
} else DIE_IMPOSSIBLE;
}
//hereafter must have already the min value for this resource model
- if (!p_actionHeap->empty()) {
- min = p_actionHeap->topKey() - now;
- } else
+ if (xbt_heap_size(p_actionHeap) > 0)
+ min = xbt_heap_maxkey(p_actionHeap) - now;
+ else
min = -1;
XBT_DEBUG("The minimum with the HEAP %f", min);
lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), bound);
if (getModel()->getUpdateMechanism() == UM_LAZY && getLastUpdate()!=surf_get_clock())
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
XBT_OUT();
}
XBT_IN("(%p,%g)", this, duration);
m_maxDuration = duration;
if (getModel()->getUpdateMechanism() == UM_LAZY) // remove action from the heap
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
XBT_OUT();
}
lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), priority);
if (getModel()->getUpdateMechanism() == UM_LAZY)
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
XBT_OUT();
}
if (getModel()->getUpdateMechanism() == UM_LAZY) {
if (actionLmmHook::is_linked())
getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this));
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
}
}
int Action::unref(){
m_refcount--;
if (!m_refcount) {
- if (actionHook::is_linked())
- p_stateSet->erase(p_stateSet->iterator_to(*this));
- if (getVariable())
- lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
- if (getModel()->getUpdateMechanism() == UM_LAZY) {
- /* remove from heap */
- heapRemove();
+ if (actionHook::is_linked())
+ p_stateSet->erase(p_stateSet->iterator_to(*this));
+ if (getVariable())
+ lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
+ if (getModel()->getUpdateMechanism() == UM_LAZY) {
+ /* remove from heap */
+ heapRemove(getModel()->getActionHeap());
if (actionLmmHook::is_linked())
- getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this));
+ getModel()->getModifiedSet()->erase(getModel()->getModifiedSet()->iterator_to(*this));
}
- delete this;
- return 1;
+ delete this;
+ return 1;
}
return 0;
}
lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), 0.0);
m_suspended = 1;
if (getModel()->getUpdateMechanism() == UM_LAZY)
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
}
XBT_OUT();
}
lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), m_priority);
m_suspended = 0;
if (getModel()->getUpdateMechanism() == UM_LAZY)
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
}
XBT_OUT();
}
* LATENCY = this is a heap entry to warn us when the latency is payed
* MAX_DURATION =this is a heap entry to warn us when the max_duration limit is reached
*/
-void Action::heapInsert(double key, enum heap_action_type hat)
+void Action::heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat)
{
m_hat = hat;
- sp_heapHandle = getModel()->getActionHeap()->push(key, this);
+ xbt_heap_push(heap, this, key);
}
-void Action::heapRemove()
+void Action::heapRemove(xbt_heap_t heap)
{
m_hat = NOTSET;
- if (sp_heapHandle) {
- getModel()->getActionHeap()->erase(sp_heapHandle);
- sp_heapHandle.reset();
+ if (m_indexHeap >= 0) {
+ xbt_heap_remove(heap, m_indexHeap);
}
}
+/* added to manage the communication action's heap */
+void surf_action_lmm_update_index_heap(void *action, int i) {
+ ((ActionPtr)action)->updateIndexHeap(i);
+}
+
+void Action::updateIndexHeap(int i) {
+ m_indexHeap = i;
+}
+
double Action::getRemains()
{
XBT_IN("(%p)", this);
(lmm_get_variable_weight(getVariable()) > 0)) {
finish();
setState(SURF_ACTION_DONE);
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
} else if (((m_maxDuration != NO_MAX_DURATION)
&& (m_maxDuration <= 0))) {
finish();
setState(SURF_ACTION_DONE);
- heapRemove();
+ heapRemove(getModel()->getActionHeap());
}
}
#include <memory>
#include <boost/function.hpp>
#include <boost/intrusive/list.hpp>
-#include <boost/heap/fibonacci_heap.hpp>
-#include <boost/smart_ptr.hpp>
#include "surf/trace_mgr.h"
#include "xbt/lib.h"
#include "surf/surf_routing.h"
typedef boost::intrusive::list_base_hook<boost::intrusive::tag<lmmTag> > actionLmmHook;
-template <typename K, typename V>
-class Heap {
- class HeapItem;
- struct compare_PI : binary_function <boost::shared_ptr<HeapItem>, boost::shared_ptr<HeapItem>, bool> {
- bool operator() (boost::shared_ptr<HeapItem> x, boost::shared_ptr<HeapItem> y) const {
- return (x->p_key==y->p_key) ? x->m_i<y->m_i : x->p_key>y->p_key;}
- };
-public:
- typedef typename boost::heap::fibonacci_heap<boost::shared_ptr<HeapItem>, boost::heap::compare<compare_PI > >::handle_type HeapHandle;
- typedef boost::shared_ptr<HeapHandle> HeapHandleSPtr;
-private:
- class HeapItem {
- public:
- HeapItem(K key, V value, int i)
- : p_key(key), p_value(value), m_i(i) {
- }
- K p_key;
- V p_value;
- int m_i;
- HeapHandleSPtr sp_handle;
- };
- boost::heap::fibonacci_heap<boost::shared_ptr<HeapItem>, boost::heap::compare<compare_PI > > m_heap;
-public:
- int m_i;
- Heap() : m_i(0) {}
- HeapHandleSPtr push(K key, V value) {
- boost::shared_ptr<HeapItem> hi(new HeapItem(key, value, m_i++));
- hi->sp_handle = boost::shared_ptr<HeapHandle>(new HeapHandle(m_heap.push(hi)));
- return hi->sp_handle;
- }
- void pop() {
- HeapHandleSPtr hl = m_heap.top()->sp_handle;
- m_heap.pop();
- hl->node_ = NULL;
- }
- void erase(HeapHandleSPtr handle) {
- if (used(handle)) {
- m_heap.erase(*handle);
- handle->node_ = NULL;
- }
- }
- K topKey() {return m_heap.top()->p_key;}
- V topValue() {return m_heap.top()->p_value;}
- int size() {return m_heap.size();}
- bool empty() {return m_heap.empty();}
- bool used(HeapHandleSPtr handle) {return handle && handle->node_!=NULL;}
-};
-
-typedef Heap<double, ActionPtr> ActionHeap;
-
enum heap_action_type{
LATENCY = 100,
MAX_DURATION,
*
* @return The Action heap
*/
- ActionHeap *getActionHeap() {return p_actionHeap;}
+ xbt_heap_t getActionHeap() {return p_actionHeap;}
/**
* @brief share the resources
lmm_system_t p_maxminSystem;
e_UM_t p_updateMechanism;
int m_selectiveUpdate;
- ActionHeap *p_actionHeap;
+ xbt_heap_t p_actionHeap;
private:
const char *p_name;
/**********
* Action *
**********/
+void surf_action_lmm_update_index_heap(void *action, int i);
/** @ingroup SURF_interface
* @brief SURF action interface class
double value, double time);
ActionLmmListPtr p_modifiedSet;
+ xbt_heap_t p_actionHeap;
int m_selectiveUpdate;
bool m_failed;
double m_start; /**< start time */
/* LMM */
public:
- void heapInsert(double key, enum heap_action_type hat);
- void heapRemove();
- enum heap_action_type getHeapActionType() {return m_hat;}
virtual void updateRemainingLazy(double now);
+ void heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat);
+ void heapRemove(xbt_heap_t heap);
+ void updateIndexHeap(int i);
lmm_variable_t getVariable() {return p_variable;}
double getLastUpdate() {return m_lastUpdate;}
void refreshLastUpdate() {m_lastUpdate = surf_get_clock();}
+ enum heap_action_type getHat() {return m_hat;}
bool is_linked() {return actionLmmHook::is_linked();}
void gapRemove();
double m_lastValue;
double m_lastUpdate;
int m_suspended;
- ActionHeap::HeapHandleSPtr sp_heapHandle;
+ int m_indexHeap;
enum heap_action_type m_hat;
};
> [Tremblay:slave from master:(4) 5.000000] [msg_test/INFO] Slave started
> [Tremblay:master:(1) 5.000000] [msg_test/INFO] Join the slave (timeout 2)
> [Tremblay:master:(1) 7.000000] [msg_test/INFO] Goodbye now!
-> [Tremblay:master:(1) 8.000000] [msg_test/INFO] Goodbye now!
> [Tremblay:slave from master:(4) 8.000000] [msg_test/INFO] I'm done. See you!
+> [Tremblay:master:(1) 8.000000] [msg_test/INFO] Goodbye now!
> [8.000000] [msg_test/INFO] Simulation time 8