+++ /dev/null
-set(tesh_files
- ${tesh_files}
- ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent/bittorrent.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/chord/chord.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/console/master_slave_bypass.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/kademlia/kademlia.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/masterslave/master_slave.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/multi_matrix/mult_matrix.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/state_cloner/duplicated_globals.tesh
- PARENT_SCOPE
- )
-set(xml_files
- ${xml_files}
- ${CMAKE_CURRENT_SOURCE_DIR}/deploy.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent/bittorrent.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/kademlia/kademlia.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/multi_matrix/quicksort_deployment.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/state_cloner/deployment_duplicated_globals.xml
- PARENT_SCOPE
- )
-set(examples_src
- ${examples_src}
- ${CMAKE_CURRENT_SOURCE_DIR}/SimSplay/chord.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/SimSplay/platform_script.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/SimSplay/sim_splay.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/SimSplay/splay_school.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent/bittorrent.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent/peer.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/bittorrent/tracker.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/chord/chord.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/console/deploy.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/console/master.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/console/master_slave_bypass.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/console/platform.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/console/slave.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/kademlia/kademlia.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/kademlia/routing_table.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/kademlia/tools.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/masterslave/master.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/masterslave/master_slave.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/masterslave/slave.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/multi_matrix/mult_matrix.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/multi_matrix/receiver.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/multi_matrix/sender.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/splaySim/master.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/splaySim/slave.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/splaySim/splay_ctrl.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/splaySim/splay_deploy_masterslave.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/splaySim/splay_platform.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/state_cloner/duplicated_globals.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/tracing/master.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/tracing/master_slave_trace.lua
- ${CMAKE_CURRENT_SOURCE_DIR}/tracing/slave.lua
- PARENT_SCOPE
- )
-set(bin_files
- ${bin_files}
- PARENT_SCOPE
- )
-set(txt_files
- ${txt_files}
- ${CMAKE_CURRENT_SOURCE_DIR}/README
- ${CMAKE_CURRENT_SOURCE_DIR}/SimSplay/TODO
- ${CMAKE_CURRENT_SOURCE_DIR}/tracing/file.trace
- ${CMAKE_CURRENT_SOURCE_DIR}/tracing/simgrid.trace
- PARENT_SCOPE
- )
+++ /dev/null
-
-Examples contained in this directory
-
-To execute any SimGrid Lua example, SimGrid must have been compiled with lua
-support enabled (-Denable_lua) and the SimGrid dynamic library must be in
-your LUA_CPATH. For example:
-
-export LUA_CPATH="${LUA_CPATH};/path/to/simgrid/examples/lua/?.so"
-
-===============================================================================
-* masterslave
-===============================================================================
-
- - Description:
- Simple master slave application
-
- - Directory:
- examples/lua/masterslave
-
- - Platform Files:
- ../../platforms/small_platform.xml
-
- - Deployment Files:
- ../deploy.xml
-
- - Execute:
- lua master_slave.lua ../../platforms/small_platform.xml ../deploy.xml
-
-===============================================================================
-* multi_matrix
-===============================================================================
-
- - Description:
- Simple example to demonstrate how 2 processes can exchange data via a task.
- In this example:
- * Process Sender: sends two matrices with a fixed size to the receiver.
- * Process Receiver: receive the matrices and makes the multiplication.
-
- - Directory:
- examples/lua/multi_matrix
-
- - Platform Files:
- quicksort_platform.xml
-
- - Deployment Files:
- quicksort_deployment.xml
-
- - Execute:
- lua mult_matrix.lua
-
-================================================================================
-================================================================================
-
-
+++ /dev/null
---------------------------------------------
-A few notes abouts what I would like to do
-to make Splay applications work with SimGrid
---------------------------------------------
-
-Create an executable "simsplay" that runs a Splay Lua script
-with SimGrid.
-
-Ideally, its usage would be:
-
-simsplay platform_file.{xml|lua} deployment_file.{xml|lua} splay_script.lua [simgrid_options...]
-
-I'm not sure about the format of the platform and deployment files yet.
-We could accept both XML and Lua files, since there is a great Lua API to
-describe platforms, or only the XML ones.
-
-The simsplay executable (which is compiled C) would initialize SimGrid, create
-the environment, and for each simulated process, create a new lua_State*
-object that runs the Lua script provided by the user (splay_script.lua in the
-example above).
-
-The current Lua API of SimGrid (3.6) uses Lua coroutines (i.e. sequential,
-lightweight threads) to simulate processes in a single, shared Lua state.
-However, in Splay, the Lua global values must not be shared between simulated
-processes: this is why we need distinct Lua states.
-
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-dofile "sim_splay.lua"
-between, call, thread, ping = misc.between_c, rpc.call, events.thread, rpc.ping
-n, predecessor, finger, timeout, m = {}, nil, {}, 5, 24
-function join(n0) -- n0: some node in the ring
- simgrid.info("Euh...")
- predecessor = nil
- finger[1] = call(n0, {'find_successor', n.id})
- simgrid.info("8Here..")
- call(finger[1], {'notify', n})
-end
-
-function closest_preceding_node(id)
- for i = m, 1, -1 do
- if finger[i] and between(finger[i].id, n.id, id) then
- return finger[i]
- end
- end
- return n
-end
-
-function find_successor(id)
- if finger[1].id == n.id or between(id, n.id, (finger[1].id + 1) % 2^m) then
- return finger[1]
- else
- local n0 = closest_preceding_node(id)
- return call(n0, {'find_successor', id})
- end
-end
-function stabilize()
- local x = call(finger[1], 'predecessor')
- if x and between(x.id, n.id, finger[1].id) then
- finger[1] = x -- new successor
- call(finger[1], {'notify', n})
- end
-end
-function notify(n0)
- if n0.id ~= n.id and
- (not predecessor or between(n0.id, predecessor.id, n.id)) then
- predecessor = n0
- end
-end
-function fix_fingers()
- refresh = (refresh and (refresh % m) + 1) or 1 -- 1 <= next <= m
- finger[refresh] = find_successor((n.id + 2^(refresh - 1)) % 2^m)
-end
-function check_predecessor()
- if predecessor and not rpc.ping(predecessor) then
- predecessor = nil
- end
-end
-
-n.id = math.random(1, 2^m)
-finger[1] = n
-if job then
- n.ip, n.port = job.me.ip, job.me.port
- join({ip = "192.42.43.42", port = 20000})
-else
- simgrid.info("bizzaaaaaar...")
- n.ip, n.port = "127.0.0.1", 20000
- if arg[1] then n.ip = arg[1] end
- if arg[2] then n.port = tonumber(arg[2]) end
- if not arg[3] then
- print("RDV")
- else
- print("JOIN")
- thread(function() join({ip = arg[3], port = tonumber(arg[4])}) end)
- end
-end
-rpc.server(n.port)
-events.periodic(stabilize, timeout)
-events.periodic(check_predecessor, timeout)
-events.periodic(fix_fingers, timeout)
-events.loop()
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-require "simgrid"
-
- simgrid.AS.new{id="AS0",mode="Full"};
-
- simgrid.AS.addHost{AS="AS0",id="Tremblay",speed=98095000};
- simgrid.AS.addHost{AS="AS0",id="Jupiter",speed=76296000};
- simgrid.AS.addHost{AS="AS0",id="Fafard",speed=76296000};
-
- simgrid.host.setProperty{host="Tremblay",prop_id="ip",prop_value="199.23.98.3"};
- simgrid.host.setProperty{host="Tremblay",prop_id="port",prop_value="65"};
- simgrid.host.setProperty{host="Jupiter",prop_id="ip",prop_value="199.23.98.4"};
- simgrid.host.setProperty{host="Jupiter",prop_id="port",prop_value="83"};
- simgrid.host.setProperty{host="Fafard",prop_id="ip",prop_value="199.23.98.5"};
- simgrid.host.setProperty{host="Fafard",prop_id="port",prop_value="76"};
- -- create Links
- for i=10,0,-1 do
- simgrid.AS.addLink{AS="AS0",id=i,bandwidth=252750+ i*768,lat=0.000270544+i*0.087};
- end
- -- simgrid.route.new(src_id,des_id,links_nb,links_list)
- simgrid.AS.addRoute("AS0","Tremblay","Jupiter",{"1"});
- simgrid.AS.addRoute("AS0","Tremblay","Fafard",{"0","1","2","3","4","8"});
-
- simgrid.AS.addRoute("AS0","Jupiter","Tremblay",{"1"});
- simgrid.AS.addRoute("AS0","Jupiter","Fafard",{"0","1","2","3","4","8","9"});
-
- simgrid.AS.addRoute("AS0","Fafard","Tremblay",{"0","1","2","3","4","8"});
- simgrid.AS.addRoute("AS0","Fafard","Jupiter",{"0","1","2","3","4","8","9"});
-
-
- --Save Platform
- simgrid.msg_register_platform();
-
- --Set Application
- simgrid.host.set_function{host="Tremblay",fct="SPLAYschool",args=""};
- simgrid.host.set_function{host="Fafard",fct="SPLAYschool",args=""};
- simgrid.host.set_function{host="Jupiter",fct="SPLAYschool",args=""};
-
- --Save Application
- simgrid.msg_register_application();
-
-
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-require "simgrid"
-
--- Splay global modules
-rpc = {}
-log = {}
-job = {}
-events = {}
-os = {}
-start = {}
-misc = {}
-
--- Splay global variables
-job.me = {}
-job.nodes = {}
-job.list_type = "random"
-
--- Init nodes tables
-function init_nodes()
- for i = 1, simgrid.host.number() do
- job.nodes[i] = { ip = simgrid.host.get_prop_value(simgrid.host.at(i), "ip"),
- port = simgrid.host.get_prop_value(simgrid.host.at(i), "port") }
- end
-end
-
-function init_jobs()
- init_nodes()
-end
-
--- Job methods
-function job.me.ip()
- return simgrid.host.get_prop_value(simgrid.host.self(), "ip")
-end
-
-function job.me.port()
- return simgrid.host.get_prop_value(simgrid.host.self(), "port")
-end
-
-
-function job.position()
- return simgrid.host.get_prop_value(simgrid.host.self(), "position")
-end
-
--- log Methods
-function log:print(msg)
- simgrid.info(msg);
-end
-
--- rpc Methods
-function rpc.call(node, call)
- --init_nodes();
- func = "empty"
- arg = "empty"
- mailbox = node
-
- if type(node) == "table" then
- mailbox = node.ip..":"..node.port
- end
-
- if type(call) == "table" then
- func = call[1]
- arg = call[2]
- end
- task_call = simgrid.task.new("splay_task", 10000, 10000)
- task_call['func_call_name'] = func
- task_call['func_call_arg'] = arg
- log:print("Sending Task to mailbox "..mailbox.." to call '"..func.."' with arg '"..arg.."'")
- simgrid.task.send(task_call, mailbox)
-
-end
-
-function rpc.server(port)
- -- nothing really to do : no need to open Socket since it's a Simulation
-end
-
--- event Methods
-function events.sleep(time)
- my_mailbox = job.me.ip()..":"..job.me.port()
- task = simgrid.task.recv(my_mailbox, time)
-
- if task ~= nil then
- -- an RPC call just woke me up
- call_function(task['func_call_name'], task['func_call_arg'])
- end
-end
-
--- main function for each process, this is equivalent to the deployment file
-function events.thread(main_func)
- dofile("platform_script.lua")
- init_jobs()
-end
-
--- OS methods
-function os.exit()
- simgrid.host.destroy(simgrid.host.self())
-end
-
--- Start Methods
-function start.loop()
- simgrid.run()
- --simgrid.clean()
-end
-
--- Misc Methods
-function misc.between(a, b)
- return a
-end
-
--- useful functions
-function call_function(fct, arg)
- _G[fct](arg)
-end
-
-function SPLAYschool(arg)
- simgrid.info("Calling me..."..arg)
-end
-
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-require("sim_splay")
-
-function SPLAYschool()
- log:print("My ip is: "..job.me.ip())
- for i = 1,200 do
- log:print(i)
- end
---[[
- events.sleep(5)
-
- if job.me.ip() == job.nodes[1].ip then
- rpc.call(job.nodes[2], {"call_me", job.me.ip()})
- end
- events.sleep(5)
- os.exit()
- --]]
-end
-
-function call_me(from)
- log:print("I received an RPC from "..from)
-end
-
-events.thread("SPLAYschool")
-start.loop()
-log:print("Simulation finished")
-
+++ /dev/null
--- Copyright (c) 2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- A SimGrid Lua implementation of the Bittorrent protocol.
-
-require("simgrid")
-
-require("peer")
-require("tracker")
-
--- Initialization of the random generator
-table.sort(math)
-math.randomseed(42)
-simgrid.platform(arg[1] or "../../platforms/platform.xml")
-simgrid.application(arg[2] or "bittorrent.xml")
-simgrid.run()
+++ /dev/null
-$ lua bittorrent.lua
-> [Jacquelin:tracker:(1) 0.000000] [lua/INFO] Tracker launched
-> [Boivin:peer:(2) 0.000000] [lua/INFO] Hi, I'm joining the network with id 2
-> [Jean_Yves:peer:(3) 0.000000] [lua/INFO] Hi, I'm joining the network with id 3
-> [TeX:peer:(4) 0.000000] [lua/INFO] Hi, I'm joining the network with id 4
-> [Geoff:peer:(5) 0.000000] [lua/INFO] Hi, I'm joining the network with id 5
-> [Disney:peer:(6) 0.000000] [lua/INFO] Hi, I'm joining the network with id 6
-> [iRMX:peer:(7) 0.000000] [lua/INFO] Hi, I'm joining the network with id 7
-> [McGee:peer:(8) 0.000000] [lua/INFO] Hi, I'm joining the network with id 8
-> [Boivin:peer:(2) 3.048882] [lua/INFO] Received an answer from the tracker with 0 peers inside
-> [Jean_Yves:peer:(3) 3.925092] [lua/INFO] Received an answer from the tracker with 1 peers inside
-> [Jean_Yves:peer:(3) 3.925092] [lua/INFO] Start downloading.
-> [Geoff:peer:(5) 6.005341] [lua/INFO] Received an answer from the tracker with 3 peers inside
-> [TeX:peer:(4) 6.812588] [lua/INFO] Received an answer from the tracker with 2 peers inside
-> [TeX:peer:(4) 6.812588] [lua/INFO] Start downloading.
-> [Jean_Yves:peer:(3) 6.925093] [lua/INFO] Starting main leech loop
-> [TeX:peer:(4) 8.619837] [lua/INFO] Starting main leech loop
-> [Disney:peer:(6) 9.823538] [lua/INFO] Received an answer from the tracker with 4 peers inside
-> [Disney:peer:(6) 9.823538] [lua/INFO] Start downloading.
-> [Disney:peer:(6) 10.644341] [lua/INFO] Starting main leech loop
-> [McGee:peer:(8) 13.888352] [lua/INFO] Received an answer from the tracker with 6 peers inside
-> [McGee:peer:(8) 13.888352] [lua/INFO] Start downloading.
-> [iRMX:peer:(7) 15.043659] [lua/INFO] Received an answer from the tracker with 5 peers inside
-> [iRMX:peer:(7) 15.043659] [lua/INFO] Start downloading.
-> [McGee:peer:(8) 16.609414] [lua/INFO] Starting main leech loop
-> [iRMX:peer:(7) 17.228855] [lua/INFO] Starting main leech loop
-> [Jacquelin:tracker:(1) 3000.000000] [lua/INFO] Tracker is leaving
-> [Geoff:peer:(5) 5000.005341] [lua/INFO] My status is now 1111111111
-> [Boivin:peer:(2) 5000.048882] [lua/INFO] My status is now 1111111111
-> [iRMX:peer:(7) 5000.228855] [lua/INFO] My status is now 1111111111
-> [McGee:peer:(8) 5000.609414] [lua/INFO] My status is now 1111111111
-> [TeX:peer:(4) 5000.619837] [lua/INFO] My status is now 1111111111
-> [Disney:peer:(6) 5000.644339] [lua/INFO] My status is now 1111111111
-> [Jean_Yves:peer:(3) 5000.925088] [lua/INFO] My status is now 1111111111
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
- <process host="Jacquelin" function="tracker">
- <argument value="3000" />
- </process>
-
- <process host="Boivin" function="peer">
- <argument value="00000002"/> <!-- my id -->
- <argument value="5000" /> <!-- end time -->
- <argument value="1" /> <!-- indicates if the peer is a seed at the begining of the simulation -->
- </process>
- <process host="Jean_Yves" function="peer">
- <argument value="00000003"/> <!-- my id -->
- <argument value="5000" /> <!-- end time -->
- </process>
- <process host="TeX" function="peer">
- <argument value="00000004"/> <!-- my id -->
- <argument value="5000" /> <!-- end time -->
- </process>
- <process host="Geoff" function="peer">
- <argument value="00000005"/> <!-- my id -->
- <argument value="5000" /> <!-- end time -->
- <argument value="1" /> <!-- indicates if the peer is a seed at the begining of the simulation -->
- </process>
- <process host="Disney" function="peer">
- <argument value="00000006"/> <!-- my id -->
- <argument value="5000" /> <!-- end time -->
- </process>
- <process host="iRMX" function="peer">
- <argument value="00000007"/> <!-- my id -->
- <argument value="5000" /> <!-- end time -->
- </process>
- <process host="McGee" function="peer">
- <argument value="00000008"/> <!-- my id -->
- <argument value="5000" /> <!-- end time -->
- </process>
-
-</platform>
+++ /dev/null
--- Copyright (c) 2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- A SimGrid Lua implementation of the Bittorrent protocol.
-
-require("simgrid")
--- Common Constants
-common = {
- FILE_SIZE = 5120,
- FILE_PIECE_SIZE = 512,
- FILE_PIECES = 10,
-
- PIECE_COMM_SIZE = 1,
-
- MESSAGE_SIZE = 1,
- MAXIMUM_PEERS = 50,
-
- TRACKER_QUERY_INTERVAL = 1000,
- TRACKER_COMM_SIZE = 0.01,
-
- GET_PEERS_TIMEOUT = 10000,
- TIMEOUT_MESSAGE = 10,
- MAX_UNCHOKED_PEERS = 4,
- UPDATE_CHOKED_INTERVAL = 50,
- MAX_PIECES = 1,
-}
-
-
--- Peer main function
-function peer(...)
-
- local args = {...}
-
- if #args ~= 2 and #args ~= 3 then
- simgrid.info("Wrong number of arguments")
- end
-
- -- Setting the peer data
- data = {
- -- Retrieving the peer id
- id = tonumber(args[1]),
- mailbox = tostring(tonumber(args[1])),
- mailbox_tracker = "tracker" .. args[1],
- peers = {},
- active_peers = {},
- current_pieces = {},
- pieces_requested = 0,
- bitfield = {},
- pieces_count = {},
- pieces = 0,
- deadline = tonumber(args[2]),
- round = 0
- }
- simgrid.info("Hi, I'm joining the network with id " .. data.id)
-
- -- Checking if the peer is a seed
- local bitfield_value = false
- if args[3] == "1" then
- data.pieces = common.PIECES_COUNT
- bitfield_value = true
- else
- data.pieces = 0
- end
- -- Building the peer bitfield and the pieces list
- for i = 1, common.FILE_PIECES do
- data.pieces_count[i] = 0
- data.bitfield[i] = bitfield_value
- end
-
- if get_peers_data() == true then
- data.comm_received = simgrid.task.irecv(data.mailbox)
- if has_finished() then
- send_handshake_all()
- seed_loop()
- else
- leech_loop()
- seed_loop()
- end
- else
- simgrid.info("Couldn't contact the tracker")
- end
- simgrid.info("My status is now " .. get_status())
-end
--- Peer main loop when it is leeching
-function leech_loop()
- simgrid.info("Start downloading.")
- local now = simgrid.get_clock()
- local next_choked_update = now + common.UPDATE_CHOKED_INTERVAL;
- -- Send a "handshake" message to all the peers it got
- -- it couldn't have gotten more than 50 peers anyway)
- send_handshake_all()
- -- Wait for at leaast one bitfield message
- wait_for_pieces()
-
- simgrid.info("Starting main leech loop")
- local task, err
- while now < data.deadline and data.pieces < common.FILE_PIECES do
- task, err = data.comm_received:test()
- if task then
- handle_message(task)
- data.comm_received = simgrid.task.irecv(data.mailbox)
- now = simgrid.get_clock()
- elseif err then
- data.comm_received = simgrid.task.irecv(data.mailbox)
- else
- -- If the user has a pending interesting
- if data.current_piece ~= -1 then
- send_interested_to_peers()
- else
- if #data.current_pieces < common.MAX_PIECES then
- update_current_piece()
- end
- end
- -- We don't execute the choke algorithm if we don't already have a piece
- if now >= next_choked_update and data.pieces > 0 then
- update_choked_peers()
- next_choked_update = next_choked_update + common.UPDATE_CHOKED_INTERVAL
- now = simgrid.get_clock()
- else
- simgrid.process.sleep(1)
- now = simgrid.get_clock()
- end
- end
- end
-end
--- Peer main loop when it is seeding
-function seed_loop()
- local now = simgrid.get_clock()
- local next_choked_update = now + common.UPDATE_CHOKED_INTERVAL;
- simgrid.debug("Start seeding.")
- -- Start the main seed loop
- while now < data.deadline do
- task, err = data.comm_received:test()
- if task then
- handle_message(task)
- data.comm_received = simgrid.task.irecv(data.mailbox)
- now = simgrid.get_clock()
- elseif err then
- data.comm_received = simgrid.task.irecv(data.mailbox)
- else
- if now >= next_choked_update then
- update_choked_peers()
- next_choked_update = next_choked_update + common.UPDATE_CHOKED_INTERVAL
- now = simgrid.get_clock()
- else
- simgrid.process.sleep(1)
- now = simgrid.get_clock()
- end
- end
- end
-end
--- Retrieve the peers list from the tracker
-function get_peers_data()
- local success = false
- local now = simgrid.get_clock()
- local timeout = now + common.GET_PEERS_TIMEOUT
- -- Build the task
- local task_send = simgrid.task.new("", 0, common.MESSAGE_SIZE)
- task_send.type = "REQUEST"
- task_send.peer_id = data.id
- task_send.mailbox = data.mailbox_tracker
- -- Send the task
- while not(success) and now < timeout do
- simgrid.debug("Sending a peer request to the tracker.")
- if task_send:send("tracker") then
- success = true
- end
- end
- now = simgrid.get_clock()
- success = false
- -- Wait for the answer
- local comm_received = simgrid.task.irecv(data.mailbox_tracker)
- while not(success) and now < timeout do
- local task_received = comm_received:wait(timeout)
- comm_received = simgrid.task.irecv(data.mailbox_tracker)
- if task_received then
- simgrid.info("Received an answer from the tracker with " .. #task_received.peers .. " peers inside")
- -- Add what we received to our peer list
- for i,v in pairs(task_received.peers) do
- if v ~= data.id then
- --Add the peer to our list and build its data
- local peer_data = {}
- peer_data.id = v;
- peer_data.bitfield = nil
- peer_data.mailbox = tostring(v);
- peer_data.am_interested = false
- peer_data.interested = false
- peer_data.choked_upload = true
- peer_data.choked_download = true
- data.peers[v] = peer_data
- end
- end
- else
- success = false
- end
- success = true
- end
- return success;
-end
--- Returns if the peer has finished downloading the piece
-function has_finished()
- for i,v in pairs(data.bitfield) do
- if v == false then
- return false
- end
- end
- return true
-end
--- Handle a received message sent by another peer
-function handle_message(task)
- local remote_peer = data.peers[task.peer_id]
-
- if task.type == "HANDSHAKE" then
- simgrid.debug("Received a HANDSHAKE message from " .. task.mailbox)
- -- Check if the peer is in our connection list
- if data.peers[task.peer_id] == nil then
- local peer_data = {}
- peer_data.mailbox = task.mailbox
- peer_data.id = task.peer_id
- peer_data.am_interested = false
- peer_data.interested = false
- peer_data.choked_upload = true
- peer_data.choked_download = true
- peer_data.bitfield = nil
- data.peers[task.peer_id] = peer_data
- send_handshake(task.mailbox)
- end
- -- Send our bitfield to the peer
- send_bitfield(task.mailbox)
- elseif task.type == "BITFIELD" then
- simgrid.debug("Received a BITFIELD from " .. task.mailbox)
- -- Update the pieces list
- update_piece_count_from_bitfield(task.bitfield)
- -- Update the current piece
- if data.current_piece == -1 and data.pieces < common.FILE_PIECES then
- update_current_piece()
- end
- data.peers[task.peer_id].bitfield = task.bitfield
- elseif task.type == "INTERESTED" then
- simgrid.debug("Received an INTERESTED message from " .. task.mailbox)
- data.peers[task.peer_id].interested = true
- elseif task.type == "NOTINTERESTED" then
- simgrid.debug("Received an NOTINTERESTED message from " .. task.mailbox)
- data.peers[task.peer_id].interested = false
- elseif task.type == "UNCHOKE" then
- simgrid.debug("Received an UNCHOKE message from " .. task.mailbox)
- data.peers[task.peer_id].choked_download = false
- send_requests_to_peer(data.peers[task.peer_id])
- elseif task.type == "CHOKE" then
- simgrid.debug("Recevied a CHOKE message from " .. task.mailbox)
- data.peers[task.peer_id].choked_download = true
- elseif task.type == "HAVE" then
- local remote_peer = data.peers[task.peer_id]
- if remote_peer == nil or remote_peer.bitfield == nil then
- return
- end
- simgrid.debug("Received a HAVE message from " .. task.mailbox)
- data.pieces_count[task.piece] = data.pieces_count[task.piece] + 1
- -- Send interested message to the peer if he has what we want
- if not(remote_peer.am_interested) and data.current_pieces[task.piece] ~= nil then
- remote_peer.am_interested = true
- send_interested(remote_peer.mailbox)
- end
- if data.current_pieces[task.piece] ~= nil then
- send_request(task.mailbox,task.piece)
- end
- elseif task.type == "REQUEST" then
- simgrid.debug("Received REQUEST from " .. task.mailbox .. " for " .. task.piece)
- local remote_peer = data.peers[task.peer_id]
- if remote_peer.choked_upload == false then
- if data.bitfield[task.piece] == true then
- send_piece(task.mailbox,task.piece,false)
- end
- end
- elseif task.type == "PIECE" then
- if task.stalled == true then
- simgrid.debug("The received piece is stalled")
- else
- simgrid.debug("Received piece " .. task.piece .. " from " .. task.mailbox)
- if data.bitfield[task.piece] ~= true then
- data.pieces_requested = data.pieces_requested - 1
- -- Removing the piece from our piece list
- data.current_pieces[task.piece] = nil
- data.bitfield[task.piece] = true
- data.pieces = data.pieces + 1
- simgrid.debug("My status is now:" .. get_status())
- -- Sending the information to all the peers we are connected to
- send_have(task.piece)
- -- Sending UNINTERESTED to the peers that doesn't have any more pieces
- update_interested_after_receive()
- end
- end
- end
-end
--- Update the piece the peer is currently interested in.
--- There is two cases (as described in "Bittorrent Architecture Protocol", Ryan Toole :
--- If the peer has less than 3 pieces, he chooses a piece at random.
--- If the peer has more than pieces, he downloads the pieces that are the less
--- replicated
-function update_current_piece()
- if data.pieces_requested >= (common.FILE_PIECES - data.pieces) then
- return
- end
- if data.pieces < 3 or true then
- repeat
- data.current_piece = math.random(1,common.FILE_PIECES)
--- simgrid.info("The new piece is:" .. data.current_piece)
- until data.bitfield[data.current_piece] ~= true and data.current_pieces[data.current_piece] == nil
- data.current_pieces[data.current_piece] = true
- data.pieces_requested = data.pieces_requested + 1
- end
-
-end
--- Updates the list of who has a piece from a bitfield
-function update_piece_count_from_bitfield(bitfield)
- for i,v in pairs(bitfield) do
- if v == true then
- data.pieces_count[i] = data.pieces_count[i] + 1
- end
- end
-end
--- Wait for the node to receive interesting bitfield messages (ie: non empty)
-function wait_for_pieces()
- local finished = false
- local now = simgrid.get_clock()
- local task
- while now < data.deadline and not(finished) do
- task = data.comm_received:wait(common.TIMEOUT_MESSAGE)
- if task then
- handle_message(task)
- if data.current_piece ~= -1 then
- finished = true
- end
- end
- data.comm_received = simgrid.task.irecv(data.mailbox)
- end
-end
--- Update the list of current choked and unchoked peers, using the
--- choke algorithm
-function update_choked_peers()
- data.round = (data.round + 1) % 3
- -- Remove a peer from the list
- for i,v in pairs(data.active_peers) do
- data.active_peers[i] = nil
- send_choked(v.mailbox)
- break
- end
- -- Random optimistic unchoking
- if true then
- local values = {}
- for key, value in pairs(data.peers) do
- values[#values + 1] = value
- end
- local peer_choosed = nil
- local j = 0
-
- repeat
- peer_choosed = values[math.random(#values)]
- if peer_choosed.interested ~= true then
- peer_choosed = nil
- end
- j = j + 1
- until peer_choosed ~= nil or j < common.MAXIMUM_PEERS
- if peer_choosed ~= nil then
- data.active_peers[peer_choosed.id] = peer_choosed
- peer_choosed.choked_upload = false
- send_unchoked(peer_choosed.mailbox)
- end
- end
- -- TODO: Use the leecher choke algorithm
-end
--- Updates our "interested" state about peers: send "not interested" to peers
--- that don't have any more pieces we want.
-function update_interested_after_receive()
- local interested = false
- for i,v in pairs(data.peers) do
- if v.am_interested then
- for piece,j in pairs(data.current_pieces) do
- if v.bitfield ~= nil then
- if v.bitfield[piece] == true then
- interested = true
- break
- else
- end
- end
- end
- if not(interested) then
- v.am_interested = false
- send_not_interested(v.mailbox)
- end
- end
- end
-end
--- Find the peers that have the current interested piece and send them
--- the "interested" message
-function send_interested_to_peers()
- if data.current_piece == -1 then
- return
- end
- for i,v in pairs(data.peers) do
- if v.bitfield ~= nil then
- v.am_interested = true
- send_interested(v.mailbox)
- end
- end
- data.current_piece = -1
-end
--- Send a "interested" message to a peer.
-function send_interested(mailbox)
- simgrid.debug("Sending a INTERESTED to " .. mailbox)
- local task = new_task("INTERESTED")
- task:dsend(mailbox)
-end
--- Send a "not interested" message to a peer.
-function send_not_interested(mailbox)
- simgrid.debug("Sending a send_not_interested")
- local task = new_task("NOTINTERESTED")
- task:dsend(mailbox)
-end
--- Send a handshake message to all the peers the peer has
-function send_handshake_all()
- for i,v in pairs(data.peers) do
- local task = new_task("HANDSHAKE")
- task:dsend(v.mailbox)
- end
-end
--- Send a "handshake" message to an user
-function send_handshake(mailbox)
- simgrid.debug("Sending a HANDSHAKE to " .. mailbox)
- local task = new_task("HANDSHAKE")
- task:dsend(mailbox)
-end
--- Send a "choked" message to a peer
-function send_choked(mailbox)
- simgrid.debug("Sending a CHOKE to " .. mailbox)
- local task = new_task("CHOKE")
- task:dsend(mailbox)
-end
--- Send a "unchoked" message to a peer
-function send_unchoked(mailbox)
- simgrid.debug("Sending a UNCHOKE to " .. mailbox)
- local task = new_task("UNCHOKE")
- task:dsend(mailbox)
-end
--- Send a "HAVE" message to all peers we are connected to
-function send_have(piece)
- simgrid.debug("Sending a HAVE message")
- for i,v in pairs(data.peers) do
- local task = new_task("HAVE")
- task.piece = piece
- task:dsend(v.mailbox)
- end
-end
--- Send request messages to a peer that have unchoked us
-function send_requests_to_peer(remote_peer)
- simgrid.debug("Sending a request to peer " .. remote_peer.mailbox)
- for i,v in pairs(data.current_pieces) do
- send_request(remote_peer.mailbox,i)
- end
-end
--- Send a bitfield message to a peer
-function send_bitfield(mailbox)
- simgrid.debug("Sending a BITFIELD to " .. mailbox)
- local task = new_task("BITFIELD")
- task.bitfield = data.bitfield
- task:dsend(mailbox)
-end
--- Send a "request" message to a pair, containing a request for a piece
-function send_request(mailbox, piece)
- simgrid.debug("Sending a REQUEST to " .. mailbox .. " for " .. piece)
- local task = new_task("REQUEST")
- task.piece = piece
- task:dsend(mailbox)
-end
--- Send a "piece" messageto a pair, containing a piece of the file
-function send_piece(mailbox, piece, stalled)
- simgrid.debug("Sending the PIECE " .. piece .. " to " .. mailbox)
- local task = new_task("PIECE")
- task.piece = piece
- task.stalled = stalled
- task:dsend(mailbox)
-end
-function new_task(type)
- local task = simgrid.task.new(type, 0, common.MESSAGE_SIZE)
- task.type = type
- task.mailbox = data.mailbox
- task.peer_id = data.id
- return task
-end
-function get_status()
- local s = ""
- for i,v in pairs(data.bitfield) do
- if v == true then
- s = s .. '1'
- else
- s = s .. '0'
- end
- end
- return s
-end
+++ /dev/null
--- Copyright (c) 2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- A SimGrid Lua implementation of the Bittorrent protocol.
-
-require("simgrid")
-
-common_tracker = {
- MAXIMUM_PEERS = 50
-}
-
-
-
-function tracker(...)
- tracker_data = {
- peers_list = {},
- deadline = 0,
- comm_received = nil
- }
- -- Check the arguments
- local args = {...}
- if #args ~= 1 then
- simgrid.info("Wrong number of arguments for the tracker")
- end
- -- Retrieve the end time
- tracker_data.deadline = tonumber(args[1])
-
- simgrid.info("Tracker launched")
-
- local now = simgrid.get_clock()
-
- tracker_data.comm_received = simgrid.task.irecv("tracker")
- while now < tracker_data.deadline do
- task, err = tracker_data.comm_received:test()
- if task then
- simgrid.debug("Received a request from " .. task.mailbox)
- tracker_data.comm_received = simgrid.task.irecv("tracker")
- -- Sending peers to the peer
- local peers = {}
- local i = 0
- if #tracker_data.peers_list > 0 then
- i = math.random(1,#tracker_data.peers_list)
- end
- while #peers < #tracker_data.peers_list and #peers < common_tracker.MAXIMUM_PEERS do
- table.insert(peers,tracker_data.peers_list[i])
- i = (i % #tracker_data.peers_list) +1
- end
- task.type = "ANSWER"
- task.peers = peers
- -- Add the peer to our peer list
- table.insert(tracker_data.peers_list,task.peer_id)
- -- Setting the interval
- task.interval = TRACKER_QUERY_INTERVAL
- -- Sending the task back to the peer
- task:dsend(task.mailbox)
- else
- simgrid.process.sleep(1)
- now = simgrid.get_clock()
- end
- end
-
- simgrid.info("Tracker is leaving")
-end
+++ /dev/null
--- A SimGrid Lua implementation of the Chord DHT
-
--- Copyright (c) 2011-2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-require("simgrid")
-
-nb_bits = 24
-nb_keys = 2^nb_bits
-comp_size = 0
-comm_size = 10
-timeout = 50
-max_simulation_time = 1000
-stabilize_delay = 20
-fix_fingers_delay = 120
-check_predecessor_delay = 120
-lookup_delay = 10
-
--- current node (don't worry, globals are duplicated in each simulated process)
-my_node = {
- -- FIXME: my_id does not exist.
- id = my_id,
- next_finger_to_fix = 1,
- fingers = {},
- predecessor = nil,
- comm_recv = nil
-}
-
--- Main function of each Chord process
--- Arguments:
--- - my id
--- - the id of a guy I know in the system (except for the first node)
-function node(...)
-
- simgrid.debug("Hi! This is my first message; I just entered the program!")
- -- TODO simplify the deployment file
- local known_id
- local args = {...}
- my_node.id = math.tointeger(args[1])
- simgrid.debug("My id is now " .. my_node.id)
- if #args == 4 then
- known_id = math.tointeger(args[2])
- simgrid.info("Updated my known_id to " .. known_id)
- end
-
- -- initialize the node and the fingertable;
- -- at the beginning, this node only knows itself (we need to discover others)
- for i = 1, nb_bits, 1 do
- my_node.fingers[i] = my_node.id
- end
-
- -- Let's make sure we can receive messages!
- my_node.comm_recv = simgrid.task.irecv(my_node.id)
-
- -- join the ring
- local join_success = false
- --simgrid.info(known_id)
-
- if known_id == nil then
- -- only the first node ("Jacqueline") will enter here
- -- as configured in file ../../msg/chord/chord.xml
- simgrid.debug("I'm the node that is in charge. Going to create everything.")
- create()
- join_success = true
- else
- -- Communicate to the first node and join the ring
- -- This will also initialize
- -- my_node.predecessor and my_node.successor
- join_success = join(known_id)
- end
-
- -- At this point, finger[1] does not necessarily actually point
- -- to the *real* successor; it might be that the first node still
- -- didn't notify us that another node joined with
- -- an ID that satisfies my_id <= ID <= current_successorId
-
- -- TODO Remove this, but make sure my_node.predecessor is initialized somewhere
- --if my_node.id == 1 then
- --my_node.predecessor = 1
- --end
-
- -- main loop
- if join_success then
-
- local now = simgrid.get_clock()
- local next_stabilize_date = now + stabilize_delay
- local next_fix_fingers_date = now + fix_fingers_delay
- local next_check_predecessor_date = now + check_predecessor_delay
- local next_lookup_date = now + lookup_delay
-
- local task, err
-
- simgrid.debug("I'm now entering the main loop.")
-
- while now < max_simulation_time do
-
- task, err = my_node.comm_recv:test()
- simgrid.info(now .. " " .. next_stabilize_date .. " " .. now + stabilize_delay .. " " .. next_fix_fingers_date .. " " .. next_check_predecessor_date .. " " .. next_lookup_date)
-
- if task then
- -- I received a task: answer it
- simgrid.info("I received a task of type '" .. task.type .."'! My id is " .. my_node.id)
- my_node.comm_recv = simgrid.task.irecv(my_node.id)
- handle_task(task)
- elseif err then
- -- the communication has failed: nevermind, we'll try again
- simgrid.info("Error while receiving a task! My id is " .. my_node.id)
- my_node.comm_recv = simgrid.task.irecv(my_node.id)
- else
- -- no task was received: do periodic calls
-
- if now >= next_stabilize_date then
- simgrid.debug("Stabilizing...")
- stabilize()
- simgrid.debug("Finished stabilizing!")
- next_stabilize_date = simgrid.get_clock() + stabilize_delay
-
- --elseif now >= next_fix_fingers_date then
- --fix_fingers()
- --next_fix_fingers_date = simgrid.get_clock() + fix_fingers_delay
-
- --elseif now >= next_check_predecessor_date then
- --check_predecessor()
- --next_check_predecessor_date = simgrid.get_clock() + check_predecessor_delay
-
- --elseif now >= next_lookup_date then
- --random_lookup()
- --simgrid.debug("I'm now executing a lookup, as lookup_delay makes me do this. " .. simgrid.get_clock())
- --next_lookup_date = simgrid.get_clock() + lookup_delay
-
- else
- ---- nothing to do: sleep for a while
- simgrid.debug("Didn't have to stabilize, update my fingers, check my predecessors or do a random lookup; hence, I'm starting to sleep now...")
- simgrid.process.sleep(5)
- simgrid.debug("Slept for 5s")
- end
- end
- now = simgrid.get_clock()
- end -- while
-
- -- leave the ring
- leave()
- end
-end
-
--- Makes the current node leave the ring
-function leave()
-
- simgrid.info("Leaving the ring, because max_simulation_time was reached.")
- -- TODO: notify others
-end
-
--- This function is called when the current node receives a task
--- and can not immediately deal with it; for instance, if the host
--- waits on a response for a 'find successor' query but receives a
--- 'get predecessor' message instead; we cannot just discard this
--- message so we deal with it here.
---
--- - task: the task received
-function handle_task(task)
-
- simgrid.debug("Handling task in handle_task()")
- local type = task.type
-
- if type == "find successor" then
-
- task.answer_to = math.tointeger(task.answer_to)
- task.request_id = math.tointeger(task.request_id)
-
- simgrid.info("Received a 'find successor' request from " .. string.format("%d", task.answer_to) ..
- " for id " .. string.format("%d", task.request_id))
-
- -- Is my successor have the right host? This can happen if there are holes
- -- in the ring; for instance, if my id is 13 and my successor is 17 and
- -- 14,15,16 don't exist but I'm asked for 15, then yes, 17 is the right
- -- answer to the request.
- --
- -- Test: my_node.id + 1 <= task.request_id <= my_node.fingers[1]
- -- ^^^
- -- TODO: Why the +1? We could receive this message from a host that forwarded
- -- this message (and the original sender doesn't know us),
- -- so why do we exclude ourselves?
- if is_in_interval(task.request_id, my_node.id + 1, my_node.fingers[1]) then
-
- simgrid.info("Sending back a 'find successor answer' to " ..
- string.format("%d", task.answer_to) .. ": the successor of " .. string.format("%d", task.request_id) ..
- " is " .. string.format("%d", my_node.fingers[1]))
-
- task.type = "find successor answer"
- -- TODO: Can we remove the "" here?
- task.answer = math.tointeger(my_node.fingers[1])
- simgrid.info("Answer" .. task.answer)
- task:dsend(math.tointeger(task.answer_to))
- else
- -- forward the request to the closest preceding finger in my table
-
- simgrid.info("Forwarding the 'find successor' request to my closest preceding finger")
- task:dsend(closest_preceding_node(task.request_id))
- end
-
- elseif type == "get predecessor" then
- simgrid.info("Received a 'find predecessor' request from " .. string.format("%d", task.answer_to) ..
- " for id. Sending back an answer.")
-
- task.type = "get predecessor answer"
-
- --for i,v in pairs(my_node) do
- --print(my_node.id, i, v)
- --end
- --print(my_node.predecessor)
- if my_node.predecessor ~= nil then
- task.answer = math.tointeger(my_node.predecessor)
- --print(my_node.predecessor)
- else
- -- FIXME: This is completely wrong here. Fix this;
- -- we need to figure out what to send if we don't know our
- -- predecessor yet (this DOES happen and this means that task.answer
- -- is initialised with nil and when task.answer is accessed (not here), it will
- -- break in Lua 5.3 (because it is nil).
- simgrid.critical("Don't know my predecessor yet!")
- my_node.predecessor = remote_get_predecessor(my_node.fingers[1])
- task.answer = my_node.predecessor
- end
-
- --print("It will break now, since task.answer is nil here.")
- --task.answer = my_node.predecessor
- --print(task.answer)
- --print("Before")
- task:dsend(math.tointeger(task.answer_to))
- --print("After dsend returned")
-
- elseif type == "notify" then
- -- someone is telling me that he may be my new predecessor
- simgrid.info("Host id " .. task.request_id .. " wants to be my predecessor")
- notify(math.tointeger(task.request_id))
-
- elseif type == "predecessor leaving" then
- -- TODO
- simgrid.debug("predecessor leaving")
-
- elseif type == "successor_leaving" then
- -- TODO: We could / should use something like table.remove(my_node.fingers, 1) here
- simgrid.debug(type)
-
- elseif type == "find successor answer" then
- -- ignoring, this is handled in remote_find_successor
- simgrid.debug(type)
-
- elseif type == "get predecessor answer" then
- -- ignoring, this is already handled in
-
- else
- error("Unknown type of task received: " .. task.type)
- end
-
- simgrid.info("I'm leaving handle_task() now.")
-end
-
--- Returns whether an id belongs to the interval [a, b[.
--- The parameters are normalized to make sure they are between 0 and nb_keys - 1.
--- 1 belongs to [62, 3].
--- 1 does not belong to [3, 62].
--- 63 belongs to [62, 3].
--- 63 does not belong to [3, 62].
--- 24 belongs to [21, 29].
--- 24 does not belong to [29, 21].
-function is_in_interval(id, a, b)
- -- normalize the parameters
- -- TODO: Currently, nb_bits = 24; so a,b,id < 24! Really?
- id = id % nb_bits
- a = a % nb_bits
- b = b % nb_bits
-
- -- make sure a <= b and a <= id
- if b < a then
- b = b + nb_keys
- end
-
- if id < a then
- id = id + nb_keys
- end
-
- return id <= b
-end
-
--- Returns whether the current node is in the ring.
-function has_joined()
-
- return my_node.fingers[my_node.id] ~= nil
-end
-
--- Creates a new Chord ring.
-function create()
- simgrid.debug("I've now initialized my predecessor and fingertable.")
- --my_node.predecessor = my_node.id
- my_node.predecessor = nil
- my_node.fingers[1] = my_node.id
-end
-
--- Attemps to join the Chord ring.
--- - known_id: id of a node already in the ring
--- - return value: true if the join was successful
-function join(known_id)
-
- simgrid.info("Joining the ring with id " .. my_node.id .. ", knowing node " .. known_id)
-
- local successor = remote_find_successor(known_id, my_node.id)
- simgrid.info("Returned from remote_find_successor; my successor is " .. successor)
- if successor == nil then
- simgrid.critical("Cannot join the ring.")
- return false
- end
-
- -- We don't know the predecessor yet, so we initialize it with NULL
- my_node.predecessor = nil
- my_node.fingers[1] = successor
-
- -- Everything was successfull!
- return true
-end
-
--- Returns the closest preceding finger of an id with respect to the finger
--- table of the current node.
--- - id: the id to find
--- - return value: the closest preceding finger of that id
-function closest_preceding_node(id)
-
- for i = nb_bits, 1, -1 do
- if is_in_interval(my_node.fingers[i], my_node.id + 1, id - 1) then
- -- finger i is the first one before id
- simgrid.info("fix_fingers: The closest preceding node for " .. id .. " is finger " .. i .. " (node " .. my_node.fingers[i] .. ")")
- return my_node.fingers[i]
- end
- end
-end
-
--- Finds the successor of an id
--- id: the id to find
--- return value: the id of the successor, or nil if the request failed
-function find_successor(id)
-
- if is_in_interval(id, my_node.id + 1, my_node.fingers[1]) then
- -- my successor is the successor
- simgrid.info("Looking for successor of " .. id .. ", but I determined it's my own successor: " .. my_node.fingers[1])
- return my_node.fingers[1]
- else
- -- ask to the closest preceding finger in my table
- simgrid.info("fix_fingers: Looking for successor of " .. id .. ", checking closest preceding node")
- local ask_to = closest_preceding_node(id)
- simgrid.info("fix_fingers: Looking for successor of " .. id .. ", checking closest preceding node")
- return remote_find_successor(ask_to, id)
- end
-
-end
-
--- Asks a remote node the successor of an id.
--- ask_to: id of a remote node to ask to
--- id: the id to find
--- return value: the id of the successor, or nil if the request failed
-function remote_find_successor(ask_to, id)
-
- local task = simgrid.task.new("", comp_size, comm_size)
- task.type = "find successor"
- task.request_id = id -- This is the id we want to find
- task.answer_to = my_node.id -- This is where the answer needs to go
- -- (back to us)
-
- simgrid.info("Sending a 'find successor' request to " .. ask_to .. " for id " .. id .. " (timeout=".. timeout .. ")")
- if task:send(ask_to, timeout) then
- -- request successfully sent: wait for an answer
-
- while true do
- simgrid.info("New iteration in while loop of remote_find_successor(); I'm still waiting for a response!")
- --print(task.request_id)
- simgrid.info("Starting to wait for a message; timeout=" .. timeout)
- task = my_node.comm_recv:wait(timeout)
- simgrid.info("Finished to wait")
- -- TODO Do we need this?
- --for i,v in pairs(task) do
- --print(i, v)
- --end
- --simgrid.info("I will crash!")
- --task.answer = math.tointeger(task.answer)
- --simgrid.info("Ich denke task.type ist leer")
- --simgrid.info("Before irecv: " .. my_node.id)
-
- -- Even if the recv above failed (timeout occurred) -- we want to be
- -- able to receive a message if it comes in, even without us explicitly
- -- calling the recv() method.
- my_node.comm_recv = simgrid.task.irecv(my_node.id)
-
- if not task then
- -- failed to receive the answer
- return nil
- else
- -- a task was received: is it the expected answer (i.e., the response to
- -- our query and for the id we're interested in)
- if task.type ~= "find successor answer" or task.request_id ~= id then
- -- this is not our answer, but we still need to handle it.
- simgrid.info("Wrong request of type " .. task.type .. " received, expected 'find successor answer'")
- handle_task(task)
-
- else
- -- this is our answer
- simgrid.info("Received the answer to my 'find successor' request for id " ..
- id .. ": the successor is " .. task.answer)
-
- -- TODO: Do we need math.tointeger here?
- return math.tointeger(task.answer)
- end
- end
- end
- else
- simgrid.info("Failed to send the 'find successor' request to " .. ask_to ..
- " for id " .. id)
- end
-
- -- This can never be reached, because if this host finds the successor, it
- -- will return it right away!
- simgrid.info("Whooops! I should never reach this statement, because I didn't find a successor!")
-
- -- We need to return the successor here
-end
-
--- Asks a remote node its predecessor.
--- ask_to: id of a remote node to ask to
--- return value: the id of its predecessor, or nil if the request failed
-function remote_get_predecessor(ask_to)
-
- local task = simgrid.task.new("", comp_size, comm_size)
- task.type = "get predecessor"
- task.answer_to = math.tointeger(my_node.id)
- -- TODO c.heinrich: Remove this
- --task.note = "Bla " .. ask_to .. " at time " .. simgrid.get_clock()
-
- simgrid.info("Sending request for '" .. task.type .."' to id '" .. ask_to .. "'")
- if task:send(ask_to, timeout) then
- simgrid.info("Done sending the request to " .. ask_to)
- -- request successfully sent: wait for an answer
- -- We need to iterate here because we might receive other
- -- messages too (but not the answer to the request we just sent);
- -- hence, we loop here.
- while true do
- simgrid.info("Starting to wait. My id: " .. my_node.id)
- task = my_node.comm_recv:wait(timeout)
- simgrid.info("Finished to wait. My id: " .. my_node.id .. " ask_to is " .. ask_to)
- my_node.comm_recv = simgrid.task.irecv(my_node.id)
-
- if not task then
- -- failed to receive the answer
- simgrid.info("Task not received - is null?")
- return nil
- else
- -- a task was received: is it the expected answer?
- if task.type ~= "get predecessor answer" then
- -- this is not our answer
- simgrid.info("Task is NOT 'get predecessor answer'")
- handle_task(task)
- else
- -- this is our answer
- -- FIXME make sure the message answers to this particular request
- --simgrid.info(task.answer)
- for i,v in pairs(task) do
- print(my_node.id, i, v)
- end
- simgrid.info("Task is answer for predecessor! The answer is: ")
- if (task.answer) then print("NIL!\n") else print("Not NIL\n") end
- return task.answer
- end
- end
- end
- end
-
- return successor
-end
-
--- Checks the immediate successor of the current node.
-function stabilize()
- local candidate
- local successor = my_node.fingers[1]
- if successor ~= my_node.id then
- simgrid.info("Getting remote predecessor from ".. successor)
- candidate = remote_get_predecessor(successor)
- simgrid.info("Received ".. candidate .. " as candidate")
- else
- candidate = my_node.predecessor
- end
-
- simgrid.info("Still stabilizing")
- -- candidate might become my new successor
- if candidate ~= nil and is_in_interval(candidate, my_node.id + 1, successor - 1) then
- simgrid.info("I'm updating my successor to " .. math.tointeger(candidate))
- my_node.fingers[1] = math.tointeger(candidate)
-
- -- If candidate is not my_node.id, then I should notify candidate that I'm here.
- -- (So this node updates it's predecessor to me)
- --remote_notify(candidate, my_node.id)
- end
-
- simgrid.info("Successor: " .. successor .. " and my id: " .. my_node.id)
- -- If candidate is nil, this means that our successor has no predecessor.
- -- So we should tell him about us...
- -- TODO: I think a host that receives a message could automatically add
- -- this other node as a predecessor if it doesn't have any... needs to
- -- be implemented somewhere else, not here.
- if candidate == nil and successor ~= my_node.id then
- remote_notify(successor, my_node.id)
- end
-end
-
--- Notifies the current node that its predecessor may have changed
--- - candidate_predecessor: the possible new predecessor
-function notify(candidate_predecessor)
- if my_node.predecessor == nil or is_in_interval(candidate_predecessor,
- my_node.predecessor + 1, my_node.id - 1) then
- simgrid.info("Updated my predecessor to " .. candidate_predecessor)
- my_node.predecessor = math.tointeger(candidate_predecessor)
- end
-end
-
--- Notifies a remote node that its predecessor my have changed.
--- - notify_to
--- - candidate the possible new predecessor
-function remote_notify(notify_to, candidate_predecessor)
-
- simgrid.info("Updating someone else's predecessor (id: " .. notify_to .. " predecessor to ".. candidate_predecessor .. ")")
- local task = simgrid.task.new("", comp_size, comm_size)
- task.type = "notify"
- task.request_id = candidate_predecessor
- task:dsend(notify_to)
-end
-
--- Refreshes the finger table of the current node,
--- one finger per call.
-function fix_fingers()
-
- local i = math.tointeger(my_node.next_finger_to_fix)
- local id = find_successor(math.tointeger(my_node.id + 2^i))
- simgrid.info("Called fix_fingers(). Next finger to fix: " .. i .. " and I will check " .. my_node.id + 2^i .. ". Request returned " .. id)
-
- if id ~= nil then
- if id ~= my_node.fingers[i] then
- my_node.fingers[i] = id
- simgrid.info("fix_fingers: Updated finger " .. i .. " to " .. id)
- else
- simgrid.info("fix_fingers: id is " .. id)
- end
- my_node.next_finger_to_fix = (i % nb_bits) + 1
- end
-end
-
--- Checks whether the predecessor of the current node has failed.
-function check_predecessor()
- -- TODO
-end
-
--- Performs a find successor request to an arbitrary id.
-function random_lookup()
-
- find_successor(1337)
-end
-
-simgrid.platform(arg[1] or "../../msg/msg_platform.xml")
-simgrid.application(arg[2] or "../../msg/chord/chord90.xml")
-simgrid.run()
+++ /dev/null
-$ lua chord.lua ../../platforms/platform.xml ../../msg/chord/chord.xml
-> [Gatien:node:(1) 0.000000] [lua/INFO] Joining the ring with id 48, knowing node 1
-> [Gatien:node:(1) 0.000000] [lua/INFO] Sending a 'find successor' request to 1 for id 48
-> [McGee:node:(2) 0.000000] [lua/INFO] Joining the ring with id 42, knowing node 1
-> [McGee:node:(2) 0.000000] [lua/INFO] Sending a 'find successor' request to 1 for id 42
-> [iRMX:node:(3) 0.000000] [lua/INFO] Joining the ring with id 38, knowing node 1
-> [iRMX:node:(3) 0.000000] [lua/INFO] Sending a 'find successor' request to 1 for id 38
-> [Geoff:node:(4) 0.000000] [lua/INFO] Joining the ring with id 32, knowing node 1
-> [Geoff:node:(4) 0.000000] [lua/INFO] Sending a 'find successor' request to 1 for id 32
-> [TeX:node:(5) 0.000000] [lua/INFO] Joining the ring with id 21, knowing node 1
-> [TeX:node:(5) 0.000000] [lua/INFO] Sending a 'find successor' request to 1 for id 21
-> [Jean_Yves:node:(6) 0.000000] [lua/INFO] Joining the ring with id 14, knowing node 1
-> [Jean_Yves:node:(6) 0.000000] [lua/INFO] Sending a 'find successor' request to 1 for id 14
-> [Boivin:node:(7) 0.000000] [lua/INFO] Joining the ring with id 8, knowing node 1
-> [Boivin:node:(7) 0.000000] [lua/INFO] Sending a 'find successor' request to 1 for id 8
-> [Gatien:node:(1) 1.274448] [lua/INFO] Sent the 'find successor' request to 1 for id 48, waiting for the answer
-> [Jacquelin:node:(8) 5.000000] [lua/INFO] Received a 'find successor' request from 48 for id 48
-> [Jacquelin:node:(8) 5.000000] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 48 is 1
-> [McGee:node:(2) 5.888356] [lua/INFO] Sent the 'find successor' request to 1 for id 42, waiting for the answer
-> [Gatien:node:(1) 6.274448] [lua/INFO] Received the answer to my 'find successor' request for id 48: the successor is 1
-> [Jacquelin:node:(8) 10.000000] [lua/INFO] Received a 'find successor' request from 42 for id 42
-> [Jacquelin:node:(8) 10.000000] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 42 is 1
-> [McGee:node:(2) 10.888356] [lua/INFO] Received the answer to my 'find successor' request for id 42: the successor is 1
-> [iRMX:node:(3) 13.043675] [lua/INFO] Sent the 'find successor' request to 1 for id 38, waiting for the answer
-> [Jacquelin:node:(8) 15.000000] [lua/INFO] Received a 'find successor' request from 38 for id 38
-> [Jacquelin:node:(8) 15.000000] [lua/INFO] Sending back a 'find successor answer' to 38: the successor of 38 is 1
-> [Geoff:node:(4) 15.005344] [lua/INFO] Sent the 'find successor' request to 1 for id 32, waiting for the answer
-> [Gatien:node:(1) 16.274448] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [iRMX:node:(3) 18.043675] [lua/INFO] Received the answer to my 'find successor' request for id 38: the successor is 1
-> [Jacquelin:node:(8) 20.000000] [lua/INFO] Received a 'find successor' request from 32 for id 32
-> [Jacquelin:node:(8) 20.000000] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 32 is 1
-> [Geoff:node:(4) 20.005344] [lua/INFO] Received the answer to my 'find successor' request for id 32: the successor is 1
-> [McGee:node:(2) 20.888356] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [TeX:node:(5) 21.812602] [lua/INFO] Sent the 'find successor' request to 1 for id 21, waiting for the answer
-> [Jacquelin:node:(8) 25.000000] [lua/INFO] Received a 'find successor' request from 21 for id 21
-> [Jacquelin:node:(8) 25.000000] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 21 is 1
-> [Jean_Yves:node:(6) 25.925131] [lua/INFO] Sent the 'find successor' request to 1 for id 14, waiting for the answer
-> [TeX:node:(5) 26.812602] [lua/INFO] Received the answer to my 'find successor' request for id 21: the successor is 1
-> [Jacquelin:node:(8) 30.000000] [lua/INFO] Received a 'find successor' request from 14 for id 14
-> [Jacquelin:node:(8) 30.000000] [lua/INFO] Sending back a 'find successor answer' to 14: the successor of 14 is 1
-> [Jean_Yves:node:(6) 30.925131] [lua/INFO] Received the answer to my 'find successor' request for id 14: the successor is 1
-> [Boivin:node:(7) 31.048886] [lua/INFO] Sent the 'find successor' request to 1 for id 8, waiting for the answer
-> [Jacquelin:node:(8) 35.000000] [lua/INFO] Received a 'find successor' request from 8 for id 8
-> [Jacquelin:node:(8) 35.000000] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 8 is 1
-> [Boivin:node:(7) 36.048886] [lua/INFO] Received the answer to my 'find successor' request for id 8: the successor is 1
-> [Gatien:node:(1) 36.274448] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 36.812602] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Jacquelin:node:(8) 40.000000] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Jacquelin:node:(8) 40.000000] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 1
-> [McGee:node:(2) 40.888356] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Gatien:node:(1) 41.274448] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 1
-> [Jacquelin:node:(8) 45.000000] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 45.000000] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 1
-> [McGee:node:(2) 45.888356] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 1
-> [TeX:node:(5) 46.812602] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 50.000000] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 50.000000] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 1
-> [TeX:node:(5) 51.812602] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 1
-> [Gatien:node:(1) 66.274448] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 70.888356] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [TeX:node:(5) 81.812602] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Gatien:node:(1) 101.274448] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 105.000000] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Jacquelin:node:(8) 105.000000] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 48
-> [Gatien:node:(1) 106.274448] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [McGee:node:(2) 110.888356] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 115.000000] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 115.000000] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 115.888356] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [TeX:node:(5) 126.674223] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 126.674223] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 126.674223] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [TeX:node:(5) 128.486825] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [McGee:node:(2) 132.748286] [lua/INFO] Sending a 'find successor' request to 21 for id 1337
-> [McGee:node:(2) 133.702424] [lua/INFO] Sent the 'find successor' request to 21 for id 1337, waiting for the answer
-> [TeX:node:(5) 136.721551] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [TeX:node:(5) 136.721551] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 138.534153] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 143.937377] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 145.703402] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 148.272563] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 152.642987] [lua/INFO] Received another request of type notify
-> [Jacquelin:node:(8) 154.970016] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 154.970016] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 155.858372] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [TeX:node:(5) 161.782618] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 161.782618] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 161.782618] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [TeX:node:(5) 161.782618] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 162.910671] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 164.250895] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 165.205033] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 166.586415] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 166.657541] [lua/INFO] Sending a 'find successor' request to 21 for id 1337
-> [TeX:node:(5) 167.017635] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Geoff:node:(4) 169.624750] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 170.457775] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 170.457775] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 173.496110] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 174.796126] [lua/INFO] Sent the 'find successor' request to 21 for id 1337, waiting for the answer
-> [TeX:node:(5) 174.796126] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [TeX:node:(5) 174.796126] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 174.796126] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 176.981338] [lua/INFO] Received another request of type get predecessor
-> [Jacquelin:node:(8) 180.525343] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 180.525343] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 181.351762] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 181.608743] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 182.240118] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Geoff:node:(4) 183.496110] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Geoff:node:(4) 186.534446] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [TeX:node:(5) 187.337945] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 187.337945] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 187.337945] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [TeX:node:(5) 187.337945] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 189.166550] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 189.166550] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [TeX:node:(5) 190.055334] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 191.395557] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 192.204885] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 192.349696] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 193.303834] [lua/INFO] Sending a 'find successor' request to 21 for id 1337
-> [TeX:node:(5) 194.162298] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Geoff:node:(4) 202.204885] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 205.600566] [lua/INFO] Sent the 'find successor' request to 21 for id 1337, waiting for the answer
-> [TeX:node:(5) 205.600566] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [TeX:node:(5) 205.600566] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 205.600566] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 207.413182] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Jacquelin:node:(8) 207.670006] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 207.670006] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [Geoff:node:(4) 208.281556] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 208.281556] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 208.281556] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [McGee:node:(2) 208.558362] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Geoff:node:(4) 211.319892] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Boivin:node:(7) 213.663165] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 214.482607] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 214.482607] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 214.482607] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [TeX:node:(5) 214.512500] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 216.022292] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [TeX:node:(5) 216.325102] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Gatien:node:(1) 216.542538] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 218.995152] [lua/INFO] Sending a 'find successor' request to 21 for id 1337
-> [iRMX:node:(3) 220.466768] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 220.466768] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Geoff:node:(4) 221.319892] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 222.279240] [lua/INFO] Sent the 'find successor' request to 21 for id 1337, waiting for the answer
-> [McGee:node:(2) 222.279240] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 222.825895] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 223.038065] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Gatien:node:(1) 223.038065] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 224.072395] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 225.466768] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 225.466768] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [TeX:node:(5) 226.325102] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [TeX:node:(5) 226.325102] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 226.325102] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Gatien:node:(1) 228.038065] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 228.505104] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 230.466768] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 230.466768] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Jacquelin:node:(8) 232.417504] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 232.417504] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 232.651980] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 232.825895] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Geoff:node:(4) 233.505104] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 233.540336] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [TeX:node:(5) 234.230106] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Boivin:node:(7) 237.196320] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 237.417504] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 237.417504] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [TeX:node:(5) 239.230106] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [iRMX:node:(3) 239.837192] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 239.837192] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Boivin:node:(7) 242.196320] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 247.875528] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 248.809448] [lua/INFO] Sending a 'find successor' request to 21 for id 1337
-> [Gatien:node:(1) 252.528683] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [TeX:node:(5) 252.855310] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Gatien:node:(1) 253.797791] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [McGee:node:(2) 253.809448] [lua/INFO] Sent the 'find successor' request to 21 for id 1337, waiting for the answer
-> [TeX:node:(5) 254.667911] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 254.667911] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 254.667911] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [TeX:node:(5) 254.667911] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 257.022404] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 257.196320] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Jacquelin:node:(8) 258.682938] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 258.682938] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [TeX:node:(5) 260.495554] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Geoff:node:(4) 260.913863] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 260.913863] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 260.913863] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 260.913863] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 260.913863] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 260.913863] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Jacquelin:node:(8) 263.682938] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 263.682938] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [Geoff:node:(4) 263.952198] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 264.571294] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [McGee:node:(2) 264.571294] [lua/INFO] Sending a 'find successor' request to 21 for id 46
-> [McGee:node:(2) 265.525432] [lua/INFO] Sent the 'find successor' request to 21 for id 46, waiting for the answer
-> [McGee:node:(2) 267.126645] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 267.308156] [lua/INFO] Received a 'find successor' request from 42 for id 46
-> [TeX:node:(5) 267.308156] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 46 is 1
-> [McGee:node:(2) 269.311857] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 269.957386] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 270.265996] [lua/INFO] Received the answer to my 'find successor' request for id 46: the successor is 1
-> [Gatien:node:(1) 272.506283] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 273.029499] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [TeX:node:(5) 275.495539] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [iRMX:node:(3) 275.670372] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 275.670372] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [McGee:node:(2) 276.449678] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Boivin:node:(7) 278.029499] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 278.044436] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 278.044436] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 280.670372] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 280.670372] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [Jacquelin:node:(8) 281.231834] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 281.231834] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [McGee:node:(2) 282.120190] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 283.044436] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Gatien:node:(1) 283.241669] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Jacquelin:node:(8) 286.231834] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 286.231834] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 287.855584] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 288.708707] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 288.743940] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Boivin:node:(7) 290.388626] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 295.779885] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [TeX:node:(5) 296.669640] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Geoff:node:(4) 298.253047] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Geoff:node:(4) 298.253047] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 299.522155] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 299.522155] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 299.522155] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 299.522155] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 299.522155] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 300.214711] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 300.214711] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 303.253047] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 303.866936] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 303.866936] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 304.821074] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [TeX:node:(5) 305.775212] [lua/INFO] Received another request of type notify
-> [Jacquelin:node:(8) 307.054334] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 307.054334] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [Boivin:node:(7) 307.573838] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [McGee:node:(2) 307.942690] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 308.866936] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [iRMX:node:(3) 310.214711] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 310.214711] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Jacquelin:node:(8) 312.054334] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 312.054334] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 312.399923] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 312.573838] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 313.253047] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 313.253047] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 313.288279] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Gatien:node:(1) 315.824343] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Boivin:node:(7) 322.797386] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 323.288279] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 325.491587] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 326.415832] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 326.874588] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 329.053146] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Jacquelin:node:(8) 329.603231] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 329.603231] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [Gatien:node:(1) 329.745702] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [McGee:node:(2) 330.491587] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Gatien:node:(1) 331.014811] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Boivin:node:(7) 332.797386] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 335.438259] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 335.438259] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [TeX:node:(5) 336.415832] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 336.415832] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 337.797386] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 339.531748] [lua/INFO] Received another request of type notify
-> [Jacquelin:node:(8) 339.603231] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 339.603231] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [Gatien:node:(1) 340.877679] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 341.415832] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Geoff:node:(4) 341.514929] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 341.514929] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 341.514929] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 341.514929] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 341.514929] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 341.514929] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 343.426576] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 343.577609] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 344.465965] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Geoff:node:(4) 344.553265] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 345.885354] [lua/INFO] Received another request of type notify
-> [Jacquelin:node:(8) 347.152127] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 347.152127] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 347.678508] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 348.566864] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [iRMX:node:(3) 348.700141] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 348.700141] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [Gatien:node:(1) 351.271438] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 353.964729] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Boivin:node:(7) 356.059269] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 358.566864] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [TeX:node:(5) 358.964729] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 362.152127] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 362.152127] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [Geoff:node:(4) 362.315029] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 363.007585] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [McGee:node:(2) 363.040483] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 363.426576] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 363.426576] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [TeX:node:(5) 363.964729] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Gatien:node:(1) 364.276693] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Gatien:node:(1) 364.276693] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 364.314932] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Boivin:node:(7) 366.059269] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 366.500144] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 366.500144] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Gatien:node:(1) 366.825590] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 368.859271] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 372.576814] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 372.576814] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 372.576814] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 372.576814] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 372.576814] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 372.576814] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 374.918868] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [Geoff:node:(4) 375.615150] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 379.762027] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 379.762027] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 381.439498] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [McGee:node:(2) 381.439498] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 382.333323] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 382.363743] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 383.232652] [lua/INFO] Received another request of type notify
-> [Jacquelin:node:(8) 385.551142] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Jacquelin:node:(8) 385.551142] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 48
-> [McGee:node:(2) 386.439498] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Boivin:node:(7) 387.121154] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 389.176345] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [Jacquelin:node:(8) 389.176345] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 389.176345] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [iRMX:node:(3) 389.762027] [lua/INFO] Sending a 'find successor' request to 42 for id 46
-> [TeX:node:(5) 390.988947] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [iRMX:node:(3) 391.947239] [lua/INFO] Sent the 'find successor' request to 42 for id 46, waiting for the answer
-> [iRMX:node:(3) 392.121154] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 392.393636] [lua/INFO] Received a 'find successor' request from 38 for id 46
-> [McGee:node:(2) 392.393636] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 392.800362] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 393.094698] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Gatien:node:(1) 394.363807] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Boivin:node:(7) 394.480281] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 394.480281] [lua/INFO] Received another request of type find successor
-> [iRMX:node:(3) 394.480281] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 394.480281] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Boivin:node:(7) 396.839408] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 396.943101] [lua/INFO] Sending a 'find successor' request to 1 for id 50
-> [iRMX:node:(3) 397.518616] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 397.831457] [lua/INFO] Sent the 'find successor' request to 1 for id 50, waiting for the answer
-> [McGee:node:(2) 398.736255] [lua/INFO] Received another request of type get predecessor
-> [Jacquelin:node:(8) 400.450794] [lua/INFO] Received a 'find successor' request from 42 for id 50
-> [Jacquelin:node:(8) 400.450794] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 50 is 48
-> [Geoff:node:(4) 400.556952] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 400.556952] [lua/INFO] Received another request of type find successor
-> [iRMX:node:(3) 400.556952] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 400.556952] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 400.556952] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 400.556952] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 400.556952] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 400.988947] [lua/INFO] Received a 'find successor' request from 38 for id 46
-> [TeX:node:(5) 400.988947] [lua/INFO] Sending back a 'find successor answer' to 38: the successor of 46 is 1
-> [TeX:node:(5) 400.988947] [lua/INFO] Sending a 'find successor' request to 1 for id 1337
-> [McGee:node:(2) 401.339150] [lua/INFO] Received the answer to my 'find successor' request for id 50: the successor is 48
-> [McGee:node:(2) 401.339150] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [McGee:node:(2) 401.738632] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [Gatien:node:(1) 401.738632] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 401.738632] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Gatien:node:(1) 401.738632] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 402.801549] [lua/INFO] Sent the 'find successor' request to 1 for id 1337, waiting for the answer
-> [TeX:node:(5) 402.801549] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 403.132304] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 403.595305] [lua/INFO] Received another request of type find successor
-> [iRMX:node:(3) 403.595305] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 403.595305] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [Geoff:node:(4) 403.595305] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Jacquelin:node:(8) 405.450794] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Jacquelin:node:(8) 405.450794] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 48
-> [Gatien:node:(1) 406.166602] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 406.787810] [lua/INFO] Received the answer to my 'find successor' request for id 46: the successor is 1
-> [Boivin:node:(7) 406.839408] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 407.263395] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 48
-> [Geoff:node:(4) 408.595305] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Geoff:node:(4) 408.595305] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 408.973022] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 409.198535] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 409.198535] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 409.198535] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Boivin:node:(7) 411.557662] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 412.236871] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 412.236871] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 414.422101] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 417.263395] [lua/INFO] Sending a 'find successor' request to 1 for id 29
-> [TeX:node:(5) 419.075997] [lua/INFO] Sent the 'find successor' request to 1 for id 29, waiting for the answer
-> [Gatien:node:(1) 419.864413] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Jacquelin:node:(8) 420.350446] [lua/INFO] Received a 'find successor' request from 21 for id 29
-> [Jacquelin:node:(8) 420.350446] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 29 is 48
-> [TeX:node:(5) 420.376239] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 421.781228] [lua/INFO] Sending a 'find successor' request to 38 for id 16
-> [TeX:node:(5) 422.188841] [lua/INFO] Received the answer to my 'find successor' request for id 29: the successor is 48
-> [TeX:node:(5) 422.188841] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [TeX:node:(5) 423.529064] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [TeX:node:(5) 423.529064] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 423.729544] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 423.729544] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 423.729544] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 423.729544] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 423.729544] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Gatien:node:(1) 423.729544] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 424.998652] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Geoff:node:(4) 424.998652] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 426.330377] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [McGee:node:(2) 426.729859] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [Gatien:node:(1) 426.729859] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 426.729859] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Gatien:node:(1) 426.729859] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 428.036988] [lua/INFO] Sending a 'find successor' request to 38 for id 40
-> [Jean_Yves:node:(6) 428.123532] [lua/INFO] Sending a 'find successor' request to 42 for id 22
-> [McGee:node:(2) 429.916686] [lua/INFO] Received another request of type notify
-> [Jean_Yves:node:(6) 431.709841] [lua/INFO] Sent the 'find successor' request to 42 for id 22, waiting for the answer
-> [McGee:node:(2) 431.709841] [lua/INFO] Received another request of type find successor
-> [McGee:node:(2) 431.709841] [lua/INFO] Received a 'find successor' request from 14 for id 22
-> [McGee:node:(2) 431.709841] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Boivin:node:(7) 431.781228] [lua/INFO] Sent the 'find successor' request to 38 for id 16, waiting for the answer
-> [TeX:node:(5) 432.663979] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 432.663979] [lua/INFO] Received a 'find successor' request from 14 for id 22
-> [TeX:node:(5) 432.663979] [lua/INFO] Sending back a 'find successor answer' to 14: the successor of 22 is 1
-> [iRMX:node:(3) 434.422101] [lua/INFO] Received a 'find successor' request from 8 for id 16
-> [iRMX:node:(3) 434.422101] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 16 is 42
-> [Jean_Yves:node:(6) 435.381368] [lua/INFO] Received the answer to my 'find successor' request for id 22: the successor is 1
-> [McGee:node:(2) 436.607313] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 436.624894] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 436.781228] [lua/INFO] Received the answer to my 'find successor' request for id 16: the successor is 42
-> [Boivin:node:(7) 436.781228] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [iRMX:node:(3) 437.460436] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 437.460436] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [Gatien:node:(1) 440.031733] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 440.498771] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 440.498771] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 443.691277] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 446.575442] [lua/INFO] Sent the 'find successor' request to 38 for id 40, waiting for the answer
-> [iRMX:node:(3) 446.575442] [lua/INFO] Received a 'find successor' request from 32 for id 40
-> [iRMX:node:(3) 446.575442] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 40 is 42
-> [Geoff:node:(4) 446.575442] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 446.575442] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Geoff:node:(4) 446.575442] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 447.844550] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 450.882886] [lua/INFO] Received the answer to my 'find successor' request for id 40: the successor is 42
-> [McGee:node:(2) 450.945866] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 451.119781] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [McGee:node:(2) 452.739020] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 453.760654] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 453.760654] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Gatien:node:(1) 454.113658] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [TeX:node:(5) 454.711944] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [TeX:node:(5) 456.052167] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [Boivin:node:(7) 456.119781] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 456.325329] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 458.760654] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 458.760654] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 460.945866] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 461.900004] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 463.068098] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 463.068098] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 463.068098] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 463.068098] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 463.068098] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Gatien:node:(1) 463.068098] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 463.808281] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 464.337206] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Geoff:node:(4) 464.337206] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 464.342546] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 466.891443] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 467.375541] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Boivin:node:(7) 471.119781] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [iRMX:node:(3) 471.798989] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 471.798989] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 472.854143] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [Gatien:node:(1) 474.370286] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 474.769768] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [iRMX:node:(3) 474.837325] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 474.837325] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [Gatien:node:(1) 475.639394] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Gatien:node:(1) 475.639394] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 476.325329] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 478.029830] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 479.911638] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 480.913995] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 480.913995] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 480.913995] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 480.913995] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 482.183115] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 482.183115] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Geoff:node:(4) 482.183115] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 485.221451] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Boivin:node:(7) 485.632250] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 485.632250] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 485.632250] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Gatien:node:(1) 487.183115] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Boivin:node:(7) 487.991377] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 490.002674] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 491.490559] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Gatien:node:(1) 491.490559] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 492.429596] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [iRMX:node:(3) 492.817462] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 492.817462] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [TeX:node:(5) 493.769819] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [Gatien:node:(1) 493.769819] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 493.769819] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Gatien:node:(1) 493.769819] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 495.002674] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 495.855797] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 495.855797] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 495.956812] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 497.124905] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Geoff:node:(4) 497.124905] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 497.865089] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 500.855797] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Boivin:node:(7) 505.176589] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 506.910951] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [McGee:node:(2) 507.310433] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [Gatien:node:(1) 507.310433] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 507.310433] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Gatien:node:(1) 507.310433] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [iRMX:node:(3) 507.817462] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 507.817462] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 510.002674] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 510.388759] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 510.855797] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 510.855797] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 514.048303] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 516.932468] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 516.932468] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 516.932468] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 516.932468] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 516.932468] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Geoff:node:(4) 516.932468] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 518.201576] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 519.470684] [lua/INFO] Sending a 'find successor' request to 32 for id 64
-> [Geoff:node:(4) 521.239911] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Boivin:node:(7) 521.650722] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 521.650722] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 521.650722] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Boivin:node:(7) 524.009849] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 525.497259] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 527.673506] [lua/INFO] Sending a 'find successor' request to 48 for id 1337
-> [McGee:node:(2) 527.682472] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 528.835934] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 528.835934] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [iRMX:node:(3) 528.835934] [lua/INFO] Sending a 'find successor' request to 1 for id 54
-> [McGee:node:(2) 529.475626] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 531.660838] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 531.879610] [lua/INFO] Sent the 'find successor' request to 1 for id 54, waiting for the answer
-> [iRMX:node:(3) 531.879610] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 533.143378] [lua/INFO] Sent the 'find successor' request to 32 for id 64, waiting for the answer
-> [Geoff:node:(4) 533.143378] [lua/INFO] Received a 'find successor' request from 48 for id 64
-> [Geoff:node:(4) 533.143378] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 533.143378] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 534.238737] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 534.483601] [lua/INFO] Sent the 'find successor' request to 48 for id 1337, waiting for the answer
-> [Gatien:node:(1) 534.483601] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 534.483601] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Gatien:node:(1) 534.483601] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 534.483601] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 535.437739] [lua/INFO] Sending a 'find successor' request to 48 for id 58
-> [Jacquelin:node:(8) 535.760556] [lua/INFO] Received a 'find successor' request from 38 for id 54
-> [Jacquelin:node:(8) 535.760556] [lua/INFO] Sending back a 'find successor answer' to 38: the successor of 54 is 48
-> [McGee:node:(2) 535.837222] [lua/INFO] Sent the 'find successor' request to 48 for id 58, waiting for the answer
-> [Gatien:node:(1) 535.837222] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 535.837222] [lua/INFO] Received a 'find successor' request from 42 for id 58
-> [Gatien:node:(1) 535.837222] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 536.181713] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 536.391878] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 536.597864] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [iRMX:node:(3) 537.277072] [lua/INFO] Received another request of type find successor
-> [iRMX:node:(3) 537.277072] [lua/INFO] Received a 'find successor' request from 48 for id 64
-> [iRMX:node:(3) 537.277072] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 64 is 42
-> [Gatien:node:(1) 539.848369] [lua/INFO] Received the answer to my 'find successor' request for id 64: the successor is 42
-> [iRMX:node:(3) 540.320748] [lua/INFO] Received the answer to my 'find successor' request for id 54: the successor is 48
-> [McGee:node:(2) 547.505960] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 548.359083] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 548.359083] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 548.359083] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 548.359083] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 548.359083] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Geoff:node:(4) 548.359083] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 549.299114] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 549.628191] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 549.628191] [lua/INFO] Received a 'find successor' request from 42 for id 58
-> [Geoff:node:(4) 549.628191] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 58 is 38
-> [McGee:node:(2) 550.511204] [lua/INFO] Received the answer to my 'find successor' request for id 58: the successor is 38
-> [McGee:node:(2) 550.511204] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Geoff:node:(4) 550.897300] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 552.166408] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Boivin:node:(7) 553.077337] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 553.077337] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 553.077337] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Geoff:node:(4) 553.935635] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Boivin:node:(7) 555.436465] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Jean_Yves:node:(6) 556.092268] [lua/INFO] Sending a 'find successor' request to 1 for id 30
-> [Jean_Yves:node:(6) 557.017399] [lua/INFO] Sent the 'find successor' request to 1 for id 30, waiting for the answer
-> [Jacquelin:node:(8) 557.171748] [lua/INFO] Received a 'find successor' request from 14 for id 30
-> [Jacquelin:node:(8) 557.171748] [lua/INFO] Sending back a 'find successor answer' to 14: the successor of 30 is 48
-> [Jean_Yves:node:(6) 558.096879] [lua/INFO] Received the answer to my 'find successor' request for id 30: the successor is 48
-> [Gatien:node:(1) 560.204743] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Gatien:node:(1) 560.204743] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 560.262549] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 560.262549] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [McGee:node:(2) 562.447761] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [McGee:node:(2) 562.447761] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 563.455055] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 564.632974] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 565.262549] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 565.262549] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 567.447761] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 568.300885] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 568.300885] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 568.984350] [lua/INFO] Sending a 'find successor' request to 48 for id 37
-> [TeX:node:(5) 570.324573] [lua/INFO] Sent the 'find successor' request to 48 for id 37, waiting for the answer
-> [Gatien:node:(1) 570.324573] [lua/INFO] Received another request of type find successor
-> [Gatien:node:(1) 570.324573] [lua/INFO] Received a 'find successor' request from 21 for id 37
-> [Gatien:node:(1) 570.324573] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 570.324573] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 572.232850] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 573.300885] [lua/INFO] Sending a 'find successor' request to 42 for id 48
-> [Gatien:node:(1) 573.446196] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 575.995093] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 577.161724] [lua/INFO] Sent the 'find successor' request to 42 for id 48, waiting for the answer
-> [Geoff:node:(4) 577.161724] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 577.161724] [lua/INFO] Received a 'find successor' request from 21 for id 37
-> [Geoff:node:(4) 577.161724] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 37 is 38
-> [Boivin:node:(7) 577.621677] [lua/INFO] Sending a 'find successor' request to 42 for id 24
-> [TeX:node:(5) 578.968986] [lua/INFO] Received the answer to my 'find successor' request for id 37: the successor is 38
-> [TeX:node:(5) 578.968986] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 581.278711] [lua/INFO] Received a 'find successor' request from 32 for id 48
-> [McGee:node:(2) 581.278711] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 581.278711] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [iRMX:node:(3) 583.463923] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 583.463923] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [Gatien:node:(1) 586.035220] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 587.304329] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 589.842545] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 592.053891] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 592.053891] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 592.053891] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 592.053891] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 592.053891] [lua/INFO] Received a 'find successor' request from 32 for id 48
-> [TeX:node:(5) 592.053891] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 48 is 1
-> [Geoff:node:(4) 593.861153] [lua/INFO] Received the answer to my 'find successor' request for id 48: the successor is 1
-> [McGee:node:(2) 594.239104] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 594.239104] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 594.239104] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 594.239104] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 594.343907] [lua/INFO] Sent the 'find successor' request to 42 for id 24, waiting for the answer
-> [McGee:node:(2) 594.343907] [lua/INFO] Received another request of type find successor
-> [McGee:node:(2) 594.343907] [lua/INFO] Received a 'find successor' request from 8 for id 24
-> [McGee:node:(2) 594.343907] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 595.246397] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 596.137061] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 597.058999] [lua/INFO] Received a 'find successor' request from 8 for id 24
-> [TeX:node:(5) 597.058999] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 24 is 1
-> [Boivin:node:(7) 598.187052] [lua/INFO] Received the answer to my 'find successor' request for id 24: the successor is 1
-> [McGee:node:(2) 598.322273] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 598.573437] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Geoff:node:(4) 600.315774] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 601.584882] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Gatien:node:(1) 601.584882] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 606.821778] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 608.871601] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 610.047933] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Geoff:node:(4) 612.500986] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Geoff:node:(4) 612.500986] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 612.500986] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 612.500986] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [iRMX:node:(3) 614.462651] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 614.462651] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 617.500986] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 621.122334] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 621.821778] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 621.821778] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 621.821778] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Gatien:node:(1) 623.671230] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 624.180905] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 625.014284] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 625.014284] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 625.014284] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [McGee:node:(2) 627.199496] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 627.199496] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 627.199496] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 627.199496] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 628.206789] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 628.992650] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 630.237831] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 630.237831] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 631.177862] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 632.809128] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 637.116572] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 639.209384] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Boivin:node:(7) 642.820506] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 643.925155] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 645.347344] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Geoff:node:(4) 648.499714] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Geoff:node:(4) 648.499714] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 649.768822] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 649.768822] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 649.768822] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 649.768822] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 649.768822] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 650.461378] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 650.461378] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 653.499714] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 653.653884] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 655.461378] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 655.461378] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 658.653884] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 667.896241] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 670.445138] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 673.434395] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 690.445138] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 692.820506] [lua/INFO] Failed to send the 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 692.994035] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 693.925155] [lua/INFO] Failed to send the 'find successor' request to 38 for id 1337
-> [Jean_Yves:node:(6) 695.718309] [lua/INFO] Sending a 'find successor' request to 42 for id 46
-> [iRMX:node:(3) 699.148702] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 699.148702] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [Jean_Yves:node:(6) 699.696676] [lua/INFO] Sent the 'find successor' request to 42 for id 46, waiting for the answer
-> [McGee:node:(2) 699.696676] [lua/INFO] Received a 'find successor' request from 14 for id 46
-> [McGee:node:(2) 699.696676] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 701.719999] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 705.379543] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 705.379543] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 705.379543] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 705.379543] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 706.027443] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 706.333697] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 706.333697] [lua/INFO] Received a 'find successor' request from 14 for id 46
-> [TeX:node:(5) 706.333697] [lua/INFO] Sending back a 'find successor answer' to 14: the successor of 46 is 1
-> [McGee:node:(2) 706.333697] [lua/INFO] Sending a 'find successor' request to 48 for id 74
-> [McGee:node:(2) 706.733179] [lua/INFO] Sent the 'find successor' request to 48 for id 74, waiting for the answer
-> [Jean_Yves:node:(6) 709.051086] [lua/INFO] Received the answer to my 'find successor' request for id 46: the successor is 1
-> [Gatien:node:(1) 709.258216] [lua/INFO] Received a 'find successor' request from 42 for id 74
-> [Gatien:node:(1) 709.258216] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 74 is 32
-> [TeX:node:(5) 709.526202] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 709.657698] [lua/INFO] Received the answer to my 'find successor' request for id 74: the successor is 32
-> [McGee:node:(2) 709.657698] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [iRMX:node:(3) 709.923883] [lua/INFO] Sending a 'find successor' request to 42 for id 70
-> [Boivin:node:(7) 710.097798] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 713.532188] [lua/INFO] Sending a 'find successor' request to 48 for id 53
-> [Gatien:node:(1) 714.258216] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [TeX:node:(5) 715.598439] [lua/INFO] Sent the 'find successor' request to 48 for id 53, waiting for the answer
-> [Geoff:node:(4) 756.027443] [lua/INFO] Failed to send the 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 756.910456] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [McGee:node:(2) 756.910456] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 759.095668] [lua/INFO] Sent the 'find successor' request to 42 for id 70, waiting for the answer
-> [McGee:node:(2) 759.095668] [lua/INFO] Received another request of type find successor
-> [McGee:node:(2) 759.095668] [lua/INFO] Received a 'find successor' request from 38 for id 70
-> [McGee:node:(2) 759.095668] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [iRMX:node:(3) 759.095668] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 760.049806] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 760.049806] [lua/INFO] Received a 'find successor' request from 38 for id 70
-> [TeX:node:(5) 760.049806] [lua/INFO] Sending back a 'find successor answer' to 38: the successor of 70 is 1
-> [Boivin:node:(7) 760.097798] [lua/INFO] Failed to send the 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 760.888822] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 761.454795] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 764.258216] [lua/INFO] Failed to send the 'find successor' request to 32 for id 1337
-> [Gatien:node:(1) 764.258216] [lua/INFO] Received a 'find successor' request from 21 for id 53
-> [Gatien:node:(1) 764.258216] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 53 is 32
-> [McGee:node:(2) 764.475131] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 764.493130] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 764.493130] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Geoff:node:(4) 764.493130] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 765.598439] [lua/INFO] Received the answer to my 'find successor' request for id 53: the successor is 32
-> [iRMX:node:(3) 767.685636] [lua/INFO] Received the answer to my 'find successor' request for id 70: the successor is 1
-> [Geoff:node:(4) 768.800574] [lua/INFO] Sending a 'find successor' request to 38 for id 64
-> [TeX:node:(5) 769.223643] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [McGee:node:(2) 769.870848] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 772.403890] [lua/INFO] Sending a 'find successor' request to 38 for id 40
-> [iRMX:node:(3) 773.083098] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 773.083098] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 775.268310] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 778.305795] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Geoff:node:(4) 779.159769] [lua/INFO] Sent the 'find successor' request to 38 for id 64, waiting for the answer
-> [iRMX:node:(3) 779.159769] [lua/INFO] Received a 'find successor' request from 32 for id 64
-> [iRMX:node:(3) 779.159769] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 64 is 42
-> [Geoff:node:(4) 779.159769] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 780.967031] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 780.967031] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 780.967031] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Geoff:node:(4) 780.967031] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 780.967031] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 782.236139] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 782.236139] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 782.236139] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 782.236139] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 782.875307] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 785.274474] [lua/INFO] Received the answer to my 'find successor' request for id 64: the successor is 42
-> [Geoff:node:(4) 785.274474] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 786.921169] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [McGee:node:(2) 787.804182] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Boivin:node:(7) 788.704108] [lua/INFO] Sent the 'find successor' request to 38 for id 40, waiting for the answer
-> [McGee:node:(2) 788.714323] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 789.959938] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 791.344981] [lua/INFO] Received a 'find successor' request from 8 for id 40
-> [iRMX:node:(3) 791.344981] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 40 is 42
-> [McGee:node:(2) 792.300632] [lua/INFO] Received another request of type notify
-> [Gatien:node:(1) 792.508834] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 793.704108] [lua/INFO] Received the answer to my 'find successor' request for id 40: the successor is 42
-> [iRMX:node:(3) 796.344981] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 796.344981] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 799.537486] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 801.344981] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 801.344981] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 803.530193] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 803.916278] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 804.383316] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 804.383316] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 804.383316] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 804.383316] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 804.383316] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [Geoff:node:(4) 804.383316] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Geoff:node:(4) 805.652425] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 808.690760] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Boivin:node:(7) 809.101571] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 811.112868] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 812.906022] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 813.046988] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [iRMX:node:(3) 813.927656] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 813.927656] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 816.112868] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 816.921533] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [TeX:node:(5) 818.773253] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 818.773253] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Geoff:node:(4) 818.773253] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [TeX:node:(5) 818.773253] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 820.042361] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 820.042361] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 820.042361] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 820.042361] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 820.681529] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 823.080696] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Boivin:node:(7) 826.286783] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 828.927656] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 828.927656] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Jean_Yves:node:(6) 829.699176] [lua/INFO] Sending a 'find successor' request to 1 for id 78
-> [McGee:node:(2) 829.727391] [lua/INFO] Sending a 'find successor' request to 32 for id 106
-> [McGee:node:(2) 830.610404] [lua/INFO] Sent the 'find successor' request to 32 for id 106, waiting for the answer
-> [Jean_Yves:node:(6) 830.624307] [lua/INFO] Sent the 'find successor' request to 1 for id 78, waiting for the answer
-> [McGee:node:(2) 831.112868] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 831.286783] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 831.965991] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 831.965991] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [Jacquelin:node:(8) 833.195981] [lua/INFO] Received a 'find successor' request from 14 for id 78
-> [Jacquelin:node:(8) 833.195981] [lua/INFO] Sending back a 'find successor answer' to 14: the successor of 78 is 48
-> [Jean_Yves:node:(6) 834.121112] [lua/INFO] Received the answer to my 'find successor' request for id 78: the successor is 48
-> [iRMX:node:(3) 835.004326] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 835.004326] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [TeX:node:(5) 835.158496] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 837.575623] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 840.914266] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 841.080997] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 841.080997] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 841.080997] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 841.080997] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 841.080997] [lua/INFO] Received a 'find successor' request from 42 for id 106
-> [Geoff:node:(4) 841.080997] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 106 is 38
-> [McGee:node:(2) 841.964010] [lua/INFO] Received the answer to my 'find successor' request for id 106: the successor is 38
-> [Geoff:node:(4) 842.350105] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 843.619213] [lua/INFO] Sending a 'find successor' request to 32 for id 112
-> [Geoff:node:(4) 845.388440] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 847.639925] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 850.008583] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Boivin:node:(7) 850.625336] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 852.573653] [lua/INFO] Sent the 'find successor' request to 32 for id 112, waiting for the answer
-> [Geoff:node:(4) 852.573653] [lua/INFO] Received a 'find successor' request from 48 for id 112
-> [Geoff:node:(4) 852.573653] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 852.573653] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 854.380914] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 854.380914] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [Geoff:node:(4) 854.380914] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 855.451421] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Geoff:node:(4) 857.419250] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [iRMX:node:(3) 858.266209] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 858.266209] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 860.451421] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 864.899002] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 865.625336] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Gatien:node:(1) 867.447899] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 867.636633] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 867.636633] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Boivin:node:(7) 869.995760] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 870.674968] [lua/INFO] Received a 'find successor' request from 48 for id 112
-> [iRMX:node:(3) 870.674968] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 112 is 42
-> [TeX:node:(5) 871.405559] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 873.198714] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 873.246265] [lua/INFO] Received the answer to my 'find successor' request for id 112: the successor is 42
-> [iRMX:node:(3) 873.713304] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 873.713304] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 874.152852] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 877.345358] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 879.789974] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 879.789974] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 879.789974] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 879.789974] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 881.059083] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Geoff:node:(4) 882.828310] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 884.160416] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [McGee:node:(2) 884.160416] [lua/INFO] Received another request of type notify
-> [iRMX:node:(3) 886.975187] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 886.975187] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [TeX:node:(5) 887.986052] [lua/INFO] Sending a 'find successor' request to 32 for id 85
-> [McGee:node:(2) 889.160399] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 891.975187] [lua/INFO] Sending a 'find successor' request to 1 for id 102
-> [Boivin:node:(7) 894.334314] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [iRMX:node:(3) 895.018862] [lua/INFO] Sent the 'find successor' request to 1 for id 102, waiting for the answer
-> [Jacquelin:node:(8) 895.018862] [lua/INFO] Received a 'find successor' request from 38 for id 102
-> [Jacquelin:node:(8) 895.018862] [lua/INFO] Sending back a 'find successor answer' to 38: the successor of 102 is 48
-> [iRMX:node:(3) 895.018862] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 896.282630] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 896.282630] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 896.282630] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 896.282630] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 897.377989] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 898.089892] [lua/INFO] Sent the 'find successor' request to 32 for id 85, waiting for the answer
-> [Geoff:node:(4) 898.089892] [lua/INFO] Received a 'find successor' request from 21 for id 85
-> [Geoff:node:(4) 898.089892] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 85 is 38
-> [TeX:node:(5) 898.089892] [lua/INFO] Received another request of type get predecessor
-> [Gatien:node:(1) 898.831527] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 899.737116] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 899.737116] [lua/INFO] Received another request of type find successor
-> [iRMX:node:(3) 899.737116] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 899.737116] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [TeX:node:(5) 899.897153] [lua/INFO] Received the answer to my 'find successor' request for id 85: the successor is 38
-> [TeX:node:(5) 899.897153] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Geoff:node:(4) 901.128227] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Boivin:node:(7) 902.096243] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [iRMX:node:(3) 902.780792] [lua/INFO] Received the answer to my 'find successor' request for id 102: the successor is 48
-> [McGee:node:(2) 904.044030] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [iRMX:node:(3) 905.819127] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 905.819127] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [Gatien:node:(1) 908.390424] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 909.011633] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 909.011633] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 909.011633] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 909.011633] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 912.096243] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 912.204138] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 915.088303] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 915.088303] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 915.088303] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Geoff:node:(4) 915.088303] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 917.273515] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 917.273515] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 917.273515] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 917.273515] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 918.126639] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 918.126639] [lua/INFO] Sending a 'find successor' request to 42 for id 96
-> [McGee:node:(2) 919.066670] [lua/INFO] Received another request of type get predecessor
-> [Boivin:node:(7) 919.632643] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 919.632643] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 919.632643] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [McGee:node:(2) 921.251882] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 921.357412] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Boivin:node:(7) 921.991770] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Geoff:node:(4) 922.134895] [lua/INFO] Sent the 'find successor' request to 42 for id 96, waiting for the answer
-> [Geoff:node:(4) 922.134895] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 922.206020] [lua/INFO] Received a 'find successor' request from 32 for id 96
-> [McGee:node:(2) 922.206020] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 923.404003] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 923.404003] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 923.404003] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 923.404003] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [Gatien:node:(1) 923.906308] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 924.369680] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Boivin:node:(7) 929.176982] [lua/INFO] Sending a 'find successor' request to 42 for id 72
-> [Boivin:node:(7) 929.281785] [lua/INFO] Sent the 'find successor' request to 42 for id 72, waiting for the answer
-> [iRMX:node:(3) 931.817855] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 931.817855] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 932.138525] [lua/INFO] Received a 'find successor' request from 8 for id 72
-> [McGee:node:(2) 932.138525] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 932.138525] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 934.389152] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 935.010360] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [TeX:node:(5) 935.010360] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 935.010360] [lua/INFO] Received a 'find successor' request from 32 for id 96
-> [TeX:node:(5) 935.010360] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 96 is 1
-> [TeX:node:(5) 935.964499] [lua/INFO] Received another request of type notify
-> [Geoff:node:(4) 936.817622] [lua/INFO] Received the answer to my 'find successor' request for id 96: the successor is 1
-> [iRMX:node:(3) 936.817855] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 936.817855] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 936.918637] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 936.918637] [lua/INFO] Received a 'find successor' request from 8 for id 72
-> [TeX:node:(5) 936.918637] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 72 is 1
-> [Boivin:node:(7) 938.046691] [lua/INFO] Received the answer to my 'find successor' request for id 72: the successor is 1
-> [Boivin:node:(7) 938.046691] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 940.111143] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 944.003067] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [McGee:node:(2) 944.003067] [lua/INFO] Received another request of type get predecessor
-> [McGee:node:(2) 946.188279] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 946.188279] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 946.188279] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 947.981433] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 950.166645] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 950.495722] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [Boivin:node:(7) 951.585741] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 951.585741] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 951.585741] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Geoff:node:(4) 952.264949] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Boivin:node:(7) 953.944868] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 954.444462] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Jean_Yves:node:(6) 955.796221] [lua/INFO] Sending a 'find successor' request to 42 for id 142
-> [Jean_Yves:node:(6) 958.703458] [lua/INFO] Sent the 'find successor' request to 42 for id 142, waiting for the answer
-> [Geoff:node:(4) 961.809289] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Geoff:node:(4) 961.809289] [lua/INFO] Received another request of type notify
-> [McGee:node:(2) 961.910304] [lua/INFO] Received a 'find successor' request from 14 for id 142
-> [McGee:node:(2) 961.910304] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [McGee:node:(2) 961.910304] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 963.078397] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [Geoff:node:(4) 963.078397] [lua/INFO] Received another request of type find successor
-> [Geoff:node:(4) 963.078397] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [Geoff:node:(4) 963.078397] [lua/INFO] Forwarding the 'find successor' request to my closest preceding finger
-> [iRMX:node:(3) 963.770953] [lua/INFO] Received a 'find successor' request from 32 for id 1337
-> [iRMX:node:(3) 963.770953] [lua/INFO] Sending back a 'find successor answer' to 32: the successor of 1337 is 42
-> [Gatien:node:(1) 966.455205] [lua/INFO] Received another request of type get predecessor
-> [Geoff:node:(4) 966.809289] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 969.004102] [lua/INFO] Received another request of type notify
-> [Boivin:node:(7) 971.130081] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [TeX:node:(5) 971.963459] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [TeX:node:(5) 971.963459] [lua/INFO] Received another request of type notify
-> [TeX:node:(5) 972.917597] [lua/INFO] Received another request of type find successor
-> [TeX:node:(5) 972.917597] [lua/INFO] Received a 'find successor' request from 14 for id 142
-> [TeX:node:(5) 972.917597] [lua/INFO] Sending back a 'find successor answer' to 14: the successor of 142 is 1
-> [iRMX:node:(3) 973.770953] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 973.770953] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [Jean_Yves:node:(6) 975.634987] [lua/INFO] Received the answer to my 'find successor' request for id 142: the successor is 1
-> [McGee:node:(2) 975.956183] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 975.956183] [lua/INFO] Received a 'find successor' request from 42 for id 1337
-> [iRMX:node:(3) 975.956183] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 1337 is 42
-> [McGee:node:(2) 975.956183] [lua/INFO] Received another request of type get predecessor
-> [TeX:node:(5) 976.963459] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 977.749338] [lua/INFO] Received another request of type get predecessor
-> [iRMX:node:(3) 978.994519] [lua/INFO] Received a 'find successor' request from 48 for id 1337
-> [iRMX:node:(3) 978.994519] [lua/INFO] Sending back a 'find successor answer' to 48: the successor of 1337 is 42
-> [McGee:node:(2) 979.934550] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Gatien:node:(1) 981.565816] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [McGee:node:(2) 982.681843] [lua/INFO] Sending a 'find successor' request to 48 for id 170
-> [McGee:node:(2) 983.081325] [lua/INFO] Sent the 'find successor' request to 48 for id 170, waiting for the answer
-> [Gatien:node:(1) 983.081325] [lua/INFO] Received a 'find successor' request from 42 for id 170
-> [Gatien:node:(1) 983.081325] [lua/INFO] Sending back a 'find successor answer' to 42: the successor of 170 is 32
-> [McGee:node:(2) 983.480807] [lua/INFO] Received the answer to my 'find successor' request for id 170: the successor is 32
-> [Boivin:node:(7) 983.712773] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [iRMX:node:(3) 983.712773] [lua/INFO] Received a 'find successor' request from 8 for id 1337
-> [iRMX:node:(3) 983.712773] [lua/INFO] Sending back a 'find successor answer' to 8: the successor of 1337 is 42
-> [Boivin:node:(7) 986.071900] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [TeX:node:(5) 990.448583] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [McGee:node:(2) 993.480807] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [TeX:node:(5) 994.090491] [lua/INFO] Sent the 'find successor' request to 38 for id 1337, waiting for the answer
-> [Geoff:node:(4) 994.580654] [lua/INFO] Sending a 'find successor' request to 38 for id 1337
-> [Gatien:node:(1) 995.273210] [lua/INFO] Sending a 'find successor' request to 32 for id 1337
-> [McGee:node:(2) 995.463666] [lua/INFO] Sent the 'find successor' request to 32 for id 1337, waiting for the answer
-> [iRMX:node:(3) 995.897985] [lua/INFO] Received a 'find successor' request from 21 for id 1337
-> [iRMX:node:(3) 995.897985] [lua/INFO] Sending back a 'find successor answer' to 21: the successor of 1337 is 42
-> [TeX:node:(5) 999.090491] [lua/INFO] Received the answer to my 'find successor' request for id 1337: the successor is 42
-> [Jacquelin:node:(8) 1000.278550] [lua/INFO] Leaving the ring
-> [iRMX:node:(3) 1000.897985] [lua/INFO] Leaving the ring
-> [McGee:node:(2) 1001.335646] [lua/INFO] Received another request of type get predecessor
-> [Jean_Yves:node:(6) 1003.128801] [lua/INFO] Leaving the ring
-> [McGee:node:(2) 1003.128801] [lua/INFO] Failed to receive the answer to my 'find successor' request
-> [McGee:node:(2) 1003.128801] [lua/INFO] Leaving the ring
-> [TeX:node:(5) 1004.090491] [lua/INFO] Leaving the ring
-> [Geoff:node:(4) 1044.580654] [lua/INFO] Failed to send the 'find successor' request to 38 for id 1337
-> [Geoff:node:(4) 1044.580654] [lua/INFO] Leaving the ring
-> [Gatien:node:(1) 1045.273210] [lua/INFO] Failed to send the 'find successor' request to 32 for id 1337
-> [Gatien:node:(1) 1045.273210] [lua/INFO] Leaving the ring
-> [Boivin:node:(7) 1046.071900] [lua/INFO] Leaving the ring
+++ /dev/null
--- Copyright (c) 2011, 2013-2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
- dofile 'master.lua'
- dofile 'slave.lua'
-
- simgrid.init_application();
- --Set Application
- simgrid.host.set_function{host="Tremblay",fct="Master",args="20,550000000,1000000,4"};
- simgrid.host.set_function{host="Jupiter",fct="Slave",args="1"};
- simgrid.host.set_function{host="Fafard",fct="Slave",args="2"};
- simgrid.host.set_function{host="Ginette",fct="Slave",args="3"};
- simgrid.host.set_function{host="Bourassa",fct="Slave",args="0"};
+++ /dev/null
--- Copyright (c) 2011, 2013-2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
---Master Function
-function Master(...)
-
- if select("#", ...) ~= 4 then
- error("Wrong number of arguments (got " .. select("#", ...) ..
- ", expected 4: nb_tasks comp_size comm_size slave_count)")
- end
-
- simgrid.info("Hello from lua, I'm the master")
- for i,v in ipairs({...}) do
- simgrid.info("Got " .. v)
- end
-
- local nb_task, comp_size, comm_size, slave_count = select(1, ...)
-
- simgrid.info("Argc=" .. select("#", ...) .. " (should be 4)")
-
- -- Dispatch the tasks
-
- for i = 1, nb_task do
- task = simgrid.task.new("Task " .. i, comp_size, comm_size);
- local task_name = simgrid.task.get_name(task)
- alias = "slave " .. string.format("%d",i%slave_count);
- simgrid.info("Master sending '" .. task_name .. "' To '" .. alias .. "'");
- simgrid.task.send(task, alias); -- C user data set to NULL
- simgrid.info("Master done sending '" .. task_name .. "' To '" .. alias .. "'");
- end
-
- -- Sending Finalize Message To Others
-
- simgrid.info("Master: All tasks have been dispatched. Let's tell everybody the computation is over.");
- for i = 0, slave_count-1 do
- alias = "slave " .. i;
- simgrid.info("Master: sending finalize to " .. alias);
- finalize = simgrid.task.new("finalize", comp_size, comm_size);
- simgrid.task.send(finalize, alias)
- end
- simgrid.info("Master: Everything's done.");
-end
---end_of_master
+++ /dev/null
--- Copyright (c) 2011, 2013-2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-require "simgrid"
-dofile 'platform.lua'
-dofile 'deploy.lua'
---Rutform.lua'
-dofile 'master.lua'
-dofile 'slave.lua'
- simgrid.run()
- simgrid.info("Simulation's over.See you.")
+++ /dev/null
-# compile the master_slave_bypass example
-
-$ lua master_slave_bypass.lua --log=surf_parse.thres:critical
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Hello from lua, I'm the master
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Got 20
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Got 550000000
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Got 1000000
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Got 4
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Argc=4 (should be 4)
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Master sending 'Task 1' To 'slave 1'
-> [Jupiter:Slave:(2) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mbox: slave 1
-> [Fafard:Slave:(3) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mbox: slave 2
-> [Ginette:Slave:(4) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mbox: slave 3
-> [Bourassa:Slave:(5) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mbox: slave 0
-> [Jupiter:Slave:(2) 5.405202] [lua/INFO] Slave 'slave 1' processing Task 1
-> [Tremblay:Master:(1) 5.405202] [lua/INFO] Master done sending 'Task 1' To 'slave 1'
-> [Tremblay:Master:(1) 5.405202] [lua/INFO] Master sending 'Task 2' To 'slave 2'
-> [Jupiter:Slave:(2) 12.613968] [lua/INFO] Slave 'slave 1': task Task 1 done
-> [Fafard:Slave:(3) 30.082767] [lua/INFO] Slave 'slave 2' processing Task 2
-> [Tremblay:Master:(1) 30.082767] [lua/INFO] Master done sending 'Task 2' To 'slave 2'
-> [Tremblay:Master:(1) 30.082767] [lua/INFO] Master sending 'Task 3' To 'slave 3'
-> [Fafard:Slave:(3) 37.291533] [lua/INFO] Slave 'slave 2': task Task 2 done
-> [Ginette:Slave:(4) 47.919864] [lua/INFO] Slave 'slave 3' processing Task 3
-> [Tremblay:Master:(1) 47.919864] [lua/INFO] Master done sending 'Task 3' To 'slave 3'
-> [Tremblay:Master:(1) 47.919864] [lua/INFO] Master sending 'Task 4' To 'slave 0'
-> [Ginette:Slave:(4) 59.261941] [lua/INFO] Slave 'slave 3': task Task 3 done
-> [Bourassa:Slave:(5) 78.260299] [lua/INFO] Slave 'slave 0' processing Task 4
-> [Tremblay:Master:(1) 78.260299] [lua/INFO] Master done sending 'Task 4' To 'slave 0'
-> [Tremblay:Master:(1) 78.260299] [lua/INFO] Master sending 'Task 5' To 'slave 1'
-> [Jupiter:Slave:(2) 83.665501] [lua/INFO] Slave 'slave 1' processing Task 5
-> [Tremblay:Master:(1) 83.665501] [lua/INFO] Master done sending 'Task 5' To 'slave 1'
-> [Tremblay:Master:(1) 83.665501] [lua/INFO] Master sending 'Task 6' To 'slave 2'
-> [Bourassa:Slave:(5) 89.602376] [lua/INFO] Slave 'slave 0': task Task 4 done
-> [Jupiter:Slave:(2) 90.874267] [lua/INFO] Slave 'slave 1': task Task 5 done
-> [Fafard:Slave:(3) 108.343066] [lua/INFO] Slave 'slave 2' processing Task 6
-> [Tremblay:Master:(1) 108.343066] [lua/INFO] Master done sending 'Task 6' To 'slave 2'
-> [Tremblay:Master:(1) 108.343066] [lua/INFO] Master sending 'Task 7' To 'slave 3'
-> [Fafard:Slave:(3) 115.551832] [lua/INFO] Slave 'slave 2': task Task 6 done
-> [Ginette:Slave:(4) 126.180163] [lua/INFO] Slave 'slave 3' processing Task 7
-> [Tremblay:Master:(1) 126.180163] [lua/INFO] Master done sending 'Task 7' To 'slave 3'
-> [Tremblay:Master:(1) 126.180163] [lua/INFO] Master sending 'Task 8' To 'slave 0'
-> [Ginette:Slave:(4) 137.522240] [lua/INFO] Slave 'slave 3': task Task 7 done
-> [Bourassa:Slave:(5) 156.520598] [lua/INFO] Slave 'slave 0' processing Task 8
-> [Tremblay:Master:(1) 156.520598] [lua/INFO] Master done sending 'Task 8' To 'slave 0'
-> [Tremblay:Master:(1) 156.520598] [lua/INFO] Master sending 'Task 9' To 'slave 1'
-> [Jupiter:Slave:(2) 161.925800] [lua/INFO] Slave 'slave 1' processing Task 9
-> [Tremblay:Master:(1) 161.925800] [lua/INFO] Master done sending 'Task 9' To 'slave 1'
-> [Tremblay:Master:(1) 161.925800] [lua/INFO] Master sending 'Task 10' To 'slave 2'
-> [Bourassa:Slave:(5) 167.862675] [lua/INFO] Slave 'slave 0': task Task 8 done
-> [Jupiter:Slave:(2) 169.134566] [lua/INFO] Slave 'slave 1': task Task 9 done
-> [Fafard:Slave:(3) 186.603365] [lua/INFO] Slave 'slave 2' processing Task 10
-> [Tremblay:Master:(1) 186.603365] [lua/INFO] Master done sending 'Task 10' To 'slave 2'
-> [Tremblay:Master:(1) 186.603365] [lua/INFO] Master sending 'Task 11' To 'slave 3'
-> [Fafard:Slave:(3) 193.812131] [lua/INFO] Slave 'slave 2': task Task 10 done
-> [Ginette:Slave:(4) 204.440462] [lua/INFO] Slave 'slave 3' processing Task 11
-> [Tremblay:Master:(1) 204.440462] [lua/INFO] Master done sending 'Task 11' To 'slave 3'
-> [Tremblay:Master:(1) 204.440462] [lua/INFO] Master sending 'Task 12' To 'slave 0'
-> [Ginette:Slave:(4) 215.782540] [lua/INFO] Slave 'slave 3': task Task 11 done
-> [Bourassa:Slave:(5) 234.780897] [lua/INFO] Slave 'slave 0' processing Task 12
-> [Tremblay:Master:(1) 234.780897] [lua/INFO] Master done sending 'Task 12' To 'slave 0'
-> [Tremblay:Master:(1) 234.780897] [lua/INFO] Master sending 'Task 13' To 'slave 1'
-> [Jupiter:Slave:(2) 240.186099] [lua/INFO] Slave 'slave 1' processing Task 13
-> [Tremblay:Master:(1) 240.186099] [lua/INFO] Master done sending 'Task 13' To 'slave 1'
-> [Tremblay:Master:(1) 240.186099] [lua/INFO] Master sending 'Task 14' To 'slave 2'
-> [Bourassa:Slave:(5) 246.122974] [lua/INFO] Slave 'slave 0': task Task 12 done
-> [Jupiter:Slave:(2) 247.394865] [lua/INFO] Slave 'slave 1': task Task 13 done
-> [Fafard:Slave:(3) 264.863664] [lua/INFO] Slave 'slave 2' processing Task 14
-> [Tremblay:Master:(1) 264.863664] [lua/INFO] Master done sending 'Task 14' To 'slave 2'
-> [Tremblay:Master:(1) 264.863664] [lua/INFO] Master sending 'Task 15' To 'slave 3'
-> [Fafard:Slave:(3) 272.072430] [lua/INFO] Slave 'slave 2': task Task 14 done
-> [Ginette:Slave:(4) 282.700762] [lua/INFO] Slave 'slave 3' processing Task 15
-> [Tremblay:Master:(1) 282.700762] [lua/INFO] Master done sending 'Task 15' To 'slave 3'
-> [Tremblay:Master:(1) 282.700762] [lua/INFO] Master sending 'Task 16' To 'slave 0'
-> [Ginette:Slave:(4) 294.042839] [lua/INFO] Slave 'slave 3': task Task 15 done
-> [Bourassa:Slave:(5) 313.041196] [lua/INFO] Slave 'slave 0' processing Task 16
-> [Tremblay:Master:(1) 313.041196] [lua/INFO] Master done sending 'Task 16' To 'slave 0'
-> [Tremblay:Master:(1) 313.041196] [lua/INFO] Master sending 'Task 17' To 'slave 1'
-> [Jupiter:Slave:(2) 318.446398] [lua/INFO] Slave 'slave 1' processing Task 17
-> [Tremblay:Master:(1) 318.446398] [lua/INFO] Master done sending 'Task 17' To 'slave 1'
-> [Tremblay:Master:(1) 318.446398] [lua/INFO] Master sending 'Task 18' To 'slave 2'
-> [Bourassa:Slave:(5) 324.383273] [lua/INFO] Slave 'slave 0': task Task 16 done
-> [Jupiter:Slave:(2) 325.655164] [lua/INFO] Slave 'slave 1': task Task 17 done
-> [Fafard:Slave:(3) 343.123963] [lua/INFO] Slave 'slave 2' processing Task 18
-> [Tremblay:Master:(1) 343.123963] [lua/INFO] Master done sending 'Task 18' To 'slave 2'
-> [Tremblay:Master:(1) 343.123963] [lua/INFO] Master sending 'Task 19' To 'slave 3'
-> [Fafard:Slave:(3) 350.332729] [lua/INFO] Slave 'slave 2': task Task 18 done
-> [Ginette:Slave:(4) 360.961061] [lua/INFO] Slave 'slave 3' processing Task 19
-> [Tremblay:Master:(1) 360.961061] [lua/INFO] Master done sending 'Task 19' To 'slave 3'
-> [Tremblay:Master:(1) 360.961061] [lua/INFO] Master sending 'Task 20' To 'slave 0'
-> [Ginette:Slave:(4) 372.303138] [lua/INFO] Slave 'slave 3': task Task 19 done
-> [Bourassa:Slave:(5) 391.301495] [lua/INFO] Slave 'slave 0' processing Task 20
-> [Tremblay:Master:(1) 391.301495] [lua/INFO] Master done sending 'Task 20' To 'slave 0'
-> [Tremblay:Master:(1) 391.301495] [lua/INFO] Master: All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Tremblay:Master:(1) 391.301495] [lua/INFO] Master: sending finalize to slave 0
-> [Bourassa:Slave:(5) 402.643572] [lua/INFO] Slave 'slave 0': task Task 20 done
-> [Tremblay:Master:(1) 432.984007] [lua/INFO] Master: sending finalize to slave 1
-> [Bourassa:Slave:(5) 432.984007] [lua/INFO] Slave 'slave 0' got finalize msg
-> [Bourassa:Slave:(5) 432.984007] [lua/INFO] Slave 'slave 0': I'm Done . See You !!
-> [Jupiter:Slave:(2) 438.389209] [lua/INFO] Slave 'slave 1' got finalize msg
-> [Jupiter:Slave:(2) 438.389209] [lua/INFO] Slave 'slave 1': I'm Done . See You !!
-> [Tremblay:Master:(1) 438.389209] [lua/INFO] Master: sending finalize to slave 2
-> [Fafard:Slave:(3) 463.066774] [lua/INFO] Slave 'slave 2' got finalize msg
-> [Fafard:Slave:(3) 463.066774] [lua/INFO] Slave 'slave 2': I'm Done . See You !!
-> [Tremblay:Master:(1) 463.066774] [lua/INFO] Master: sending finalize to slave 3
-> [Ginette:Slave:(4) 480.903871] [lua/INFO] Slave 'slave 3' got finalize msg
-> [Ginette:Slave:(4) 480.903871] [lua/INFO] Slave 'slave 3': I'm Done . See You !!
-> [Tremblay:Master:(1) 480.903871] [lua/INFO] Master: Everything's done.
-> [480.903871] [lua/INFO] Simulation's over.See you.
-
+++ /dev/null
--- Copyright (c) 2011, 2013-2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-simgrid.platf.open();
-
-simgrid.platf.AS_open{id="AS0",mode="Full"};
-
-simgrid.platf.host_new{id="Tremblay",speed=98095000};
-simgrid.platf.host_new{id="Jupiter",speed=76296000};
-simgrid.platf.host_new{id="Fafard",speed=76296000};
-simgrid.platf.host_new{id="Ginette",speed=48492000};
-simgrid.platf.host_new{id="Bourassa",speed=48492000};
-
--- create Links
-for i=10,0,-1 do
- simgrid.platf.link_new{id=i,bandwidth=252750+ i*768,lat=0.000270544+i*0.087};
-end
-
-simgrid.platf.route_new{src="Tremblay",dest="Jupiter",links="1"};
-simgrid.platf.route_new{src="Tremblay",dest="Fafard",links="0,1,2,3,4,8"};
-simgrid.platf.route_new{src="Tremblay",dest="Ginette",links="3,4,5"};
-simgrid.platf.route_new{src="Tremblay",dest="Bourassa",links="0,1,3,2,4,6,7"};
-
---simgrid.platf.route_new{src="Jupiter",dest="Tremblay",links="1"};
-simgrid.platf.route_new{src="Jupiter",dest="Bourassa",links="0,1,2,3,4,6,7,9"};
-simgrid.platf.route_new{src="Jupiter",dest="Fafard",links="0,1,2,3,4,8,9"};
-simgrid.platf.route_new{src="Jupiter",dest="Ginette",links="3,4,5,9"};
-
-simgrid.platf.route_new{src="Fafard",dest="Ginette",links="0,1,2,5,8"};
-simgrid.platf.route_new{src="Fafard",dest="Bourassa",links="6,7,8"};
---simgrid.platf.route_new{src="Fafard",dest="Tremblay",links="0,1,2,3,4,8"};
---simgrid.platf.route_new{src="Fafard",dest="Jupiter",links="0,1,2,3,4,8,9"};
-
-simgrid.platf.route_new{src="Ginette",dest="Bourassa",links="0,1,2,5,6,7"};
---simgrid.platf.route_new{src="Ginette",dest="Tremblay",links="3,4,5"};
---simgrid.platf.route_new{src="Ginette",dest="Jupiter",links="3,4,5,9"};
---simgrid.platf.route_new{src="Ginette",dest="Fafard",links="0,1,2,5,8"};
-
---simgrid.platf.route_new{src="Bourassa",dest="Tremblay",links="0,1,3,2,4,6,7"};
---simgrid.platf.route_new{src="Bourassa",dest="Jupiter",links="0,1,2,3,4,6,7,9"};
---simgrid.platf.route_new{src="Bourassa",dest="Fafard",links="6,7,8"};
---simgrid.platf.route_new{src="Bourassa",dest="Ginette",links="0,1,2,5,6,7"};
-simgrid.platf.AS_close();
-
-simgrid.platf.close();
-
+++ /dev/null
--- Copyright (c) 2011, 2013-2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- Slave Function ---------------------------------------------------------
-function Slave(...)
-
- if select("#", ...) ~= 1 then
- error("Wrong number of arguments (got " .. #arg .. ", expected 1: slave_id)")
- end
-
- local my_mailbox = "slave " .. select(1, ...)
- simgrid.info("Hello from lua, I'm a poor slave with mbox: " .. my_mailbox)
-
- while true do
-
- local task = simgrid.task.recv(my_mailbox);
- --print(task)
- local task_name = task:get_name()
- if (task:get_name() == "finalize") then
- simgrid.info("Slave '" .. my_mailbox .. "' got finalize msg");
- break
- end
- --local tk_name = simgrid.task.get_name(tk)
- simgrid.info("Slave '" .. my_mailbox .. "' processing " .. task:get_name())
- simgrid.task.execute(task)
- simgrid.info("Slave '" .. my_mailbox .. "': task " .. task:get_name() .. " done")
- end -- while
-
- simgrid.info("Slave '" .. my_mailbox .. "': I'm Done . See You !!");
-
-end
--- end_of_slave
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
- <!-- The master process (with some arguments) -->
- <process host="Tremblay" function="Master">
- <argument value="20"/> <!-- Number of tasks -->
- <argument value="50000000"/> <!-- Computation size of tasks -->
- <argument value="1000000"/> <!-- Communication size of tasks -->
- <argument value="4"/> <!-- Amount of slaves -->
- </process>
- <!-- The slave process (argument: slave rank) -->
- <process host="Bourassa" function="Slave">
- <argument value="0"/>
- </process>
- <process host="Jupiter" function="Slave">
- <argument value="1"/>
- </process>
- <process host="Fafard" function="Slave">
- <argument value="2"/>
- </process>
- <process host="Ginette" function="Slave">
- <argument value="3"/>
- </process>
-</platform>
+++ /dev/null
--- A SimGrid Lua implementation of the Kademlia protocol.
-
--- Copyright (c) 2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-require("simgrid")
-
--- Common constants
-common = {
- COMM_SIZE = 1,
- RANDOM_LOOKUP_INTERVAL = 100,
- ALPHA = 3,
- IDENTIFIER_SIZE = 32,
- BUCKET_SIZE = 20,
- MAX_JOIN_TRIALS = 4,
- FIND_NODE_TIMEOUT = 10,
- FIND_NODE_GLOBAL_TIMEOUT = 50,
- PING_TIMEOUT = 35,
- MAX_STEPS = 10,
- JOIN_BUCKETS_QUERIES = 5
-}
-require("tools")
--- Routing table
-require("routing_table")
-
-data = {
- id = -1,
- mailbox = "",
- deadline = 0,
- comm = nil,
- find_node_succedded = 0,
- find_node_failed = 0
-
-}
-
-function node(...)
- local args = {...}
-
- if #args ~= 2 and #args ~= 3 then
- simgrid.info("Wrong argument count: " .. #args)
- return
- end
- data.id = tonumber(args[1])
- routing_table_init(data.id)
- data.mailbox = tostring(data.id)
- if #args == 3 then
- data.deadline = tonumber(args[3])
- simgrid.info("Hi, I'm going to join the network with the id " .. data.id .. " !")
- if join_network(tonumber(args[2])) then
- main_loop()
- else
- simgrid.info("Couldn't join the network")
- end
- else
- data.deadline = tonumber(args[2])
- routing_table_update(data.id)
- data.comm = simgrid.task.irecv(data.mailbox)
- main_loop()
- end
- simgrid.info(data.find_node_succedded .. "/" .. (data.find_node_succedded + data.find_node_failed) .. " FIND_NODE have succedded");
- simgrid.process.sleep(10000)
-end
-function main_loop()
- local next_lookup_time = simgrid.get_clock() + common.RANDOM_LOOKUP_INTERVAL
- local now = simgrid.get_clock()
- while now < data.deadline do
- task,err = data.comm:test()
- if task then
- handle_task(task)
- data.comm = simgrid.task.irecv(data.mailbox)
- elseif err then
- data.comm = simgrid.task.irecv(data.mailbox)
- else
- if now >= next_lookup_time then
- random_lookup()
- next_lookup_time = next_lookup_time + common.RANDOM_LOOKUP_INTERVAL
- now = simgrid.get_clock()
- else
- simgrid.process.sleep(1)
- now = simgrid.get_clock()
- end
- end
- end
-end
-function random_lookup()
- find_node(0,true)
-end
-function join_network(id_known)
- local answer_got = false
- local time_begin = simgrid.get_clock()
-
- simgrid.debug("Joining the network knowing " .. id_known)
-
- routing_table_update(data.id)
- routing_table_update(id_known)
-
- -- Send a FIND_NODE to the node we know
- send_find_node(id_known,data.id)
- -- Wait for the answer
- local trials = 0
-
- data.comm = simgrid.task.irecv(data.mailbox)
-
- repeat
- task,err = data.comm:test()
- if task then
- if task.type == "FIND_NODE_ANSWER" then
- answer_got = true
- local answer = task.answer
- -- Add the nodes we received to our routing table
- for i,v in pairs(answer.nodes) do
- routing_table_update(v.id)
- end
- else
- handle_task(task)
- end
- data.comm = simgrid.task.irecv(data.mailbox)
- elseif err then
- data.comm = simgrid.task.irecv(data.mailbox)
- else
- simgrid.process.sleep(1)
- end
- until answer_got or trials >= common.MAX_JOIN_TRIALS
- -- Second step: Send a FIND_NODE in a node in each bucket
- local bucket_id = find_bucket(id_known).id
- local i = 0
- while ((bucket_id - i) > 0 or (bucket_id + i) <= common.IDENTIFIER_SIZE) and i < common.JOIN_BUCKETS_QUERIES do
- if bucket_id - i > 0 then
- local id_in_bucket = get_id_in_prefix(data.id,bucket_id - i)
- find_node(id_in_bucket,false)
- end
- if bucket_id + i <= common.IDENTIFIER_SIZE then
- local id_in_bucket = get_id_in_prefix(data.id,bucket_id + i)
- find_node(id_in_bucket,false)
- end
- i = i + 1
- end
- return answer_got
-end
--- Send a request to find a node in the node's routing table.
-function find_node(destination, counts)
- local queries, answers
- local total_answers = 0
- total_queries = 0
- local nodes_added = 0
- local destination_found = false
- local steps = 0
- local timeout
- local global_timeout = simgrid.get_clock() + common.FIND_NODE_GLOBAL_TIMEOUT
- -- Build a list of the closest nodes we already know.
- local node_list = find_closest(destination)
-
- simgrid.debug("Doing a FIND_NODE on " .. destination)
- repeat
- answers = 0
- queries = send_find_node_to_best(node_list)
- nodes_added = 0
- timeout = simgrid.get_clock() + common.FIND_NODE_TIMEOUT
- steps = steps + 1
- repeat
- task, err = data.comm:test()
- if task then
- if task.type == "FIND_NODE_ANSWER" and task.answer.destination == destination then
- routing_table_update(task.sender_id)
- for i,v in pairs(task.answer.nodes) do
- routing_table_update(v.id)
- end
- nodes_added = merge_answer(node_list,task.answer)
- else
- handle_task(task)
- end
- data.comm = simgrid.task.irecv(data.mailbox)
- elseif err then
- data.comm = simgrid.task.irecv(data.mailbox)
- else
- simgrid.process.sleep(1)
- end
-
- until answers >= queries or simgrid.get_clock() >= timeout
- if (#node_list.nodes > 0) then
- destination_found = (node_list.nodes[1].distance == 0)
- else
- destination_found = false
- end
- until destination_found or (nodes_added > 0 and answers == 0) or simgrid.get_clock() >= global_timeout or steps >= common.MAX_STEPS
- if destination_found then
- simgrid.debug("Find node on " .. destination .. " succedded")
- if counts then
- data.find_node_succedded = data.find_node_succedded + 1
- end
- else
- simgrid.debug("Find node on " .. destination .. " failed")
- if counts then
- data.find_node_failed = data.find_node_failed + 1
- end
- end
-
- return destination_found
-end
--- Sends a "FIND_NODE" request (task) to a node we know.
-function send_find_node(id, destination)
- simgrid.debug("Sending a FIND_NODE to " .. id .. " to find " .. destination);
-
- local task = simgrid.task.new("",0, common.COMM_SIZE)
- task.type = "FIND_NODE"
- task.sender_id = data.id
- task.destination = destination
-
- task:dsend(tostring(id))
-
-end
--- Sends a "FIND_NODE" request to the best "alpha" nodes in a node
--- list
-function send_find_node_to_best(node_list)
- destination = node_list.destination
- local i = 1
- while i <= common.ALPHA and i < #node_list.nodes do
- if data.id ~= node_list.nodes[i].id then
- send_find_node(node_list.nodes[i].id,destination)
- end
- i = i + 1
- end
- return i - 1
-end
--- Handles an incomming task
-function handle_task(task)
- routing_table_update(task.sender_id)
- if task.type == "FIND_NODE" then
- handle_find_node(task)
- elseif task.type == "PING" then
- handle_ping(task)
- end
-end
-function handle_find_node(task)
- simgrid.debug("Received a FIND_NODE from " .. task.sender_id)
- local answer = find_closest(task.destination)
- local task_answer = simgrid.task.new("",0, common.COMM_SIZE)
- task_answer.type = "FIND_NODE_ANSWER"
- task_answer.sender_id = data.id
- task_answer.destination = task.destination
- task_answer.answer = answer
- task_answer:dsend(tostring(task.sender_id))
-end
-function handle_ping(task)
- simgrid.info("Received a PING from " .. task.sender_id)
- local task_answer = simgrid.task.new("",0, common.COMM_SIZE)
- task_answer.type = "PING_ANSWER"
- task_answer.sender_id = data.id
- task_answer.destination = task.destination
- task_answer:dsend(tostring(task.sender_id))
-end
-function merge_answer(m1, m2)
- local nb_added = 0
- for i,v in pairs(m2.nodes) do
- table.insert(m1.nodes,v)
- nb_added = nb_added + 1
- end
- return nb_added
-end
-simgrid.platform(arg[1] or "../../platforms/platform.xml")
-simgrid.application(arg[2] or "kademlia.xml")
-simgrid.run()
+++ /dev/null
-$ lua kademlia.lua
-> [Boivin:node:(2) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 1 !
-> [Jean_Yves:node:(3) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 11 !
-> [TeX:node:(4) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 111 !
-> [Geoff:node:(5) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 1111 !
-> [Disney:node:(6) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 11111 !
-> [iRMX:node:(7) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 111111 !
-> [McGee:node:(8) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 1111111 !
-> [Gatien:node:(9) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 11111111 !
-> [Laroche:node:(10) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 111111111 !
-> [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 !
-> [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
-> [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
-> [Gatien:node:(9) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [iRMX:node:(7) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Disney:node:(6) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Jean_Yves:node:(3) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
-> [Geoff:node:(5) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Laroche:node:(10) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [TeX:node:(4) 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
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-
- <process host="Jacquelin" function="node">
- <argument value="0"/> <!-- my id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
-
- <process host="Boivin" function="node">
- <argument value="1"/> <!-- my id -->
- <argument value="0"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
-
- <process host="Jean_Yves" function="node">
- <argument value="11"/> <!-- my id -->
- <argument value="1"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
-
- <process host="TeX" function="node">
- <argument value="111"/> <!-- my id -->
- <argument value="11"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="Geoff" function="node">
- <argument value="1111"/> <!-- my id -->
- <argument value="111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="Disney" function="node">
- <argument value="11111"/> <!-- my id -->
- <argument value="1111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="iRMX" function="node">
- <argument value="111111"/> <!-- my id -->
- <argument value="11111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="McGee" function="node">
- <argument value="1111111"/> <!-- my id -->
- <argument value="111111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="Gatien" function="node">
- <argument value="11111111"/> <!-- my id -->
- <argument value="1111111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="Laroche" function="node">
- <argument value="111111111"/> <!-- my id -->
- <argument value="11111111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="Tanguay" function="node">
- <argument value="1111111111"/> <!-- my id -->
- <argument value="111111111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="Morin" function="node">
- <argument value="11111111111"/> <!-- my id -->
- <argument value="1111111111"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
- <process host="Ethernet" function="node">
- <argument value="11111111111"/> <!-- my id -->
- <argument value="0"/> <!-- known id -->
- <argument value ="900"/> <!-- deadline -->
- </process>
-</platform>
+++ /dev/null
--- Copyright (c) 2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- Routing table data
-routing_table = {
-buckets = {},
-}
--- Initialize the routing table
-function routing_table_init(id)
- routing_table.id = id
- -- Bucket initialization
- for i = 0,common.IDENTIFIER_SIZE do
- routing_table.buckets[i] = {id = i, set = {}, list = {}}
- end
-end
--- Returns an identifier which is in a specific bucket of a routing table
-function get_id_in_prefix(id, prefix)
- if id == 0 then
- return 0
- end
- local identifier = 1
- identifier = math.pow(identifier,prefix - 1)
- identifier = bxor(identifier,id)
- return identifier
-end
--- Returns the corresponding node prefix for a given id
-function get_node_prefix(id)
- for i = 0,32 do
- if is_integer(id / math.pow(2,i)) and (id / math.pow(2,i)) % 2 == 1 then
- return 31 - i
- end
- end
- return 0
-end
--- Finds the corresponding bucket in a routing table for a given identifier
-function find_bucket(id)
- local xor_number = bxor(id,routing_table.id)
- local prefix = get_node_prefix(xor_number)
- --simgrid.info("Prefix:" .. prefix .. " number:" .. xor_number)
- return routing_table.buckets[prefix]
-end
--- Updates the routing table with a new value.
-function routing_table_update(id)
- if id == routing_table.id then
- return
- end
- local bucket = find_bucket(id)
- if bucket.set[id] ~= nil then
- simgrid.debug("Updating " .. id .. " in my routing table")
- -- If the element is already in the bucket, we update it.
- table.remove(bucket.list,index_of(bucket.list,id))
- table.insert(bucket.list,id)
- else
- simgrid.debug("Insert " .. id .. " in my routing table in bucket " .. bucket.id)
- table.insert(bucket.list,id)
- bucket.set[id] = true
- end
-end
--- Returns the closest notes we know to a given id
-function find_closest(destination_id)
- local answer = {destination = destination_id, nodes = {}}
-
- local bucket = find_bucket(destination_id)
- for i,v in pairs(bucket.list) do
- table.insert(answer.nodes,{id = v, distance = bxor(v,destination_id)})
- end
-
- local i = 1
-
- while #answer.nodes < common.BUCKET_SIZE and ((bucket.id - i) >= 0 or (bucket.id + i) <= common.IDENTIFIER_SIZE) do
- -- Check the previous buckets
- if bucket.id - i >= 0 then
- local bucket_p = routing_table.buckets[bucket.id - i]
- for i,v in pairs(bucket_p.list) do
- table.insert(answer.nodes,{id = v, distance = bxor(v,destination_id)})
- end
- end
- -- Check the next buckets
- if bucket.id + i <= common.IDENTIFIER_SIZE then
- local bucket_n = routing_table.buckets[bucket.id + i]
- for i,v in pairs(bucket_n.list) do
- table.insert(answer.nodes,{id = v, distance = bxor(v,destination_id)})
- end
- end
- i = i + 1
- end
- -- Sort the list
- table.sort(answer.nodes, function(a,b) return a.distance < b.distance end)
- -- Trim the list
- while #answer.nodes > common.BUCKET_SIZE do
- table.remove(answer.nodes)
- end
-
- return answer
-end
+++ /dev/null
--- Copyright (c) 2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-function bxor (a,b)
- local r = 0
- for i = 0, 31 do
- local x = a / 2 + b / 2
- if x ~= math.floor (x) then
- r = r + 2^i
- end
- a = math.floor (a / 2)
- b = math.floor (b / 2)
- end
- return r
-end
-
-function index_of(table, o)
- for i,v in pairs(table) do
- if v == o then
- return i;
- end
- end
- return -1
-end
-function is_integer(x)
-return math.floor(x)==x
-end
\ No newline at end of file
+++ /dev/null
--- Copyright (c) 2011-2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-function Master(...)
-
- if select("#", ...) ~= 4 then
- error("Wrong number of arguments (got " .. #arg ..
- ", expected 4: nb_tasks comp_size comm_size slave_count)")
- end
-
- local nb_task, comp_size, comm_size, slave_count = select(1, ...)
- simgrid.info("Hello from lua, I'm the master")
-
-
- -- Dispatch the tasks
-
- for i = 1, nb_task do
- local task = simgrid.task.new("Task " .. i, comp_size, comm_size)
- local task_name = task:get_name()
- local alias = "slave " .. string.format("%d", i % slave_count)
- simgrid.info("Sending '" .. task_name .. "' to '" .. alias .."'")
- task:send(alias) -- C user data set to NULL
- simgrid.info("Done sending '".. task_name .. "' to '" .. alias .."'")
- end
-
- -- Sending Finalize Message To Others
-
- simgrid.info("All tasks have been dispatched. Let's tell everybody the computation is over.")
- for i = 0, slave_count - 1 do
- local alias = "slave " .. i
- simgrid.info("Sending finalize to '" .. alias .. "'")
- local finalize = simgrid.task.new("finalize", comp_size, comm_size)
- finalize:send(alias)
- end
- simgrid.info("Everything's done.")
-end -- end_of_master
-
+++ /dev/null
--- Copyright (c) 2011-2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-dofile 'master.lua'
-dofile 'slave.lua'
--- Simulation Code ----------------------------------------------------------
-
-require "simgrid"
-
-simgrid.platform(arg[1])
-simgrid.application(arg[2])
-simgrid.run()
-simgrid.info("Simulation's over. See you.")
--- end-of-master-slave
+++ /dev/null
-# compile the master_slave example
-
-# Later modify the commande and specify the platform and deployment path
-
-$ lua master_slave.lua ../../platforms/small_platform.xml ../deploy.xml
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Hello from lua, I'm the master
-> [Tremblay:Master:(1) 0.000000] [lua/INFO] Sending 'Task 1' to 'slave 1'
-> [Bourassa:Slave:(2) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mailbox: slave 0
-> [Jupiter:Slave:(3) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mailbox: slave 1
-> [Fafard:Slave:(4) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mailbox: slave 2
-> [Ginette:Slave:(5) 0.000000] [lua/INFO] Hello from lua, I'm a poor slave with mailbox: slave 3
-> [Jupiter:Slave:(3) 0.169155] [lua/INFO] Received task 'Task 1' on mailbox 'slave 1'
-> [Tremblay:Master:(1) 0.169155] [lua/INFO] Done sending 'Task 1' to 'slave 1'
-> [Tremblay:Master:(1) 0.169155] [lua/INFO] Sending 'Task 2' to 'slave 2'
-> [Fafard:Slave:(4) 0.327551] [lua/INFO] Received task 'Task 2' on mailbox 'slave 2'
-> [Tremblay:Master:(1) 0.327551] [lua/INFO] Done sending 'Task 2' to 'slave 2'
-> [Tremblay:Master:(1) 0.327551] [lua/INFO] Sending 'Task 3' to 'slave 3'
-> [Ginette:Slave:(5) 0.451283] [lua/INFO] Received task 'Task 3' on mailbox 'slave 3'
-> [Tremblay:Master:(1) 0.451283] [lua/INFO] Done sending 'Task 3' to 'slave 3'
-> [Tremblay:Master:(1) 0.451283] [lua/INFO] Sending 'Task 4' to 'slave 0'
-> [Bourassa:Slave:(2) 0.583902] [lua/INFO] Received task 'Task 4' on mailbox 'slave 0'
-> [Tremblay:Master:(1) 0.583902] [lua/INFO] Done sending 'Task 4' to 'slave 0'
-> [Tremblay:Master:(1) 0.583902] [lua/INFO] Sending 'Task 5' to 'slave 1'
-> [Jupiter:Slave:(3) 0.824497] [lua/INFO] Task 'Task 1' is done
-> [Fafard:Slave:(4) 0.982894] [lua/INFO] Task 'Task 2' is done
-> [Tremblay:Master:(1) 0.993652] [lua/INFO] Done sending 'Task 5' to 'slave 1'
-> [Tremblay:Master:(1) 0.993652] [lua/INFO] Sending 'Task 6' to 'slave 2'
-> [Jupiter:Slave:(3) 0.993652] [lua/INFO] Received task 'Task 5' on mailbox 'slave 1'
-> [Fafard:Slave:(4) 1.152048] [lua/INFO] Received task 'Task 6' on mailbox 'slave 2'
-> [Tremblay:Master:(1) 1.152048] [lua/INFO] Done sending 'Task 6' to 'slave 2'
-> [Tremblay:Master:(1) 1.152048] [lua/INFO] Sending 'Task 7' to 'slave 3'
-> [Ginette:Slave:(5) 1.482381] [lua/INFO] Task 'Task 3' is done
-> [Tremblay:Master:(1) 1.606113] [lua/INFO] Done sending 'Task 7' to 'slave 3'
-> [Tremblay:Master:(1) 1.606113] [lua/INFO] Sending 'Task 8' to 'slave 0'
-> [Ginette:Slave:(5) 1.606113] [lua/INFO] Received task 'Task 7' on mailbox 'slave 3'
-> [Bourassa:Slave:(2) 1.615000] [lua/INFO] Task 'Task 4' is done
-> [Jupiter:Slave:(3) 1.648994] [lua/INFO] Task 'Task 5' is done
-> [Tremblay:Master:(1) 1.747619] [lua/INFO] Done sending 'Task 8' to 'slave 0'
-> [Tremblay:Master:(1) 1.747619] [lua/INFO] Sending 'Task 9' to 'slave 1'
-> [Bourassa:Slave:(2) 1.747619] [lua/INFO] Received task 'Task 8' on mailbox 'slave 0'
-> [Fafard:Slave:(4) 1.807391] [lua/INFO] Task 'Task 6' is done
-> [Jupiter:Slave:(3) 1.916774] [lua/INFO] Received task 'Task 9' on mailbox 'slave 1'
-> [Tremblay:Master:(1) 1.916774] [lua/INFO] Done sending 'Task 9' to 'slave 1'
-> [Tremblay:Master:(1) 1.916774] [lua/INFO] Sending 'Task 10' to 'slave 2'
-> [Fafard:Slave:(4) 2.075171] [lua/INFO] Received task 'Task 10' on mailbox 'slave 2'
-> [Tremblay:Master:(1) 2.075171] [lua/INFO] Done sending 'Task 10' to 'slave 2'
-> [Tremblay:Master:(1) 2.075171] [lua/INFO] Sending 'Task 11' to 'slave 3'
-> [Jupiter:Slave:(3) 2.572116] [lua/INFO] Task 'Task 9' is done
-> [Ginette:Slave:(5) 2.637211] [lua/INFO] Task 'Task 7' is done
-> [Fafard:Slave:(4) 2.730513] [lua/INFO] Task 'Task 10' is done
-> [Tremblay:Master:(1) 2.760943] [lua/INFO] Done sending 'Task 11' to 'slave 3'
-> [Tremblay:Master:(1) 2.760943] [lua/INFO] Sending 'Task 12' to 'slave 0'
-> [Ginette:Slave:(5) 2.760943] [lua/INFO] Received task 'Task 11' on mailbox 'slave 3'
-> [Bourassa:Slave:(2) 2.778717] [lua/INFO] Task 'Task 8' is done
-> [Tremblay:Master:(1) 2.911336] [lua/INFO] Done sending 'Task 12' to 'slave 0'
-> [Tremblay:Master:(1) 2.911336] [lua/INFO] Sending 'Task 13' to 'slave 1'
-> [Bourassa:Slave:(2) 2.911336] [lua/INFO] Received task 'Task 12' on mailbox 'slave 0'
-> [Jupiter:Slave:(3) 3.080491] [lua/INFO] Received task 'Task 13' on mailbox 'slave 1'
-> [Tremblay:Master:(1) 3.080491] [lua/INFO] Done sending 'Task 13' to 'slave 1'
-> [Tremblay:Master:(1) 3.080491] [lua/INFO] Sending 'Task 14' to 'slave 2'
-> [Fafard:Slave:(4) 3.238888] [lua/INFO] Received task 'Task 14' on mailbox 'slave 2'
-> [Tremblay:Master:(1) 3.238888] [lua/INFO] Done sending 'Task 14' to 'slave 2'
-> [Tremblay:Master:(1) 3.238888] [lua/INFO] Sending 'Task 15' to 'slave 3'
-> [Jupiter:Slave:(3) 3.735833] [lua/INFO] Task 'Task 13' is done
-> [Ginette:Slave:(5) 3.792041] [lua/INFO] Task 'Task 11' is done
-> [Fafard:Slave:(4) 3.894230] [lua/INFO] Task 'Task 14' is done
-> [Tremblay:Master:(1) 3.915773] [lua/INFO] Done sending 'Task 15' to 'slave 3'
-> [Tremblay:Master:(1) 3.915773] [lua/INFO] Sending 'Task 16' to 'slave 0'
-> [Ginette:Slave:(5) 3.915773] [lua/INFO] Received task 'Task 15' on mailbox 'slave 3'
-> [Bourassa:Slave:(2) 3.942434] [lua/INFO] Task 'Task 12' is done
-> [Tremblay:Master:(1) 4.075053] [lua/INFO] Done sending 'Task 16' to 'slave 0'
-> [Tremblay:Master:(1) 4.075053] [lua/INFO] Sending 'Task 17' to 'slave 1'
-> [Bourassa:Slave:(2) 4.075053] [lua/INFO] Received task 'Task 16' on mailbox 'slave 0'
-> [Jupiter:Slave:(3) 4.244208] [lua/INFO] Received task 'Task 17' on mailbox 'slave 1'
-> [Tremblay:Master:(1) 4.244208] [lua/INFO] Done sending 'Task 17' to 'slave 1'
-> [Tremblay:Master:(1) 4.244208] [lua/INFO] Sending 'Task 18' to 'slave 2'
-> [Fafard:Slave:(4) 4.402604] [lua/INFO] Received task 'Task 18' on mailbox 'slave 2'
-> [Tremblay:Master:(1) 4.402604] [lua/INFO] Done sending 'Task 18' to 'slave 2'
-> [Tremblay:Master:(1) 4.402604] [lua/INFO] Sending 'Task 19' to 'slave 3'
-> [Jupiter:Slave:(3) 4.899550] [lua/INFO] Task 'Task 17' is done
-> [Ginette:Slave:(5) 4.946871] [lua/INFO] Task 'Task 15' is done
-> [Fafard:Slave:(4) 5.057947] [lua/INFO] Task 'Task 18' is done
-> [Tremblay:Master:(1) 5.070603] [lua/INFO] Done sending 'Task 19' to 'slave 3'
-> [Tremblay:Master:(1) 5.070603] [lua/INFO] Sending 'Task 20' to 'slave 0'
-> [Ginette:Slave:(5) 5.070603] [lua/INFO] Received task 'Task 19' on mailbox 'slave 3'
-> [Bourassa:Slave:(2) 5.106151] [lua/INFO] Task 'Task 16' is done
-> [Tremblay:Master:(1) 5.238770] [lua/INFO] Done sending 'Task 20' to 'slave 0'
-> [Tremblay:Master:(1) 5.238770] [lua/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Tremblay:Master:(1) 5.238770] [lua/INFO] Sending finalize to 'slave 0'
-> [Bourassa:Slave:(2) 5.238770] [lua/INFO] Received task 'Task 20' on mailbox 'slave 0'
-> [Ginette:Slave:(5) 6.101701] [lua/INFO] Task 'Task 19' is done
-> [Bourassa:Slave:(2) 6.269868] [lua/INFO] Task 'Task 20' is done
-> [Tremblay:Master:(1) 6.402487] [lua/INFO] Sending finalize to 'slave 1'
-> [Bourassa:Slave:(2) 6.402487] [lua/INFO] Got finalize message
-> [Bourassa:Slave:(2) 6.402487] [lua/INFO] I'm done. See you!
-> [Jupiter:Slave:(3) 6.571641] [lua/INFO] Got finalize message
-> [Jupiter:Slave:(3) 6.571641] [lua/INFO] I'm done. See you!
-> [Tremblay:Master:(1) 6.571641] [lua/INFO] Sending finalize to 'slave 2'
-> [Fafard:Slave:(4) 6.730038] [lua/INFO] Got finalize message
-> [Fafard:Slave:(4) 6.730038] [lua/INFO] I'm done. See you!
-> [Tremblay:Master:(1) 6.730038] [lua/INFO] Sending finalize to 'slave 3'
-> [Ginette:Slave:(5) 6.853770] [lua/INFO] Got finalize message
-> [Ginette:Slave:(5) 6.853770] [lua/INFO] I'm done. See you!
-> [Tremblay:Master:(1) 6.853770] [lua/INFO] Everything's done.
-> [6.853770] [lua/INFO] Simulation's over. See you.
+++ /dev/null
--- Copyright (c) 2011-2012, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-function Slave(...)
-
- if select("#", ...) ~= 1 then
- error("Wrong number of arguments (got " .. #arg .. ", expected 1: slave_id)")
- end
-
- local my_mailbox = "slave " .. select(1, ...)
- simgrid.info("Hello from lua, I'm a poor slave with mailbox: " .. my_mailbox)
-
- while true do
-
- local task = simgrid.task.recv(my_mailbox)
- local task_name = task:get_name()
- if (task_name == "finalize") then
- simgrid.info("Got finalize message")
- break
- end
- simgrid.info("Received task '" .. task_name .. "' on mailbox '" .. my_mailbox .. "'")
- task:execute()
- simgrid.info("Task '" .. task_name .. "' is done")
- end
-
- simgrid.info("I'm done. See you!")
-end -- end_of_slave
-
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-dofile 'sender.lua'
-dofile 'receiver.lua'
-require "simgrid"
-
-simgrid.platform("../../platforms/small_platform.xml")
-simgrid.application("quicksort_deployment.xml")
-simgrid.run()
-simgrid.info("Simulation's over.See you.")
-
+++ /dev/null
-# compile the mult_matrix example
-
-# Later modify the commande and specify the platform and deployment path
-
-! output sort 19
-$ lua mult_matrix.lua "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [ 0.000000] (1:Sender@Tremblay) Hello From Sender
-> [ 0.000000] (1:Sender@Tremblay) Argc=4 (should be 4)
-> [ 0.000000] (1:Sender@Tremblay) Sending matrix_task to Jupiter
-> [ 0.000000] (2:Receiver@Jupiter) Hello From Receiver
-> [ 0.000000] (2:Receiver@Jupiter) Receiving Task from Tremblay
-> [ 0.034028] (2:Receiver@Jupiter) Calcul is done ... Bye
-> [ 0.034028] (1:Sender@Tremblay) Got the Multiplication result ...Bye
-> [ 0.034028] (0:@) Simulation's over.See you.
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
- <process host="Tremblay" function="Sender">
- <argument value ="Jupiter"/>
- <argument value="5000000"/>
- <argument value="100000"/>
- <argument value="Receiver"/> <!--will be used as a mailbox alias-->
- </process>
- <process host="Jupiter" function="Receiver">
- <argument value="Tremblay"/>
- <argument value="Sender"/> <!--will be used as a mailbox alias-->
- </process>
-</platform>
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-function Receiver(...)
-
- simgrid.info("Hello From Receiver")
- local sender = simgrid.host.get_by_name(select(1, ...))
- local send_alias = select(2, ...)
- local recv_alias = "Receiver"
- simgrid.info("Receiving Task from " .. simgrid.host.name(sender))
- local task = simgrid.task.recv(recv_alias)
- local mm = mmult(task['size'], task['size'], task['matrix_1'], task['matrix_2'])
- --mprint(task['size'], task['size'], mm)
- task['matrix_res'] = mm
- simgrid.info("Calcul is done ... Bye")
-end
-
-local n = tonumber((arg and arg[1]) or 1)
-function mkmatrix(rows, cols)
- local count = 1
- local mx = {}
- for i = 0, (rows - 1) do
- local row = {}
- for j = 0, (cols - 1) do
- row[j] = count
- count = count + 1
- end
- mx[i] = row
- end
- return mx
-end
-
-function mmult(rows, cols, m1, m2)
- local m3 = {}
- for i = 0, (rows - 1) do
- m3[i] = {}
- for j = 0, (cols - 1) do
- local rowj = 0
- for k = 0, (cols - 1) do
- rowj = rowj + m1[i][k] * m2[k][j]
- end
- m3[i][j] = rowj
- end
- end
- return m3
-end
-
-function mprint(rows, cols, m)
- for i = 0, (cols - 1) do
- for j = 0, (rows - 1 )do
- print(m[i][j])
- end
- end
-end
-
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-function Sender(...)
-
- simgrid.info("Hello From Sender")
- local receiver = simgrid.host.get_by_name(select(1, ...))
- local task_comp = select(2, ...)
- local task_comm = select(3, ...)
- local rec_alias = select(4, ...)
-
- local size = 4
- local m1 = mkmatrix(size, size)
- local m2 = mkmatrix(size, size)
-
- if select("#", ...) ~= 4 then
- error("Argc should be 4")
- end
- simgrid.info("Argc=" .. select("#", ...) .. " (should be 4)")
-
- -- Sending Task
- local task = simgrid.task.new("matrix_task", task_comp, task_comm)
- task['matrix_1'] = m1
- task['matrix_2'] = m2
- task['size'] = size
- simgrid.info("Sending " .. simgrid.task.get_name(task) .. " to " .. simgrid.host.name(receiver))
- simgrid.task.send(task, rec_alias)
- simgrid.info("Got the Multiplication result ...Bye")
-end
-
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
---Master Function
-function Master(...)
-
-simgrid.info("Hello from lua, I'm the master")
-for i,v in ipairs(arg) do
- simgrid.info("Got "..v)
-end
-
-nb_task = arg[1];
-comp_size = arg[2];
-comm_size = arg[3];
-slave_count = arg[4]
-
-if (#arg ~= 4) then
- error("Argc should be 4");
-end
-simgrid.info("Argc="..(#arg).." (should be 4)")
-
--- Dispatch the tasks
-
-for i=1,nb_task do
- tk = simgrid.task.new("Task "..i,comp_size,comm_size);
- alias = "slave "..(i%slave_count);
- simgrid.info("Master sending '" .. simgrid.task.get_name(tk) .."' To '" .. alias .."'");
- simgrid.task.send(tk,alias); -- C user data set to NULL
- simgrid.info("Master done sending '".. simgrid.task.get_name(tk) .."' To '" .. alias .."'");
-end
-
--- Sending Finalize Message To Others
-
-simgrid.info("Master: All tasks have been dispatched. Let's tell everybody the computation is over.");
-for i=0,slave_count-1 do
- alias = "slave "..i;
- simgrid.info("Master: sending finalize to "..alias);
- finalize = simgrid.task.new("finalize",comp_size,comm_size);
- simgrid.task.send(finalize,alias)
-end
- simgrid.info("Master: Everything's done.");
-end
-
--- end_of_master
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- Slave Function ---------------------------------------------------------
-function Slave(...)
-
-local my_mailbox="slave "..arg[1]
-simgrid.info("Hello from lua, I'm a poor slave with mbox: "..my_mailbox)
-
-while true do
-
- local tk = simgrid.task.recv(my_mailbox);
- if (simgrid.task.get_name(tk) == "finalize") then
- simgrid.info("Slave '" ..my_mailbox.."' got finalize msg");
- break
- end
- --local tk_name = simgrid.task.get_name(tk)
- simgrid.info("Slave '" ..my_mailbox.."' processing "..simgrid.task.get_name(tk))
- simgrid.task.execute(tk)
- simgrid.info("Slave '" ..my_mailbox.."': task "..simgrid.task.get_name(tk) .. " done")
-end -- while
-
-simgrid.info("Slave '" ..my_mailbox.."': I'm Done . See You !!");
-
-end
-
--- end_of_slave
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- Simulation Code ----------------------------------------------------------
-
-require "simgrid"
-if (#arg == 2) then
- dofile (arg[1])
- dofile (arg[2])
-else
- dofile "splay_platform.lua"
- dofile "splay_deploy_masterslave.lua"
-end
-
-simgrid.run()
-simgrid.info("Simulation's over.See you.")
-simgrid.clean()
-
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
- dofile "master.lua"
- dofile "slave.lua"
- --Set Application
- simgrid.host.set_function{host="Splayd_1",fct="Master",args="20,550000000,1000000,4"};
- simgrid.host.set_function{host="Splayd_5",fct="Slave",args="0"};
- simgrid.host.set_function{host="Splayd_2",fct="Slave",args="1"};
- simgrid.host.set_function{host="Splayd_3",fct="Slave",args="2"};
- simgrid.host.set_function{host="Splayd_4",fct="Slave",args="3"};
-
- --Save Application
- simgrid.msg_register_application();
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-require "simgrid"
-
- simgrid.AS.new{id="AS0",mode="Full"};
-
- -- create 5 Splayd (Hosts)
- for i=0,5,1 do
- simgrid.AS.addHost{AS="AS0",id="Splayd_"..i,speed= 7000000+i*1000000}
- end
-
- -- create Links
- for i=10,0,-1 do
- simgrid.AS.addLink{AS="AS0",id=i,bandwidth=252750+ i*768,lat=0.000270544+i*0.087};
- end
- -- simgrid.route.new(src_id,des_id,links_nb,links_list)
- simgrid.AS.addRoute("AS0","Splayd_1","Splayd_2",{"1"});
- simgrid.AS.addRoute("AS0","Splayd_1","Splayd_3",{"0","1","2","3","4","8"});
- simgrid.AS.addRoute("AS0","Splayd_1","Splayd_4",{"3","4","5"});
- simgrid.AS.addRoute("AS0","Splayd_1","Splayd_5",{"0","1","3","2","4","6","7"});
-
- simgrid.AS.addRoute("AS0","Splayd_2","Splayd_1",{"1"});
- simgrid.AS.addRoute("AS0","Splayd_2","Splayd_3",{"0","1","2","3","4","8","9"});
- simgrid.AS.addRoute("AS0","Splayd_2","Splayd_4",{"3","4","5","9"});
- simgrid.AS.addRoute("AS0","Splayd_2","Splayd_5",{"0","1","2","3","4","6","7","9"});
-
- simgrid.AS.addRoute("AS0","Splayd_3","Splayd_1",{"0","1","2","3","4","8"});
- simgrid.AS.addRoute("AS0","Splayd_3","Splayd_2",{"0","1","2","3","4","8","9"});
- simgrid.AS.addRoute("AS0","Splayd_3","Splayd_4",{"0","1","2","5","8"});
- simgrid.AS.addRoute("AS0","Splayd_3","Splayd_5",{"6","7","8"});
-
- simgrid.AS.addRoute("AS0","Splayd_4","Splayd_1",{"3","4","5"});
- simgrid.AS.addRoute("AS0","Splayd_4","Splayd_2",{"3","4","5","9"});
- simgrid.AS.addRoute("AS0","Splayd_4","Splayd_3",{"0","1","2","5","8"});
- simgrid.AS.addRoute("AS0","Splayd_4","Splayd_5",{"0","1","2","5","6","7"});
-
- simgrid.AS.addRoute("AS0","Splayd_5","Splayd_1",{"0","1","3","2","4","6","7"});
- simgrid.AS.addRoute("AS0","Splayd_5","Splayd_2",{"0","1","2","3","4","6","7","9"});
- simgrid.AS.addRoute("AS0","Splayd_5","Splayd_3",{"6","7","8"});
- simgrid.AS.addRoute("AS0","Splayd_5","Splayd_4",{"0","1","2","5","6","7"});
-
- --Save Platform
- simgrid.msg_register_platform();
-
-
-
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
- <process host="Tremblay" function="set_global_string">
- <argument value="Calling set_global_string() from Tremblay"/>
- </process>
- <process host="Bourassa" function="replace">
- <argument value="Calling replace() from Bourassa"/>
- </process>
- <process host="Jupiter" function="please_dont_replace_me">
- <argument value="Calling please_dont_replace_me() from Jupiter"/>
- </process>
-</platform>
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- This code creates 3 simgrid processes and verifies that the global values
--- in each Lua world are correctly cloned from maestro and become different
-
-require("simgrid")
-
-global_string = "A global string set by maestro"
-
--- Assigns to the global string the first argument and prints it
-function set_global_string(...)
-
- global_string = select(1, ...)
- simgrid.info("Changing the global string")
- print_global()
-end
-
--- Replaces the function please_dont_change_me() by set_global_string()
--- and calls it
-function replace(...)
-
- simgrid.info("Overwriting function please_dont_replace_me()")
- please_dont_replace_me = set_global_string
- please_dont_replace_me(...)
-end
-
--- Shows a hello message and prints the global string
-function please_dont_replace_me(...)
-
- simgrid.info("Hello from please_dont_replace_me(). I'm lucky, I still exist in this state.")
- print_global()
-end
-
--- Prints the value of global_string
-function print_global()
-
- simgrid.info("Global string is '" .. global_string .. "'")
-end
-
-print_global()
-
-simgrid.platform("../../platforms/small_platform.xml")
-simgrid.application("deployment_duplicated_globals.xml")
-simgrid.run()
-
+++ /dev/null
-# Checks that global values are correctly duplicated in Lua processes
-
-$ lua duplicated_globals.lua
-> [0.000000] [lua/INFO] Global string is 'A global string set by maestro'
-> [Tremblay:set_global_string:(1) 0.000000] [lua/INFO] Changing the global string
-> [Tremblay:set_global_string:(1) 0.000000] [lua/INFO] Global string is 'Calling set_global_string() from Tremblay'
-> [Bourassa:replace:(2) 0.000000] [lua/INFO] Overwriting function please_dont_replace_me()
-> [Bourassa:replace:(2) 0.000000] [lua/INFO] Changing the global string
-> [Bourassa:replace:(2) 0.000000] [lua/INFO] Global string is 'Calling replace() from Bourassa'
-> [Jupiter:please_dont_replace_me:(3) 0.000000] [lua/INFO] Hello from please_dont_replace_me(). I'm lucky, I still exist in this state.
-> [Jupiter:please_dont_replace_me:(3) 0.000000] [lua/INFO] Global string is 'A global string set by maestro'
+++ /dev/null
-PERIODICITY 10
- 0 0.5
-10 0.5
-20 1.00
-30 0.5
-40 0.5
-50 0.5
-60 0.5
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
---Master Function
-function Master(...)
-
-simgrid.info("Hello from lua, I'm the master")
-for i,v in ipairs(arg) do
- simgrid.info("Got "..v)
-end
-
-prop_value = simgrid.host.get_prop_value(simgrid.host.self(),"peace");
-simgrid.info("Prop Value >>> ".. prop_value);
-
-nb_task = arg[1];
-comp_size = arg[2];
-comm_size = arg[3];
-slave_count = arg[4]
-
-if (#arg ~= 4) then
- error("Argc should be 4");
-end
-simgrid.info("Argc="..(#arg).." (should be 4)")
-
--- Dispatch the tasks
-
-for i=1,nb_task do
- tk = simgrid.task.new("Task "..i,comp_size,comm_size);
- alias = "slave "..(i%slave_count);
- -- Set Trace Category
- simgrid.Trace.setTaskCategory(tk,"compute");
- simgrid.info("Master sending '" .. simgrid.task.get_name(tk) .."' To '" .. alias .."'");
- simgrid.task.send(tk,alias); -- C user data set to NULL
- simgrid.info("Master done sending '".. simgrid.task.get_name(tk) .."' To '" .. alias .."'");
-end
-
--- Sending Finalize Message To Others
-
-simgrid.info("Master: All tasks have been dispatched. Let's tell everybody the computation is over.");
-for i=0,slave_count-1 do
- alias = "slave "..i;
- simgrid.info("Master: sending finalize to "..alias);
- finalize = simgrid.task.new("finalize",comp_size,comm_size);
- --set Trace Category
- simgrid.Trace.setTaskCategory(finalize,"finalize");
- simgrid.task.send(finalize,alias);
-end
- simgrid.info("Master: Everything's done.");
-end
-
---end of master
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
-dofile 'master.lua'
-dofile 'slave.lua'
-
-require "simgrid"
--- Declaring the simulation tracing
-simgrid.Trace.start();
--- Declaring tracing categories
-simgrid.Trace.category("compute");
---:
-simgrid.Trace.category("finalize");
-
-if (#arg == 2) then
-simgrid.platform(arg[1])
-simgrid.application(arg[2])
-else
-simgrid.platform("../../msg/small_platform.xml")
-simgrid.application("../deploy.xml")
-end
-
-simgrid.run()
-simgrid.info("Simulation's over.See you.")
-simgrid.Trace.finish()
-
+++ /dev/null
-%EventDef PajeDefineContainerType 0
-% Alias string
-% ContainerType string
-% Name string
-%EndEventDef
-%EventDef PajeDefineStateType 1
-% Alias string
-% ContainerType string
-% Name string
-%EndEventDef
-%EventDef PajeDefineEntityValue 2
-% Alias string
-% EntityType string
-% Name string
-%EndEventDef
-%EventDef PajeDefineEventType 3
-% Alias string
-% EntityType string
-% Name string
-%EndEventDef
-%EventDef PajeDefineLinkType 4
-% Alias string
-% ContainerType string
-% SourceContainerType string
-% DestContainerType string
-% Name string
-%EndEventDef
-%EventDef PajeCreateContainer 5
-% Time date
-% Alias string
-% Type string
-% Container string
-% Name string
-%EndEventDef
-%EventDef PajeDestroyContainer 9
-% Time date
-% Type string
-% Container string
-%EndEventDef
-%EventDef PajeSetState 6
-% Time date
-% EntityType string
-% Container string
-% Value string
-%EndEventDef
-%EventDef PajePopState 8
-% Time date
-% EntityType string
-% Container string
-%EndEventDef
-%EventDef PajeStartLink 12
-% Time date
-% EntityType string
-% Container string
-% Value string
-% SourceContainer string
-% Key string
-%EndEventDef
-%EventDef PajeEndLink 13
-% Time date
-% EntityType string
-% Container string
-% Value string
-% DestContainer string
-% Key string
-%EndEventDef
-%EventDef PajePushState 19
-% Time date
-% EntityType string
-% Container string
-% Value string
-%EndEventDef
-%EventDef PajeSetVariable 22
-% Time date
-% EntityType string
-% Container string
-% Value string
-%EndEventDef
-%EventDef PajeAddVariable 23
-% Time date
-% EntityType string
-% Container string
-% Value string
-%EndEventDef
-%EventDef PajeSubVariable 24
-% Time date
-% EntityType string
-% Container string
-% Value string
-%EndEventDef
-%EventDef PajeDefineVariableType 25
-% Alias string
-% ContainerType string
-% Name string
-%EndEventDef
-%EventDef PajeDefineVariableType 21
-% Alias string
-% ContainerType string
-% Name string
-% Color color
-%EndEventDef
-%EventDef PajeStartLink 26
-% Time date
-% EntityType string
-% Container string
-% Value string
-% SourceContainer string
-% Key string
-% Volume string
-%EndEventDef
-%EventDef PajeNewEvent 27
-% Time date
-% EntityType string
-% Container string
-% Value string
-%EndEventDef
-0 PLATFORM 0 platform
-0 HOST PLATFORM HOST
-0 LINK PLATFORM LINK
-5 0.000000 platform PLATFORM 0 simgrid-platform
-0 user_type 0 user_type
-5 0.000000 compute user_type 0 compute
-5 0.000000 finalize user_type 0 finalize
-5 0.000000 Tremblay HOST platform Tremblay
-5 0.000000 Jupiter HOST platform Jupiter
-5 0.000000 Fafard HOST platform Fafard
-5 0.000000 Ginette HOST platform Ginette
-5 0.000000 Bourassa HOST platform Bourassa
-5 0.000000 0x9ba7920 LINK platform 6
-5 0.000000 0x9ba7d40 LINK platform 11
-5 0.000000 0x9ba8160 LINK platform 3
-5 0.000000 0x9ba8580 LINK platform 7
-5 0.000000 0x9ba89a0 LINK platform 9
-5 0.000000 0x9ba8dc0 LINK platform 12
-5 0.000000 0x9ba91e0 LINK platform 2
-5 0.000000 0x9ba9600 LINK platform 8
-5 0.000000 0x9ba9a20 LINK platform 1
-5 0.000000 0x9ba9e40 LINK platform 4
-5 0.000000 0x9baa260 LINK platform 0
-5 0.000000 0x9baa680 LINK platform 10
-5 0.000000 0x9baaaa0 LINK platform 5
-27 0.000000 source 0x9ba89a0 Tremblay
-27 0.000000 destination 0x9ba89a0 Jupiter
-27 0.000000 source 0x9ba89a0 Jupiter
-27 0.000000 destination 0x9ba89a0 Tremblay
-9 7.499872 HOST Fafard
-9 7.499872 HOST Tremblay
-9 7.499872 HOST Bourassa
-9 7.499872 HOST Jupiter
-9 7.499872 HOST Ginette
-9 7.499872 LINK 0x9ba91e0
-9 7.499872 LINK 0x9ba8160
-9 7.499872 LINK 0x9ba9a20
-9 7.499872 LINK 0x9baa680
-9 7.499872 LINK 0x9ba89a0
-9 7.499872 LINK 0x9ba7920
-9 7.499872 LINK 0x9ba8dc0
-9 7.499872 LINK 0x9baaaa0
-9 7.499872 LINK 0x9ba8580
-9 7.499872 LINK 0x9baa260
-9 7.499872 LINK 0x9ba7d40
-9 7.499872 LINK 0x9ba9e40
-9 7.499872 LINK 0x9ba9600
+++ /dev/null
--- Copyright (c) 2011, 2014. The SimGrid Team.
--- All rights reserved.
-
--- This program is free software; you can redistribute it and/or modify it
--- under the terms of the license (GNU LGPL) which comes with this package.
-
--- Slave Function ---------------------------------------------------------
-function Slave(...)
-
-local my_mailbox="slave "..arg[1]
-simgrid.info("Hello from lua, I'm a poor slave with mbox: "..my_mailbox)
-
-while true do
-
- local tk = simgrid.task.recv(my_mailbox);
- if (simgrid.task.get_name(tk) == "finalize") then
- simgrid.info("Slave '" ..my_mailbox.."' got finalize msg");
- break
- end
- --local tk_name = simgrid.task.get_name(tk)
- simgrid.info("Slave '" ..my_mailbox.."' processing "..simgrid.task.get_name(tk))
- simgrid.task.execute(tk)
- simgrid.info("Slave '" ..my_mailbox.."': task "..simgrid.task.get_name(tk) .. " done")
-end -- while
-
-simgrid.info("Slave '" ..my_mailbox.."': I'm Done . See You !!");
-
-end
-
+++ /dev/null
-/* Copyright (c) 2010, 2012-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "lua_private.h"
-#include <lauxlib.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_comm, bindings, "Lua bindings (comm module)");
-
-#define COMM_MODULE_NAME "simgrid.comm"
-
-/* ********************************************************************************* */
-/* simgrid.comm API */
-/* ********************************************************************************* */
-
-/**
- * \brief Ensures that a value in the stack is a comm and returns it.
- * \param L a Lua state
- * \param index an index in the Lua stack
- * \return the C comm
- */
-msg_comm_t sglua_check_comm(lua_State* L, int index)
-{
- msg_comm_t comm = *((msg_comm_t*) luaL_checkudata(L, index, COMM_MODULE_NAME));
- return comm;
-}
-
-/**
- * \brief Pushes a comm onto the stack.
- * \param L a Lua state
- * \param comm a comm
- */
-void sglua_push_comm(lua_State* L, msg_comm_t comm)
-{
- msg_comm_t* userdata = (msg_comm_t*) lua_newuserdata(L, sizeof(msg_comm_t));
- /* comm */
- *userdata = comm;
- luaL_getmetatable(L, COMM_MODULE_NAME);
- /* comm mt */
- lua_setmetatable(L, -2);
- /* comm */
-}
-
-/**
- * \brief Blocks the current process until a communication is finished.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (comm): a comm (previously created by isend or irecv)
- * - Argument 2 (number, optional): timeout (default is no timeout)
- * - Return values (task or nil + string): in case of success, returns the task
- * received if you are the receiver and nil if you are the sender. In case of
- * failure, returns nil plus an error string.
- */
-static int l_comm_wait(lua_State* L) {
-
- msg_comm_t comm = sglua_check_comm(L, 1);
- double timeout = -1;
- if (lua_gettop(L) >= 2) {
- timeout = luaL_checknumber(L, 2);
- }
- /* comm ... */
- msg_error_t res = MSG_comm_wait(comm, timeout);
-
- if (res == MSG_OK) {
- msg_task_t task = MSG_comm_get_task(comm);
- if (MSG_task_get_sender(task) == MSG_process_self()) {
- /* I'm the sender */
- return 0;
- }
- else {
- /* I'm the receiver: find the Lua task from the C task */
- sglua_task_unregister(L, task);
- /* comm ... task */
- return 1;
- }
- }
- else {
- /* the communication has failed */
- lua_pushnil(L);
- /* comm ... nil */
- lua_pushstring(L, sglua_get_msg_error(res));
- /* comm ... nil error */
- return 2;
- }
-}
-
-/**
- * @brief Returns whether a communication is finished.
- *
- * Unlike wait(), This function always returns immediately.
- *
- * - Argument 1 (comm): a comm (previously created by isend or irecv)
- * - Return values (task/boolean or nil + string): if the communication is not
- * finished, return false. If the communication is finished and was successful,
- * returns the task received if you are the receiver or true if you are the
- * sender. If the communication is finished and has failed, returns nil
- * plus an error string.
- */
-static int l_comm_test(lua_State* L) {
-
- msg_comm_t comm = sglua_check_comm(L, 1);
- /* comm ... */
- if (!MSG_comm_test(comm)) {
- /* not finished yet */
- lua_pushboolean(L, 0);
- /* comm ... false */
- return 1;
- }
- else {
- /* finished but may have failed */
- msg_error_t res = MSG_comm_get_status(comm);
-
- if (res == MSG_OK) {
- msg_task_t task = MSG_comm_get_task(comm);
- if (MSG_task_get_sender(task) == MSG_process_self()) {
- /* I'm the sender */
- lua_pushboolean(L, 1);
- /* comm ... true */
- return 1;
- }
- else {
- /* I'm the receiver: find the Lua task from the C task*/
- sglua_task_unregister(L, task);
- /* comm ... task */
- return 1;
- }
- }
- else {
- /* the communication has failed */
- lua_pushnil(L);
- /* comm ... nil */
- lua_pushstring(L, sglua_get_msg_error(res));
- /* comm ... nil error */
- return 2;
- }
- }
-}
-
-static const luaL_Reg comm_functions[] = {
- {"wait", l_comm_wait},
- {"test", l_comm_test},
- /* TODO waitany, testany */
- {NULL, NULL}
-};
-
-/**
- * \brief Finalizes a comm userdata.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (userdata): a comm
- */
-static int l_comm_gc(lua_State* L)
-{
- /* ctask */
- msg_comm_t comm = *((msg_comm_t*) luaL_checkudata(L, 1, COMM_MODULE_NAME));
- MSG_comm_destroy(comm);
- return 0;
-}
-
-/**
- * \brief Metamethods of the comm userdata.
- */
-static const luaL_Reg comm_meta[] = {
- {"__gc", l_comm_gc},
- {NULL, NULL}
-};
-
-/**
- * \brief Registers the comm functions into the table simgrid.comm.
- *
- * Also initialize the metatable of the comm userdata type.
- *
- * \param L a lua state
- */
-void sglua_register_comm_functions(lua_State* L)
-{
- /* create a table simgrid.comm and fill it with com functions */
- lua_getglobal(L, "simgrid"); /* simgrid */
- luaL_newlib(L, comm_functions); /* simgrid simgrid.comm */
-
- /* create the metatable for comm, add it to the Lua registry */
- luaL_newmetatable(L, COMM_MODULE_NAME); /* simgrid simgrid.comm mt */
-
- /* fill the metatable */
- luaL_setfuncs(L, comm_meta, 0); /* simgrid simgrid.comm mt */
-
- /**
- * Copy the table and push it onto the stack.
- * Required for the lua_setfield call below.
- */
- lua_pushvalue(L, -2); /* simgrid simgrid.comm mt simgrid.comm */
-
- /* metatable.__index = simgrid.comm
- * we put the comm functions inside the comm userdata itself:
- * this allows to write my_comm:method(args) for
- * simgrid.comm.method(my_comm, args) */
- lua_setfield(L, -2, "__index"); /* simgrid simgrid.comm mt */
-
- lua_setmetatable(L, -2); /* simgrid simgrid.comm */
- lua_setfield(L, -1, "comm"); /* simgrid */
- lua_pop(L, 1); /* -- */
-}
-
lua_pop(L, 1); /* -- */
}
+void sglua_register_routing_constants(lua_State* L)
+{
+ lua_getglobal(L, "simgrid"); /* simgrid */
+ lua_newtable(L); /* simgrid simgrid.routing */
+
+ lua_pushstring(L, "Cluster"); /* simgrid simgrid.routing Cluster */
+ lua_setfield(L, -2, "CLUSTER"); /* simgrid simgrid.routing */
+
+ lua_pushstring(L, "Dijkstra"); /* simgrid simgrid.routing Dijkstra */
+ lua_setfield(L, -2, "DIJKSTRA"); /* simgrid simgrid.routing */
+
+ lua_pushstring(L, "DijkstraCache"); /* simgrid simgrid.routing DijkstraCache */
+ lua_setfield(L, -2, "DIJKSTRA_CACHE"); /* simgrid simgrid.routing */
+
+ lua_pushstring(L, "Floyd"); /* simgrid simgrid.routing Floyd */
+ lua_setfield(L, -2, "FLOYD"); /* simgrid simgrid.routing */
+
+ lua_pushstring(L, "Full"); /* simgrid simgrid.routing Full */
+ lua_setfield(L, -2, "FULL"); /* simgrid simgrid.routing */
+
+ lua_pushstring(L, "None"); /* simgrid simgrid.routing None */
+ lua_setfield(L, -2, "NONE"); /* simgrid simgrid.routing */
+
+ lua_pushstring(L, "Vivaldi"); /* simgrid simgrid.routing Vivaldi */
+ lua_setfield(L, -2, "FULL"); /* simgrid simgrid.routing */
+
+ lua_setfield(L, -2, "routing"); /* simgrid */
+
+ lua_pop(L, 1); /* -- */
+}
#include "simgrid_lua.h"
#include "simgrid/msg.h"
-void sglua_register_task_functions(lua_State* L);
-msg_task_t sglua_check_task(lua_State* L, int index);
-void sglua_task_register(lua_State* L);
-void sglua_task_unregister(lua_State* L, msg_task_t task);
-
-void sglua_register_comm_functions(lua_State* L);
-msg_comm_t sglua_check_comm(lua_State* L, int index);
-void sglua_push_comm(lua_State* L, msg_comm_t comm);
-
void sglua_register_host_functions(lua_State* L);
msg_host_t sglua_check_host(lua_State* L, int index);
-void sglua_register_process_functions(lua_State* L);
-
void sglua_register_platf_functions(lua_State* L);
const char* sglua_get_msg_error(msg_error_t err);
+++ /dev/null
-/* Copyright (c) 2010, 2012-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/* SimGrid Lua bindings */
-
-#include "lua_private.h"
-#include <lauxlib.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_process, bindings, "Lua Bindings (process module)");
-
-#define PROCESS_MODULE_NAME "simgrid.process"
-
-/* ********************************************************************************* */
-/* simgrid.process API */
-/* ********************************************************************************* */
-
-/**
- * \brief Makes the current process sleep for a while.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (number): duration of the sleep
- * - Return value (nil or string): nil in everything went ok, or a string error
- * if case of failure ("host failure")
- */
-static int l_process_sleep(lua_State* L)
-{
- double duration = luaL_checknumber(L, 1);
- msg_error_t res = MSG_process_sleep(duration);
-
- switch (res) {
-
- case MSG_OK:
- return 0;
-
- case MSG_HOST_FAILURE:
- lua_pushliteral(L, "host failure");
- return 1;
-
- default:
- xbt_die("Unexpected result of MSG_process_sleep: %d, please report this bug", res);
- }
-}
-
-static const luaL_Reg process_functions[] = {
- {"sleep", l_process_sleep},
- /* TODO: self, create, kill, suspend, is_suspended, resume, get_name,
- * get_pid, get_ppid, migrate
- */
- {NULL, NULL}
-};
-
-/**
- * \brief Registers the process functions into the table simgrid.process.
- * \param L a lua state
- */
-void sglua_register_process_functions(lua_State* L)
-{
- lua_getglobal(L, "simgrid"); /* simgrid */
- luaL_newlib(L, process_functions); /* simgrid simgrid.process */
- lua_setfield(L, -2, "process"); /* simgrid */
- lua_pop(L, 1); /* -- */
-}
-
+++ /dev/null
-/* Copyright (c) 2010-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/* SimGrid Lua state management */
-
-#include "lua_state_cloner.h"
-#include "lua_utils.h"
-#include "xbt.h"
-#include "xbt/log.h"
-#include <lauxlib.h>
-#include <lualib.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_state_cloner, bindings, "Lua state management");
-
-static void sglua_add_maestro_table(lua_State* L, int index, void* maestro_table_ptr);
-static void sglua_remove_maestro_table(lua_State* L, int index, void* maestro_table_ptr);
-static void* sglua_get_maestro_table_ptr(lua_State* L, int index);
-static void sglua_get_table_by_ptr(lua_State* L, void* table_ptr);
-static int l_get_from_maestro(lua_State* L);
-
-static void sglua_copy_nil(lua_State* src, lua_State* dst);
-static void sglua_copy_number(lua_State* src, lua_State* dst);
-static void sglua_copy_boolean(lua_State* src, lua_State* dst);
-static void sglua_copy_string(lua_State* src, lua_State* dst);
-static void sglua_copy_table(lua_State* src, lua_State* dst);
-static void sglua_copy_function(lua_State* src, lua_State* dst);
-static void sglua_copy_lightuserdata(lua_State* src, lua_State* dst);
-static void sglua_copy_userdata(lua_State* src, lua_State* dst);
-static void sglua_copy_thread(lua_State* src, lua_State* dst);
-
-/**
- * @brief Adds a reference to a maestro table to the list of known maestro
- * tables of a state.
- *
- * TODO identify maestro's tables with my own IDs instead of pointers
- * to Lua internals
- *
- * @param L a state (can be maestro itself)
- * @param index index of the copy of the maestro table in the stack of L
- * @param maestro_table_ptr pointer to the original table in maestro's world
- */
-static void sglua_add_maestro_table(lua_State* L, int index, void* maestro_table_ptr) {
-
- /* we will set both [ptr] -> table and [table] -> ptr */
-
- /* ... */
- lua_pushvalue(L, index);
- /* ... table */
- lua_pushstring(L, "simgrid.maestro_tables");
- /* ... table "simgrid.maestro_tables" */
- lua_rawget(L, LUA_REGISTRYINDEX);
- /* ... table maestrotbs */
- lua_pushvalue(L, -2);
- /* ... table maestrotbs table */
- lua_pushlightuserdata(L, maestro_table_ptr);
- /* ... table maestrotbs table tableptr */
- lua_pushvalue(L, -1);
- /* ... table maestrotbs table tableptr tableptr */
- lua_pushvalue(L, -3);
- /* ... table maestrotbs table tableptr tableptr table */
- lua_settable(L, -5);
- /* ... table maestrotbs table tableptr */
- lua_settable(L, -3);
- /* ... table maestrotbs */
- lua_pop(L, 2);
- /* ... */
-}
-
-/**
- * @brief Removes a reference to a maestro table to the list of known maestro
- * tables of a state.
- *
- * @param L a state (can be maestro itself)
- * @param index index of the copy of the maestro table in the stack of L
- * @param maestro_table_ptr pointer to the original table in maestro's world
- */
-static void sglua_remove_maestro_table(lua_State* L, int index, void* maestro_table_ptr) {
-
- /* we will unset both [ptr] -> table and [table] -> ptr */
-
- /* ... */
- lua_pushvalue(L, index);
- /* ... table */
- lua_pushstring(L, "simgrid.maestro_tables");
- /* ... table "simgrid.maestro_tables" */
- lua_rawget(L, LUA_REGISTRYINDEX);
- /* ... table maestrotbs */
- lua_pushvalue(L, -2);
- /* ... table maestrotbs table */
- lua_pushnil(L);
- /* ... table maestrotbs table nil */
- lua_pushlightuserdata(L, maestro_table_ptr);
- /* ... table maestrotbs table nil tableptr */
- lua_pushnil(L);
- /* ... table maestrotbs table nil tableptr nil*/
- lua_settable(L, -5);
- /* ... table maestrotbs table nil */
- lua_settable(L, -3);
- /* ... table maestrotbs */
- lua_pop(L, 2);
- /* ... */
-}
-
-/**
- * @brief For a table in the stack of L, returns a pointer that identifies the
- * same table in in maestro's world.
- * @param L a Lua state
- * @param index index of a table in the stack of L
- * @return a pointer to maestro's copy of this table, or NULL if this table
- * did not come from maestro
- */
-static void* sglua_get_maestro_table_ptr(lua_State* L, int index) {
-
- void* maestro_table_ptr = NULL;
- /* ... */
- lua_pushvalue(L, index);
- /* ... table */
- lua_pushstring(L, "simgrid.maestro_tables");
- /* ... table "simgrid.maestro_tables" */
- lua_rawget(L, LUA_REGISTRYINDEX);
- /* ... table maestrotbs */
- lua_pushvalue(L, -2);
- /* ... table maestrotbs table */
- lua_gettable(L, -2);
- /* ... table maestrotbs tableptr/nil */
- if (!lua_isnil(L, -1)) {
- /* ... table maestrotbs tableptr */
- maestro_table_ptr = (void*) lua_topointer(L, -1);
- }
-
- lua_pop(L, 3);
- /* ... */
- return maestro_table_ptr;
-}
-
-/**
- * @brief Pushes a table knowing a pointer to maestro's copy of this table.
- *
- * Pushes nil if L does not know this table in maestro.
- *
- * @param L a Lua state
- * @param maestro_table_ptr pointer that identifies a table in maestro's world
- */
-static void sglua_get_table_by_ptr(lua_State* L, void* maestro_table_ptr) {
-
- /* ... */
- lua_pushstring(L, "simgrid.maestro_tables");
- /* ... "simgrid.maestro_tables" */
- lua_rawget(L, LUA_REGISTRYINDEX);
- /* ... maestrotbs */
- lua_pushlightuserdata(L, maestro_table_ptr);
- /* ... maestrotbs tableptr */
- lua_gettable(L, -2);
- /* ... maestrotbs table/nil */
- lua_remove(L, -2);
- /* ... table/nil */
-}
-
-/**
- * @brief Pops a value from the stack of a source state and pushes it on the
- * stack of another state.
- * If the value is a table, its content is copied recursively.
- *
- * This function is similar to lua_xmove() but it allows to move a value
- * between two different global states.
- *
- * @param src the source state (not necessarily maestro)
- * @param dst the destination state
- */
-void sglua_move_value(lua_State* src, lua_State* dst) {
-
- sglua_copy_value(src, dst);
- lua_pop(src, 1);
-}
-
-/**
- * @brief Pushes onto the stack a copy of the value on top another stack.
- * If the value is a table, its content is copied recursively.
- *
- * This function allows to move a value between two different global states.
- *
- * @param src the source state (not necessarily maestro)
- * @param dst the destination state
- */
-void sglua_copy_value(lua_State* src, lua_State* dst) {
-
- luaL_checkany(src, -1); /* check the value to copy */
-
- int indent = (lua_gettop(dst) - 1) * 6;
- XBT_DEBUG("%sCopying data %s", sglua_get_spaces(indent), sglua_tostring(src, -1));
-
- sglua_stack_dump("src before copying a value (should be ... value): ", src);
- sglua_stack_dump("dst before copying a value (should be ...): ", dst);
-
- switch (lua_type(src, -1)) {
-
- case LUA_TNIL:
- sglua_copy_nil(src, dst);
- break;
-
- case LUA_TNUMBER:
- sglua_copy_number(src, dst);
- break;
-
- case LUA_TBOOLEAN:
- sglua_copy_boolean(src, dst);
- break;
-
- case LUA_TSTRING:
- sglua_copy_string(src, dst);
- break;
-
- case LUA_TFUNCTION:
- sglua_copy_function(src, dst);
- break;
-
- case LUA_TTABLE:
- sglua_copy_table(src, dst);
- break;
-
- case LUA_TLIGHTUSERDATA:
- sglua_copy_lightuserdata(src, dst);
- break;
-
- case LUA_TUSERDATA:
- sglua_copy_userdata(src, dst);
- break;
-
- case LUA_TTHREAD:
- sglua_copy_thread(src, dst);
- break;
-
- case LUA_TNONE:
- XBT_ERROR("This index is acceptable but non-valid");
- break;
- }
-
- XBT_DEBUG("%sData copied", sglua_get_spaces(indent));
-
- sglua_stack_dump("src after copying a value (should be ... value): ", src);
- sglua_stack_dump("dst after copying a value (should be ... value): ", dst);
-}
-
-/**
- * @brief Copies the nil value on the top of src to the top of dst.
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_nil(lua_State* src, lua_State* dst) {
- lua_pushnil(dst);
-}
-
-/**
- * @brief Copies the number value on the top of src to the top of dst.
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_number(lua_State* src, lua_State* dst) {
- lua_Number n = lua_tonumber(src, -1);
- if ( ((lua_Integer) n) == n) {
- lua_pushinteger(dst, lua_tointeger(src, -1));
- }
- else
- lua_pushnumber(dst, lua_tonumber(src, -1));
-}
-
-/**
- * @brief Copies the boolean value on the top of src to the top of dst.
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_boolean(lua_State* src, lua_State* dst) {
- lua_pushboolean(dst, lua_toboolean(src, -1));
-}
-
-/**
- * @brief Copies the string value on the top of src to the top of dst.
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_string(lua_State* src, lua_State* dst) {
-
- /* no worries about memory: lua_pushstring makes a copy */
- lua_pushstring(dst, lua_tostring(src, -1));
-}
-
-/**
- * @brief Copies the table value on top of src to the top of dst.
- *
- * A deep copy of the table is made. If the table has a metatable, the
- * metatable is also copied.
- * If the table comes from maestro and is already known by the destination
- * state, it is not copied again.
- *
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_table(lua_State* src, lua_State* dst) {
-
- /* src: ... table
- dst: ... */
- int indent = lua_gettop(dst) * 6 + 2;
-
- /* get from maestro the pointer that identifies this table */
- void* table_ptr = sglua_get_maestro_table_ptr(src, -1);
- int known_by_maestro = (table_ptr != NULL);
-
- if (!known_by_maestro) {
- /* the table didn't come from maestro: nevermind, use the pointer of src */
- table_ptr = (void*) lua_topointer(src, -1);
- XBT_DEBUG("%sMaestro does not know this table",
- sglua_get_spaces(indent));
- }
-
- if (sglua_is_maestro(src)) {
- /* register the table in maestro itself */
- XBT_DEBUG("%sKeeping track of this table in maestro itself",
- sglua_get_spaces(indent));
- sglua_add_maestro_table(src, -1, table_ptr);
- known_by_maestro = 1;
- xbt_assert(sglua_get_maestro_table_ptr(src, -1) == table_ptr);
- }
-
- /* to avoid infinite recursion, see if this table is already known by dst */
- sglua_get_table_by_ptr(dst, table_ptr);
- /* dst: ... table/nil */
- if (!lua_isnil(dst, -1)) {
- XBT_DEBUG("%sNothing to do: table already known (%p)",
- sglua_get_spaces(indent), table_ptr);
- /* dst: ... table */
- }
- else {
- XBT_DEBUG("%sFirst visit of this table (%p)", sglua_get_spaces(indent),
- table_ptr);
- /* dst: ... nil */
- lua_pop(dst, 1);
- /* dst: ... */
-
- /* first visit: create the new table in dst */
- lua_newtable(dst);
- /* dst: ... table */
-
- /* mark the table as known right now to avoid infinite recursion */
- sglua_add_maestro_table(dst, -1, table_ptr);
- /* we may have added a table with a non-maestro pointer, but if it was the
- * case, we will remove it later */
- XBT_DEBUG("%sTable marked as known", sglua_get_spaces(indent));
- xbt_assert(sglua_get_maestro_table_ptr(dst, -1) == table_ptr);
-
- sglua_stack_dump("dst after marking the table as known (should be ... table): ", dst);
-
- /* copy the metatable if any */
- int has_meta_table = lua_getmetatable(src, -1);
- /* src: ... table mt? */
- if (has_meta_table) {
- XBT_DEBUG("%sCopying the metatable", sglua_get_spaces(indent));
- /* src: ... table mt */
- sglua_copy_table(src, dst);
- /* dst: ... table mt */
- lua_pop(src, 1);
- /* src: ... table */
- lua_setmetatable(dst, -2);
- /* dst: ... table */
- }
- else {
- /* src: ... table */
- XBT_DEBUG("%sNo metatable", sglua_get_spaces(indent));
- }
-
- sglua_stack_dump("src before traversing the table (should be ... table): ", src);
- sglua_stack_dump("dst before traversing the table (should be ... table): ", dst);
-
- /* traverse the table of src and copy each element */
- lua_pushnil(src);
- /* src: ... table nil */
- while (lua_next(src, -2) != 0) {
- /* src: ... table key value */
-
- XBT_DEBUG("%sCopying table element %s", sglua_get_spaces(indent),
- sglua_keyvalue_tostring(src, -2, -1));
-
- sglua_stack_dump("src before copying table element (should be ... table key value): ", src);
- sglua_stack_dump("dst before copying table element (should be ... table): ", dst);
-
- /* copy the key */
- lua_pushvalue(src, -2);
- /* src: ... table key value key */
- indent += 2;
- XBT_DEBUG("%sCopying the key part of the table element",
- sglua_get_spaces(indent));
- sglua_move_value(src, dst);
- /* src: ... table key value
- dst: ... table key */
- XBT_DEBUG("%sCopied the key part of the table element",
- sglua_get_spaces(indent));
-
- /* copy the value */
- XBT_DEBUG("%sCopying the value part of the table element",
- sglua_get_spaces(indent));
- sglua_move_value(src, dst);
- /* src: ... table key
- dst: ... table key value */
- XBT_DEBUG("%sCopied the value part of the table element",
- sglua_get_spaces(indent));
- indent -= 2;
-
- /* set the table element */
- lua_settable(dst, -3);
- /* dst: ... table */
-
- /* the key stays on top of src for next iteration */
- sglua_stack_dump("src before next iteration (should be ... table key): ", src);
- sglua_stack_dump("dst before next iteration (should be ... table): ", dst);
-
- XBT_DEBUG("%sTable element copied", sglua_get_spaces(indent));
- }
- XBT_DEBUG("%sFinished traversing the table", sglua_get_spaces(indent));
- }
-
- if (!known_by_maestro) {
- /* actually,it was not a maestro table: forget the pointer */
- sglua_remove_maestro_table(dst, -1, table_ptr);
- }
-}
-
-/**
- * @brief Copies the function on the top of src to the top of dst.
- *
- * It can be a Lua function or a C function.
- *
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_function(lua_State* src, lua_State* dst) {
-
- if (lua_iscfunction(src, -1)) {
- /* it's a C function */
-
- XBT_DEBUG("It's a C function");
- sglua_stack_dump("src before copying upvalues: ", src);
-
- /* get the function pointer */
- int function_index = lua_gettop(src);
- lua_CFunction f = lua_tocfunction(src, function_index);
-
- /* copy the upvalues */
- int i = 0;
- const char* upvalue_name = NULL;
- do {
- i++;
- upvalue_name = lua_getupvalue(src, function_index, i);
-
- if (upvalue_name != NULL) {
- XBT_DEBUG("Upvalue %s", upvalue_name);
- sglua_move_value(src, dst);
- }
- } while (upvalue_name != NULL);
-
- sglua_stack_dump("src before copying pointer: ", src);
-
- /* set the function */
- lua_pushcclosure(dst, f, i - 1);
- XBT_DEBUG("Function pointer copied");
- }
- else {
- /* it's a Lua function: dump it from src */
-
- s_sglua_buffer_t buffer;
- buffer.capacity = 128; /* an empty function uses 77 bytes */
- buffer.size = 0;
- buffer.data = xbt_new(char, buffer.capacity);
-
- /* copy the binary chunk from src into a buffer
- * c.heinrich: Added parameter TRUE for Lua 5.3 - this strips all debug
- * information from the function.
- */
- // Was before merge: XBT_GNUC_UNUSED and was replaced with XBT_ATTRIB_UNUSED
- XBT_ATTRIB_UNUSED int error = lua_dump(src, sglua_memory_writer, &buffer, TRUE);
- xbt_assert(!error, "Failed to dump the function from the source state: error %d",
- error);
- XBT_DEBUG("Fonction dumped: %zu bytes", buffer.size);
-
- /*
- fwrite(buffer.data, buffer.size, buffer.size, stderr);
- fprintf(stderr, "\n");
- */
-
- /* load the chunk into dst */
- error = luaL_loadbuffer(dst, buffer.data, buffer.size, "(dumped function)");
- xbt_assert(!error, "Failed to load the function into the destination state: %s",
- lua_tostring(dst, -1));
- }
-}
-
-/**
- * @brief Copies the light userdata on the top of src to the top of dst.
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_lightuserdata(lua_State* src, lua_State* dst) {
- lua_pushlightuserdata(dst, lua_touserdata(src, -1));
-}
-
-/**
- * @brief Copies the full userdata on the top of src to the top of dst.
- *
- * If the userdata has a metatable, the metatable is also copied.
- *
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_userdata(lua_State* src, lua_State* dst) {
-
- int indent = lua_gettop(dst) * 6 + 2;
-
- /* copy the data */
- /* src: ... udata
- dst: ... */
- size_t size = lua_rawlen(src, -1);
- void* src_block = lua_touserdata(src, -1);
- void* dst_block = lua_newuserdata(dst, size);
- /* dst: ... udata */
- memcpy(dst_block, src_block, size);
-
- /* copy the metatable if any */
- int has_meta_table = lua_getmetatable(src, -1);
- /* src: ... udata mt? */
- if (has_meta_table) {
- XBT_DEBUG("%sCopying metatable of userdata (%p)",
- sglua_get_spaces(indent), lua_topointer(src, -1));
- /* src: ... udata mt */
- sglua_copy_table(src, dst);
- /* src: ... udata mt
- dst: ... udata mt */
- lua_pop(src, 1);
- /* src: ... udata */
- lua_setmetatable(dst, -2);
- /* dst: ... udata */
-
- XBT_DEBUG("%sMetatable of userdata copied", sglua_get_spaces(indent));
- }
- else {
- XBT_DEBUG("%sNo metatable for this userdata",
- sglua_get_spaces(indent));
- /* src: ... udata */
- }
-}
-
-/**
- * @brief This operation is not supported (yet?) so it just pushes nil.
- *
- * @param src source state
- * @param dst destination state
- */
-static void sglua_copy_thread(lua_State* src, lua_State* dst) {
-
- XBT_WARN("Copying a thread from another state is not implemented (yet?).");
- lua_pushnil(dst);
-}
-
-/**
- * @brief Copies a global value or a registry value from the maestro state.
- *
- * The state L must have been created by sglua_clone_maestro_state().
- * This function is meant to be an __index metamethod.
- * Consequently, it assumes that the stack has two elements:
- * a table (either the environment or the registry of L) and the string key of
- * a value that does not exist yet in this table. It copies the corresponding
- * value from maestro and pushes it on the stack of L.
- * If the value does not exist in maestro state either, nil is pushed.
- *
- * TODO: make this function thread safe. If the simulation runs in parallel,
- * several simulated processes may trigger this __index metamethod at the same
- * time and get globals from maestro.
- *
- * @param L the current state
- * @return number of return values pushed (always 1)
- */
-static int l_get_from_maestro(lua_State *L) {
-
- /* check the arguments */
- luaL_checktype(L, 1, LUA_TTABLE);
- const char* key = luaL_checkstring(L, 2);
- /* L: table key */
- XBT_DEBUG("__index of '%s' begins", key);
-
- /* get the father */
- lua_State* maestro = sglua_get_maestro(); /* maestro: */
-
- /* want a global or a registry value?
- get the value from maestro */
- if (lua_compare(L, 1, LUA_REGISTRYINDEX, LUA_OPEQ)) {
- /* case: registry */
- lua_getfield(maestro, LUA_REGISTRYINDEX, key); /* maestro: ... value */
- XBT_DEBUG("Will get the value from the registry of maestro");
- }
- else { /* case: global */
- lua_getglobal(maestro, key); /* maestro: ... value */
- XBT_DEBUG("Will get the value from the globals of maestro");
- }
-
- /* L: table key */
-
-
- /* push the value onto the stack of L */
- sglua_move_value(maestro, L);
- /* maestro: ...
- L: table key value */
-
- /* prepare the return value of __index */
- lua_pushvalue(L, -1);
- /* L: table key value value */
- lua_insert(L, 1);
- /* L: value table key value */
-
- /* save the copied value in the table for subsequent accesses */
- lua_settable(L, -3);
- /* L: value table */
- lua_settop(L, 1);
- /* L: value */
-
- XBT_DEBUG("__index of '%s' returns %s", key, sglua_tostring(L, -1));
-
- return 1;
-}
-
-/**
- * @brief Creates a new Lua state and get its environment from the maestro
- * state.
- *
- * The state created is independent from maestro and has its own copies of
- * global and registry values.
- * However, the global and registry values are not copied right now from
- * the original state; they are copied only the first time they are accessed.
- * This behavior saves time and memory, and is okay for Simgrid's needs.
- *
- * TODO: if the simulation runs in parallel, copy everything right now?
- *
- * @return the state created
- */
-lua_State* sglua_clone_maestro(void) {
-
- /* create the new state */
- lua_State *L = luaL_newstate();
-
- /* set its environment and its registry:
- * - create a table newenv
- * - create a metatable mt
- * - set mt.__index = a function that copies the global from the father state
- * - set mt as the metatable of the registry
- * - set mt as the metatable of newenv
- * - set newenv as the environment of the new state
- */
- lua_pushthread(L); /* thread */
- lua_newtable(L); /* thread newenv */
- lua_newtable(L); /* thread newenv mt */
- lua_pushvalue(L, LUA_REGISTRYINDEX); /* thread newenv mt reg */
- lua_pushcfunction(L, l_get_from_maestro); /* thread newenv mt reg f */
- lua_setfield(L, -3, "__index"); /* thread newenv mt reg */
- lua_pushvalue(L, -2); /* thread newenv mt reg mt */
- lua_setmetatable(L, -2); /* thread newenv mt reg */
- lua_pop(L, 1); /* thread newenv mt */
- lua_setmetatable(L, -2); /* thread newenv */
- lua_pushvalue(L, LUA_REGISTRYINDEX); /* thread newenv reg */
- lua_insert(L, -2); /* thread reg newenv */
- lua_seti(L, -2, LUA_RIDX_GLOBALS); /* thread reg */
- lua_pop(L, 2); /* -- */
-
- /* create the table of known tables from maestro */
- lua_pushstring(L, "simgrid.maestro_tables");
- /* "simgrid.maestro_tables" */
- lua_newtable(L); /* "simgrid.maestro_tables" maestrotbs */
- lua_rawset(L, LUA_REGISTRYINDEX);
- /* -- */
-
- /* opening the standard libs is not necessary as they are
- * inherited like any global values */
- /* luaL_openlibs(L); */
-
- XBT_DEBUG("New state created");
-
- return L;
-}
+++ /dev/null
-/* Copyright (c) 2010-2011, 2013-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef LUA_STATE_CLONER_H
-#define LUA_STATE_CLONER_H
-
-/* SimGrid Lua state management */
-#include <lua.h>
-
-int sglua_is_maestro(lua_State* L);
-lua_State* sglua_get_maestro(void);
-lua_State* sglua_clone_maestro(void);
-void sglua_move_value(lua_State* src, lua_State* dst);
-void sglua_copy_value(lua_State* src, lua_State* dst);
-
-#endif /* LUA_STATE_CLONER_H */
+++ /dev/null
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "lua_private.h"
-#include "lua_utils.h"
-#include "lua_state_cloner.h"
-#include <lauxlib.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_task, bindings, "Lua bindings (task module)");
-
-#define TASK_MODULE_NAME "simgrid.task"
-
-/* ********************************************************************************* */
-/* simgrid.task API */
-/* ********************************************************************************* */
-
-/**
- * \brief Ensures that a value in the stack is a valid task and returns it.
- * A task is "valid" if the value in the stack at the given index is
- * (a) a table
- * (b) has a field called "__simgrid_task" which
- * (c) contains the ctask itself (which can be typecast to msg_task_t*)
- * \param L a Lua state
- * \param index an index in the Lua stack
- * \return the C task corresponding to this Lua task
- */
-msg_task_t sglua_check_task(lua_State* L, int index)
-{
- sglua_stack_dump("check task: ", L);
- luaL_checktype(L, index, LUA_TTABLE);
- /* ... task ... */
- lua_getfield(L, index, "__simgrid_task");
- /* ... task ... ctask */
- msg_task_t task = *((msg_task_t*) luaL_checkudata(L, -1, TASK_MODULE_NAME));
- lua_pop(L, 1);
- /* ... task ... */
-
- if (task == NULL) {
- luaL_error(L, "This task was sent to someone else, you cannot access it anymore");
- }
-
- return task;
-}
-
-/**
- * \brief Creates a new task and places it onto the stack.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (string): name of the task
- * - Argument 2 (number): computation size
- * - Argument 3 (number): communication size
- * - Return value (task): the task created
- *
- * A Lua task is a regular table with a full userdata inside, and both share
- * the same metatable. For the regular table, the metatable allows OO-style
- * writing such as your_task:send(someone) instead of your_task.send(your_task, someone)
- * For the userdata, the metatable is used to check its type.
- * TODO: make the task name an optional last parameter
- */
-static int l_task_new(lua_State* L)
-{
- XBT_DEBUG("Task new");
- const char* name = luaL_checkstring(L, 1);
- int comp_size = (int) luaL_checkinteger(L, 2);
- int msg_size = (int) luaL_checkinteger(L, 3);
- /* name comp comm */
- lua_settop(L, 0);
- /* -- */
- msg_task_t msg_task = MSG_task_create(name, comp_size, msg_size, NULL);
-
- lua_newtable(L);
- /* task */
- luaL_getmetatable(L, TASK_MODULE_NAME);
- /* task mt */
- lua_setmetatable(L, -2);
- /* task */
- msg_task_t* lua_task = (msg_task_t*) lua_newuserdata(L, sizeof(msg_task_t));
- /* task ctask */
- *lua_task = msg_task;
- luaL_getmetatable(L, TASK_MODULE_NAME);
- /* task ctask mt */
- lua_setmetatable(L, -2);
- /* task ctask */
- lua_setfield(L, -2, "__simgrid_task");
- /* task */
- return 1;
-}
-
-/**
- * \brief Returns the name of a task.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (task): a task
- * - Return value (string): name of the task
- */
-static int l_task_get_name(lua_State* L)
-{
- msg_task_t task = sglua_check_task(L, 1);
- lua_pushstring(L, MSG_task_get_name(task));
- return 1;
-}
-
-/**
- * \brief Returns the computation duration of a task.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (task): a task
- * - Return value (number): computation duration of this task
- */
-static int l_task_get_computation_duration(lua_State* L)
-{
- msg_task_t task = sglua_check_task(L, 1);
- lua_pushnumber(L, MSG_task_get_flops_amount(task));
- return 1;
-}
-
-/**
- * \brief Executes a task.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (task): the task to execute
- * - Return value (nil or string): nil if the task was successfully executed,
- * or an error string in case of failure, which may be "task canceled" or
- * "host failure"
- */
-static int l_task_execute(lua_State* L)
-{
- XBT_DEBUG("Called task_execute");
- msg_task_t task = sglua_check_task(L, 1);
- msg_error_t res = MSG_task_execute(task);
-
- if (res == MSG_OK) {
- return 0;
- }
- else {
- lua_pushstring(L, sglua_get_msg_error(res));
- return 1;
- }
-}
-
-/**
- * \brief Pops the Lua task from the stack and registers it so that the
- * process can retrieve it later knowing the C task.
- * \param L a lua state
- */
-void sglua_task_register(lua_State* L) {
-
- msg_task_t task = sglua_check_task(L, -1);
- /* ... task */
- /* put in the C task a ref to the lua task so that the receiver finds it */
- unsigned long ref = luaL_ref(L, LUA_REGISTRYINDEX);
- /* ... */
- MSG_task_set_data(task, (void*) ref);
-}
-
-/**
- * \brief Pushes onto the stack the Lua task corresponding to a C task.
- *
- * The Lua task must have been previously registered with task_register so
- * that it can be retrieved knowing the C task.
- *
- * \param L a lua state
- * \param task a C task
- */
-void sglua_task_unregister(lua_State* L, msg_task_t task) {
-
- /* ... */
- /* the task is in my registry, put it onto my stack */
- unsigned long ref = (unsigned long) MSG_task_get_data(task);
- lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
- /* ... task */
- luaL_unref(L, LUA_REGISTRYINDEX, ref);
- MSG_task_set_data(task, NULL);
-}
-
-/**
- * \brief This function is called when a C task has just been copied.
- *
- * This callback is used to move the corresponding Lua task from the sender
- * process to the receiver process (so that the receiver can access and deal
- * with it).
- * It is executed in SIMIX kernel mode when the communication finishes,
- * before both processes are awaken. Thus, this function is thread-safe when
- * user processes are executed in parallel, though it modifies the Lua
- * stack of both processes to move the task.
- * After this function, both Lua stacks are restored in their previous state.
- * The task is moved from the registry of the sender to the registry of the
- * receiver.
- *
- * \param task the task copied
- * \param src_process the sender
- * \param dst_process the receiver
- */
-static void task_copy_callback(msg_task_t task, msg_process_t src_process,
- msg_process_t dst_process) {
-
- lua_State* src = (lua_State*) MSG_process_get_data(src_process);
- lua_State* dst = (lua_State*) MSG_process_get_data(dst_process);
-
- /* src: ...
- dst: ... */
- sglua_task_unregister(src, task);
- /* src: ... task */
- sglua_copy_value(src, dst);
- /* src: ... task
- dst: ... task */
- sglua_task_register(dst);
- /* dst: ... */
-
- /* the receiver is now the owner of the task and may destroy it:
- * make the sender forget the C task so that it doesn't garbage */
- lua_getfield(src, -1, "__simgrid_task");
- /* src: ... task ctask */
- msg_task_t* udata = (msg_task_t*) luaL_checkudata(src, -1, TASK_MODULE_NAME);
- *udata = NULL;
- lua_pop(src, 2);
- /* src: ... */
-}
-
-/**
- * \brief Sends a task to a mailbox and waits for its completion.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (task): the task to send
- * - Argument 2 (string or compatible): mailbox name, as a real string or any
- * type convertible to string (numbers always are)
- * - Argument 3 (number, optional): timeout (default is no timeout)
- * - Return values (boolean + string): true if the communication was successful,
- * or false plus an error string in case of failure, which may be "timeout",
- * "host failure" or "transfer failure"
- */
-static int l_task_send(lua_State* L)
-{
- const char* mailbox = luaL_checkstring(L, 2);
- msg_task_t task = sglua_check_task(L, 1);
- double timeout;
- if (lua_gettop(L) >= 3) {
- timeout = luaL_checknumber(L, 3);
- }
- else {
- timeout = -1;
- /* no timeout by default */
- }
- lua_settop(L, 1);
- /* task */
- sglua_task_register(L);
- /* -- */
- msg_error_t res = MSG_task_send_with_timeout(task, mailbox, timeout);
-
- if (res == MSG_OK) {
- lua_pushboolean(L, 1);
- /* true */
- return 1;
- }
- else {
- /* the communication has failed, I'm still the owner of the task */
- sglua_task_unregister(L, task);
- /* task */
- lua_pushboolean(L, 0);
- /* task false */
- lua_pushstring(L, sglua_get_msg_error(res));
- /* task false error */
- return 2;
- }
-}
-
-/**
- * \brief Sends a task to a mailbox.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * This is a non-blocking function: use simgrid.comm.wait() or
- * simgrid.comm.test() to end the communication.
- *
- * - Argument 1 (task): the task to send
- * - Argument 2 (string or compatible): mailbox name, as a real string or any
- * type convertible to string (numbers always are)
- * - Return value (comm): a communication object to be used later with wait or test
- */
-static int l_task_isend(lua_State* L)
-{
- const char* mailbox = luaL_checkstring(L, 2);
- msg_task_t task = sglua_check_task(L, 1);
- /* task mailbox ... */
- lua_settop(L, 1);
- /* task */
- sglua_task_register(L);
- /* -- */
- msg_comm_t comm = MSG_task_isend(task, mailbox);
-
- sglua_push_comm(L, comm);
- /* comm */
- return 1;
-}
-
-/**
- * \brief Sends a task on a mailbox on a best effort way (detached send).
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * Like simgrid.task.isend, this is a non-blocking function.
- * You can use this function if you don't care about when the communication
- * ends and whether it succeeds.
- * FIXME: isn't this equivalent to calling simgrid.task.isend() and ignoring
- * the result?
- *
- * - Argument 1 (task): the task to send
- * - Argument 2 (string or compatible): mailbox name, as a real string or any
- * type convertible to string (numbers always are)
- */
-static int l_task_dsend(lua_State* L)
-{
- const char* mailbox = luaL_checkstring(L, 2);
- msg_task_t task = sglua_check_task(L, 1);
- /* task mailbox ... */
- lua_settop(L, 1);
- /* task */
- sglua_task_register(L);
- /* -- */
- MSG_task_dsend(task, mailbox, NULL);
- return 0;
-}
-
-/**
- * \brief Receives a task.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (string or compatible): mailbox name, as a real string or any
- * type convertible to string (numbers always are)
- * - Argument 2 (number, optional): timeout (default is no timeout)
- * - Return values (task or nil + string): the task received, or nil plus an
- * error message if the communication has failed
- */
-static int l_task_recv(lua_State* L)
-{
- msg_task_t task = NULL;
- const char* mailbox = luaL_checkstring(L, 1);
- double timeout;
- if (lua_gettop(L) >= 2) {
- /* mailbox timeout ... */
- timeout = luaL_checknumber(L, 2);
- }
- else {
- /* mailbox */
- timeout = -1;
- /* no timeout by default */
- }
- /* mailbox ... */
- msg_error_t res = MSG_task_receive_with_timeout(&task, mailbox, timeout);
-
- if (res == MSG_OK) {
- sglua_task_unregister(L, task);
- /* mailbox ... task */
- return 1;
- }
- else {
- lua_pushnil(L);
- /* mailbox ... nil */
- lua_pushstring(L, sglua_get_msg_error(res));
- /* mailbox ... nil error */
- return 2;
- }
-}
-
-/**
- * \brief Asynchronously receives a task on a mailbox.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * This is a non-blocking function: use simgrid.comm.wait() or
- * simgrid.comm.test() to end the communication and get the task in case of
- * success.
- *
- * - Argument 1 (string or compatible): mailbox name, as a real string or any
- * type convertible to string (numbers always are)
- * - Return value (comm): a communication object to be used later with wait or test
- */
-
-static int l_task_irecv(lua_State* L)
-{
- const char* mailbox = luaL_checkstring(L, 1);
- /* mailbox ... */
- msg_task_t* task = xbt_new0(msg_task_t, 1); // FIXME fix this leak
- msg_comm_t comm = MSG_task_irecv(task, mailbox);
- sglua_push_comm(L, comm);
- /* mailbox ... comm */
- return 1;
-}
-
-static const luaL_Reg task_functions[] = {
- {"new", l_task_new},
- {"get_name", l_task_get_name},
- {"get_computation_duration", l_task_get_computation_duration},
- {"execute", l_task_execute},
- {"send", l_task_send},
- {"isend", l_task_isend},
- {"dsend", l_task_dsend},
- {"recv", l_task_recv},
- {"irecv", l_task_irecv},
- {NULL, NULL}
-};
-
-/**
- * \brief Finalizes the userdata of a task.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (userdata): a C task, possibly NULL if it was sent to another
- * Lua state
- */
-static int l_task_gc(lua_State* L)
-{
- void *p = luaL_testudata(L, 1, TASK_MODULE_NAME);
- if (p == NULL) {
- return 0;
- }
-
- msg_task_t task = *((msg_task_t*) luaL_checkudata(L, 1, TASK_MODULE_NAME));
- /* the task is NULL if I sent it to someone else */
- if (task != NULL) {
- MSG_task_destroy(task);
- }
- lua_settop(L, 0);
- return 0;
-}
-
-/**
- * \brief Returns a string representation of a C task.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (userdata): a task
- * - Return value (string): a string describing this task
- */
-static int l_task_tostring(lua_State* L)
-{
- msg_task_t task = *((msg_task_t*) luaL_checkudata(L, 1, TASK_MODULE_NAME));
- lua_pushfstring(L, "Task: %p", task);
- return 1;
-}
-
-/**
- * \brief Metamethods of both a task table and the userdata inside it.
- */
-static const luaL_Reg task_meta[] = {
- {"__gc", l_task_gc}, /* will be called only for userdata */
- {"__tostring", l_task_tostring},
- {NULL, NULL}
-};
-
-/**
- * \brief Registers the task functions into the table simgrid.task.
- *
- * Also initialize the metatable of the task userdata type.
- *
- * \param L a lua state
- */
-void sglua_register_task_functions(lua_State* L)
-{
- /* create a table simgrid.task and fill it with task functions */
- lua_getglobal(L, "simgrid"); /* simgrid */
- luaL_newlib(L, task_functions); /* simgrid simgrid.task */
-
- /* create the metatable for tasks, add it to the Lua registry */
- luaL_newmetatable(L, TASK_MODULE_NAME); /* simgrid simgrid.task mt */
-
- /* fill the metatable */
- luaL_setfuncs(L, task_meta, 0); /* simgrid simgrid.task mt */
- lua_pushvalue(L, -2); /* simgrid simgrid.task mt simgrid.task */
-
- /* metatable.__index = simgrid.task
- * we put the task functions inside the task itself:
- * this allows to write my_task:method(args) for
- * simgrid.task.method(my_task, args) */
- lua_setfield(L, -2, "__index"); /* simgrid simgrid.task mt */
-
- lua_setmetatable(L, -2); /* simgrid simgrid.task */
- lua_setfield(L, -2, "task"); /* simgrid */
- lua_pop(L, 1); /* -- */
-
- /* set up MSG to copy Lua tasks between states */
- MSG_task_set_copy_callback(task_copy_callback);
-}
-
/* SimGrid Lua bindings */
#include "lua_private.h"
-#include "lua_state_cloner.h"
#include "lua_utils.h"
#include "xbt.h"
#include "simgrid/msg.h"
int luaopen_simgrid(lua_State *L);
static void sglua_register_c_functions(lua_State *L);
-static int run_lua_code(int argc, char **argv);
/* ********************************************************************************* */
/* simgrid API */
/* ********************************************************************************* */
-/**
- * \brief Deploys your application.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (string): name of the deployment file to load
- */
-static int launch_application(lua_State* L) {
-
- const char* file = luaL_checkstring(L, 1);
- MSG_function_register_default(run_lua_code);
- MSG_launch_application(file);
- return 0;
-}
-
-
-/**
- * \brief Creates the platform.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Argument 1 (string): name of the platform file to load
- */
-static int create_environment(lua_State* L) {
-
- const char* file = luaL_checkstring(L, 1);
- XBT_DEBUG("Loading environment file %s", file);
- MSG_create_environment(file);
- return 0;
-}
-
/**
* \brief Prints a log string with debug level.
* \param L a Lua state
return 0;
}
-/**
- * \brief Runs your application.
- * \param L a Lua state
- * \return number of values returned to Lua
- */
-static int run(lua_State* L) {
-
- MSG_main();
- return 0;
-}
-
-/**
- * \brief Returns the current simulated time.
- * \param L a Lua state
- * \return number of values returned to Lua
- *
- * - Return value (number): the simulated time
- */
-static int get_clock(lua_State* L) {
-
- lua_pushnumber(L, MSG_get_clock());
- return 1;
-}
-
-/**
- * \brief Cleans the simulation.
- * \param L a Lua state
- * \return number of values returned to Lua
- */
-static int simgrid_gc(lua_State * L)
-{
- // There is no need to cleanup the C world anymore, as it gets cleaned at system process closing automatically
- // Maybe at some point we'll want to reintroduce this, for example when encapsulating the simulation properly
- //if (sglua_is_maestro(L)) {
- // MSG_clean();
- //}
- return 0;
-}
-
-/*
- * Register platform for MSG
- */
-static int msg_register_platform(lua_State * L)
-{
- /* Tell Simgrid we don't wanna use its parser */
- //surf_parse = console_parse_platform;
- surf_parse_reset_callbacks();
- MSG_create_environment(NULL);
- return 0;
-}
-
-/*
- * Register platform for Simdag
- */
-static int sd_register_platform(lua_State * L)
-{
- //surf_parse = console_parse_platform_wsL07;
- surf_parse_reset_callbacks();
- SD_create_environment(NULL);
- return 0;
-}
-
-/**
- * Register application for MSG
- */
-static int msg_register_application(lua_State * L)
-{
- MSG_function_register_default(run_lua_code);
- //surf_parse = console_parse_application;
- MSG_launch_application(NULL);
- return 0;
-}
-
-static int console_init_application(lua_State *L) {
- MSG_function_register_default(run_lua_code);
- SIMIX_init_application();
- return 0;
-}
-
-
static const luaL_Reg simgrid_functions[] = {
- {"create_environment", create_environment},
- {"launch_application", launch_application},
{"debug", debug},
{"info", info},
{"critical", critical},
{"error", error},
- {"run", run},
- {"get_clock", get_clock},
/* short names */
- {"platform", create_environment},
- {"application", launch_application},
/* methods to bypass XML parser */
- {"msg_register_platform", msg_register_platform},
- {"sd_register_platform", sd_register_platform},
- {"msg_register_application", msg_register_application},
- {"init_application", console_init_application},
{NULL, NULL}
};
return 1;
}
-/**
- * \brief Returns whether a Lua state is the maestro state.
- * \param L a Lua state
- * \return true if this is maestro
- */
-int sglua_is_maestro(lua_State* L) {
- return L == sglua_maestro_state;
-}
-
-/**
- * \brief Returns the maestro state.
- * \return the maestro Lua state
- */
-lua_State* sglua_get_maestro(void) {
- return sglua_maestro_state;
-}
/**
* \brief Makes the core functions available to the Lua world.
luaL_newlib(L, simgrid_functions); /* simgrid */
lua_pushvalue(L, -1); /* simgrid simgrid */
lua_setglobal(L, "simgrid"); /* simgrid */
-
- /* set a finalizer that cleans simgrid, by adding to the simgrid module a
- * dummy userdata whose __gc metamethod calls MSG_clean() */
- lua_newuserdata(L, sizeof(void*)); /* simgrid udata */
- lua_newtable(L); /* simgrid udata mt */
- lua_pushcfunction(L, simgrid_gc); /* simgrid udata mt simgrid_gc */
- lua_setfield(L, -2, "__gc"); /* simgrid udata mt */
- lua_setmetatable(L, -2); /* simgrid udata */
- lua_setfield(L, -2, "__simgrid_loaded"); /* simgrid */
- lua_pop(L, 1); /* -- */
}
/**
static void sglua_register_c_functions(lua_State *L)
{
sglua_register_core_functions(L);
- sglua_register_task_functions(L);
- sglua_register_comm_functions(L);
sglua_register_host_functions(L);
- sglua_register_process_functions(L);
sglua_register_platf_functions(L);
}
-
-/**
- * \brief Runs a Lua function as a new simulated process.
- * \param argc number of arguments of the function
- * \param argv name of the Lua function and array of its arguments
- * \return result of the function
- */
-static int run_lua_code(int argc, char **argv)
-{
- XBT_DEBUG("Run lua code %s", argv[0]);
-
- /* create a new state, getting globals from maestro */
- lua_State *L = sglua_clone_maestro();
- MSG_process_set_data(MSG_process_self(), L);
-
- /* start the function */
- lua_getglobal(L, argv[0]);
- xbt_assert(lua_isfunction(L, -1),
- "There is no Lua function with name `%s'", argv[0]);
-
- /* push arguments onto the stack */
- int i;
- for (i = 1; i < argc; i++)
- lua_pushstring(L, argv[i]);
-
- /* call the function */
- XBT_ATTRIB_UNUSED int err;
- err = lua_pcall(L, argc - 1, 1, 0);
- xbt_assert(err == 0, "Error running function `%s': %s", argv[0],
- lua_tostring(L, -1));
-
- /* retrieve result */
- int res = 1;
- if (lua_isnumber(L, -1)) {
- res = lua_tointeger(L, -1);
- lua_pop(L, 1); /* pop returned value */
- }
-
- XBT_DEBUG("Execution of Lua code %s is over", (argv ? argv[0] : "(null)"));
-
- return res;
-}
-
-/**
- * \brief Returns a string corresponding to an MSG error code.
- * \param err an MSG error code
- * \return a string describing this error
- */
-const char* sglua_get_msg_error(msg_error_t err) {
-
- static const char* msg_errors[] = {
- NULL,
- "timeout",
- "transfer failure",
- "host failure",
- "task canceled"
- };
-
- return msg_errors[err];
-}
#ifdef HAVE_LUA
#include "src/bindings/lua/simgrid_lua.h"
-#include "src/bindings/lua/lua_state_cloner.h"
#include <lua.h> /* Always include this when calling Lua */
#include <lauxlib.h> /* Always include this when calling Lua */
* written in lua). If not, we will use the (old?) XML parser
*/
if (is_lua) {
- // Get maestro state. In case we're calling Lua from
- // C only, this will be NULL -- no Lua code has been
- // executed yet and hence, the SimGrid module has not
- // yet been loaded.
// NOTE: After executing the lua_pcall() below,
// sglua_get_maestro() will not be NULL, since the
// SimGrid module was loaded!
- lua_State* L = sglua_get_maestro();
+ // C. Heinrich 01/2016: Not sure if this is still required after I
+ // ripped out most of that bloody Lua simulation stuff. We may
+ // want to check and maybe we can clean that up.
+ lua_State* L;
- // We may want to remove the task_copy_callback from
- // the SimGrid module if we're using C code only (this
- // callback is used for Lua-only code).
- int remove_callback = FALSE;
if (L == NULL) {
L = luaL_newstate();
- remove_callback = TRUE;
}
luaL_openlibs(L);
XBT_ERROR("FATAL ERROR:\n %s: %s\n\n", "Lua call failed. Errormessage:", lua_tostring(L, -1));
xbt_die("Lua call failed. See Log");
}
- // Without this, task_copy_callback() will try to copy
- // some tasks -- but these don't exist in case we're using
- // C. Hence, we need to remove the callback -- we don't
- // want to segfault.
- if (remove_callback) {
- MSG_task_set_copy_callback(NULL);
- }
-
}
else
#endif
#ifdef HAVE_LUA
XBT_LOG_CONNECT(bindings);
XBT_LOG_CONNECT(lua);
- XBT_LOG_CONNECT(lua_comm);
XBT_LOG_CONNECT(lua_host);
XBT_LOG_CONNECT(lua_platf);
- XBT_LOG_CONNECT(lua_process);
- XBT_LOG_CONNECT(lua_state_cloner);
- XBT_LOG_CONNECT(lua_task);
XBT_LOG_CONNECT(lua_utils);
#endif
set(BINDINGS_SRC
src/bindings/bindings_global.c
src/bindings/lua/lua_private.h
- src/bindings/lua/lua_state_cloner.h
src/bindings/lua/lua_utils.h
src/bindings/lua/simgrid_lua.h
)
set(LUA_SRC
src/bindings/lua/factories/host.lua
- src/bindings/lua/lua_comm.c
src/bindings/lua/lua_host.c
src/bindings/lua/lua_platf.c
- src/bindings/lua/lua_process.c
- src/bindings/lua/lua_state_cloner.c
- src/bindings/lua/lua_task.c
src/bindings/lua/lua_utils.c
src/bindings/lua/simgrid_lua.c
)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/suspend)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/tracing)
-
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/lua)
-
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/actions)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent)
ENDIF()
- ## BINGINGS ##
+ ## BINDINGS ##
### LUA ###
# BEGIN TESH TESTS
IF(HAVE_LUA)
- # Tests testing simulation from lua, i.e., you execute the simulation
- # by calling something similar to
- #
- # ~$ lua masterslave.lua platform.xml deploy.xml
- ADD_TESH(lua-duplicated-globals --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/state_cloner duplicated_globals.tesh)
- ADD_TESH(lua-masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/masterslave master_slave.tesh)
- ADD_TESH(lua-mult-matrix --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/multi_matrix mult_matrix.tesh)
- ADD_TESH(lua-masterslave-bypass --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/console master_slave_bypass.tesh)
- #Chord is severly broken and requires rewriting.
- #ADD_TESH(lua-chord --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/chord chord.tesh)
- ADD_TESH(lua-bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/bittorrent bittorrent.tesh)
- ADD_TESH(lua-kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/kademlia kademlia.tesh)
- SET_TESTS_PROPERTIES(lua-duplicated-globals PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
- SET_TESTS_PROPERTIES(lua-masterslave PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
- SET_TESTS_PROPERTIES(lua-mult-matrix PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
- SET_TESTS_PROPERTIES(lua-masterslave-bypass PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
- #SET_TESTS_PROPERTIES(lua-chord PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
- SET_TESTS_PROPERTIES(lua-bittorrent PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
- SET_TESTS_PROPERTIES(lua-kademlia PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
-
# Tests testing simulation from C but using lua for platform files. Executed
# like this
#