Martin Quinson [Wed, 25 Nov 2015 23:57:41 +0000 (00:57 +0100)]
Make HostL07 behave more like the regular Host
The methods execute() and sleep() were implemented directly in the
host, and the virtual functions in the cpu were implemented with a
DIE_IMPOSSIBLE.
Instead, HostL07 is dispatching the execute() and sleep() calls that
it gets from the higher layers to its CpuL07, just as any Host.
The goal is to kill HostL07 and just use a regular Host dispatching
*every* call to its CPU and RoutingEdge. Then, Host will be made part
of the public interface (simgrid::Host will offer the interface of
S4U::Host with the content of surf::Host).
Gabriel Corona [Tue, 24 Nov 2015 16:11:21 +0000 (17:11 +0100)]
[surf] Don't free power_peak from the caller
The code was giving the power_peak array to the callee. The callers
might still need the power_peak. Freeing it in the callee creates
dangling pointers in the callers.
Instead we consider power_peak as immutable in the callee and make a
private copy when needed instead of stealing it from the callers.
Gabriel Corona [Tue, 24 Nov 2015 10:27:18 +0000 (11:27 +0100)]
[surf] Change CPU initialization
- Move creation callbacks out of constructor (the object is not fully
constructed in the Host constructor).
- Do not call the setState virtual method in the constructor. This
calls the stateChanged callbacks some of which expect the
hostCreated callbacks to have been called.
Gabriel Corona [Tue, 24 Nov 2015 10:06:04 +0000 (11:06 +0100)]
[surf] Move the hostCreatedCallbacks after the constructor
The callbacks were called in the Host constructor which is at the very
beginning og the object construction: the fields of the derived
classes are not initialized at this point and the correct virtual
methods are not available.
Martin Quinson [Sun, 22 Nov 2015 23:45:22 +0000 (00:45 +0100)]
Fix Java build
java CPU surf binding used to register itself to the list of models that
must be called through shareResources directly. But this was useless
because CPU models are invoked from the host models (leading to
dupplicated lines in the tesh file).
Now that it is not possible anymore to register to that list of models
(which was removed), we must fix the java CPU surf binding.
Martin Quinson [Sun, 22 Nov 2015 23:08:33 +0000 (00:08 +0100)]
Simplify how shareResources() is called in each models
- Host->shareResources() is in charge of calling the ones of Cpu, Net
and Storage
- VM->shareResources() must be called after the Host one
So, don't make a list `model_list_invoke` of two elements that must be
called in a very specific order. Instead, directly call these methodes
in surf_solve().
A next step could be to put the content of Host->shareResources and
maybe VM->shareResources() in surf_solve so that Host and VM can stop
being resources just to dispatch calls to the real resources.
But L07 must be dealed with before (eg by moving the content of
Host07->shareResource() into Cpu07->shareResources() and leaving
Link07->shareResources() empty).
Gabriel Corona [Thu, 12 Nov 2015 11:21:31 +0000 (12:21 +0100)]
[mc] Merge Server class into ModelChecker
The distinction was mainly there because Server class was only useful
in split-process mode. Now the other mode does not exist and the
Server class is always used.
Gabriel Corona [Fri, 6 Nov 2015 13:49:16 +0000 (14:49 +0100)]
[mc] ptrace the model-checker application
The first goal is to be able to detect crashes of the model-checked
application in the model-checker. This first patch only implement the
ptrace but does not detect the crashed properly yet.
As we are using ptrace, we do not need to using messages to
stop/resume the model-checked application. The HELLO message is
removed whose only purpose was to synchronise the execution of the two
processes (wait for the model-checked application to be ready before
trying to read its memory map).
Martin Quinson [Fri, 6 Nov 2015 22:03:02 +0000 (23:03 +0100)]
[L07] Don't segfault on point-to-point communications
NetworkL07Model::communicate() tries to use host->executeParallelTask(2, ...)
(to change P2P comms into parallel tasks), but host was never
initialized. (fix #28)
Gabriel Corona [Tue, 3 Nov 2015 13:05:14 +0000 (14:05 +0100)]
[smpi] Use virtual memory layout to find the data segment
... Instead of extrating the position of the .data and .bss sections
with objdump:
* don't spawn a separate process (objdump);
* works even with PIE;
* works even without section header table;
* works even if weird sections are used;
* works at the segment granuality instead of the section granularity.
However some heuristic is used which might break in some cases: using
the help of the program header table would be a good idea (but would
add a dependency on ELF).
Currently only implemented on Linux but the SMPI privatisation was
only available on Linux anyway.