GithubHelp home page GithubHelp logo

simgrid / simgrid Goto Github PK

View Code? Open in Web Editor NEW
157.0 17.0 90.0 132.72 MB

MIRROR of the SimGrid framework, for the simulation of distributed applications (Clouds, HPC, Grids, IoT and others). Most of the dev occurs on FramaGit.

Home Page: https://framagit.org/simgrid/simgrid

License: Other

CMake 2.92% Perl 0.57% Shell 0.90% C 35.06% C++ 52.31% R 0.18% Python 2.70% Fortran 4.97% Roff 0.28% XSLT 0.07% sed 0.01% Makefile 0.03%
hpc clouds simgrid

simgrid's Introduction

PRs Welcome Build Status SonarCloud Status Doc License: LGPL v2.1 CII Best Practices

Welcome to the SimGrid project!

SimGrid is a scientific instrument to study the behavior of large-scale distributed systems such as Grids, Clouds, HPC or P2P systems. It can be used to evaluate heuristics, prototype applications or even assess legacy MPI applications.

Installation

Documentation: online; local copy. TL;DR:

cmake -DCMAKE_INSTALL_PREFIX=/opt/simgrid .
# Check the full list of options with `cmake -LH`
make
make install

More information

Online documentation or local version.

You can also ask your questions, or simply discuss with other users on to the SimGrid mattermost or on the #simgrid IRC channel of the oftc network.

Last, the main development of SimGrid is done on Framagit, but we also maintain a GitHub mirror and an Inria GitLab mirror,

Thanks for using our software. Please do great things with it and tell the world about it. Tell us, too, because we love to have positive feedback. Welcome to our community.

Cheers, Da SimGrid Team.

simgrid's People

Contributors

adegomme avatar adfaure avatar adriengougeon avatar agiersch avatar alegrand avatar bcamus avatar christopho avatar coldpeace avatar duanegris avatar ezibenroc avatar fabienchaix-forth avatar frs69wq avatar henricasanova avatar jbrv avatar jrouzaud avatar juliengossa avatar manzerbredes avatar marklee77 avatar maxwellpirtle avatar mommessc avatar mpoquet avatar mquinson avatar mwaplg avatar nagael avatar onesphore avatar pedrovelho avatar ptitpoulpe avatar schnorr avatar webcretaire avatar zitagcc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simgrid's Issues

Ancient XML files should be removed

Most examples and documentation elements use the files examples/platforms/platform.xml and examples/platforms/small_platform.xml

Unfortunately, these files are very very old, not showing any of the nice features of SimGrid platform description language, and in addition, they are really stupid, with some links being several orders of magnitude faster than others.

We should remove these files and all their variations. We should update the examples to not use these files, and we should update the doc to point to other files by default.

SD_exit should be made optional

A while ago, we removed the need to call MSG_clean() explicitely by using automatic destructors. It seems that this is still to be done in SD.

Msg seems completely broken

With an up-to-date ubuntu:

$ make test
The following tests FAILED:
16 - tesh-self-bg-set-signal (Failed)
17 - tesh-self-catch-signal (Failed)
21 - graphicator (Failed)
43 - tesh-msg-host-on-off-thread (Failed)
44 - tesh-msg-host-on-off-ucontext (Failed)
45 - tesh-msg-host-on-off-raw (Failed)
46 - tesh-msg-host-on-off-wait-thread (Failed)
47 - tesh-msg-host-on-off-wait-ucontext (Failed)
48 - tesh-msg-host-on-off-wait-raw (Failed)
49 - tesh-msg-host-on-off-recv-thread (Failed)
50 - tesh-msg-host-on-off-recv-ucontext (Failed)
51 - tesh-msg-host-on-off-recv-raw (Failed)
52 - tesh-msg-host-on-off-processes-thread (Failed)
53 - tesh-msg-host-on-off-processes-ucontext (Failed)
54 - tesh-msg-host-on-off-processes-raw (Failed)
64 - tesh-msg-storage-basic-thread (Failed)
65 - tesh-msg-storage-basic-ucontext (Failed)
66 - tesh-msg-storage-basic-raw (Failed)
70 - tesh-msg-trace-thread (Failed)
71 - tesh-msg-trace-ucontext (Failed)
72 - tesh-msg-trace-raw (Failed)
73 - msg-file (Failed)
74 - msg-storage (Failed)
75 - msg-remote-io (Failed)
76 - msg-start-kill-time (Failed)
77 - msg-chainsend (Failed)
90 - msg-suspend-thread (Failed)
91 - msg-suspend-ucontext (Failed)
92 - msg-suspend-raw (Failed)
93 - msg-suspend-boost (Failed)
94 - msg-pmm (Failed)
115 - msg-masterslave-no-crosstraffic-forwarder-thread (Failed)
116 - msg-masterslave-no-crosstraffic-forwarder-ucontext (Failed)
117 - msg-masterslave-no-crosstraffic-forwarder-raw (Failed)
118 - msg-masterslave-no-crosstraffic-forwarder-boost (Failed)
119 - msg-masterslave-no-crosstraffic-failure-thread (Failed)
120 - msg-masterslave-no-crosstraffic-failure-ucontext (Failed)
121 - msg-masterslave-no-crosstraffic-failure-raw (Failed)
122 - msg-masterslave-no-crosstraffic-failure-boost (Failed)
127 - msg-masterslave-forwarder-thread (Failed)
128 - msg-masterslave-forwarder-ucontext (Failed)
129 - msg-masterslave-forwarder-raw (Failed)
130 - msg-masterslave-forwarder-boost (Failed)
131 - msg-masterslave-failure-thread (Failed)
132 - msg-masterslave-failure-ucontext (Failed)
133 - msg-masterslave-failure-raw (Failed)
134 - msg-masterslave-failure-boost (Failed)
139 - msg-masterslave-cpu-ti-thread (Failed)
140 - msg-masterslave-cpu-ti-ucontext (Failed)
141 - msg-masterslave-cpu-ti-raw (Failed)
142 - msg-masterslave-cpu-ti-boost (Failed)
143 - msg-masterslave-vivaldi-thread (Failed)
144 - msg-masterslave-vivaldi-ucontext (Failed)
145 - msg-masterslave-vivaldi-raw (Failed)
146 - msg-masterslave-vivaldi-boost (Failed)
147 - msg-cloud-master-worker-vm-thread (Failed)
148 - msg-cloud-master-worker-vm-ucontext (Failed)
149 - msg-cloud-master-worker-vm-raw (Failed)
150 - msg-cloud-master-worker-vm-boost (Failed)
151 - msg-cloud-two-tasks-vm-thread (Failed)
152 - msg-cloud-two-tasks-vm-ucontext (Failed)
153 - msg-cloud-two-tasks-vm-raw (Failed)
154 - msg-cloud-two-tasks-vm-boost (Failed)
155 - msg-cloud-simple-vm-thread (Failed)
156 - msg-cloud-simple-vm-ucontext (Failed)
157 - msg-cloud-simple-vm-raw (Failed)
158 - msg-cloud-simple-vm-boost (Failed)
159 - msg-energy-pstates-thread (Failed)
160 - msg-energy-pstates-boost (Failed)
161 - msg-energy-consumption-thread (Failed)
162 - msg-energy-consumption-ucontext (Failed)
163 - msg-energy-consumption-raw (Failed)
164 - msg-energy-consumption-boost (Failed)
165 - msg-energy-onoff-thread (Failed)
166 - msg-energy-onoff-ucontext (Failed)
167 - msg-energy-onoff-raw (Failed)
168 - msg-energy-onoff-boost (Failed)
169 - msg-energy-vm-thread (Failed)
170 - msg-energy-vm-ucontext (Failed)
171 - msg-energy-vm-raw (Failed)
172 - msg-energy-vm-boost (Failed)
173 - msg-token-ring-thread (Failed)
174 - msg-token-ring-ucontext (Failed)
175 - msg-token-ring-raw (Failed)
176 - msg-token-ring-boost (Failed)
177 - msg-migration-thread (Failed)
178 - msg-migration-ucontext (Failed)
179 - msg-migration-raw (Failed)
180 - msg-migration-boost (Failed)
188 - msg-properties-thread (Failed)
189 - msg-properties-ucontext (Failed)
190 - msg-properties-raw (Failed)
191 - msg-properties-boost (Failed)
200 - msg-chord-no-crosstraffic-thread (Failed)
201 - msg-chord-no-crosstraffic-ucontext (Failed)
202 - msg-chord-no-crosstraffic-raw (Failed)
203 - msg-chord-no-crosstraffic-boost (Failed)
204 - msg-chord-no-crosstraffic-parallel-thread (Failed)
205 - msg-chord-no-crosstraffic-parallel-ucontext (Failed)
206 - msg-chord-no-crosstraffic-parallel-raw (Failed)
207 - msg-chord-thread (Failed)
208 - msg-chord-ucontext (Failed)
209 - msg-chord-raw (Failed)
210 - msg-chord-boost (Failed)
211 - msg-chord-parallel-thread (Failed)
212 - msg-chord-parallel-ucontext (Failed)
213 - msg-chord-parallel-raw (Failed)
214 - msg-bittorrent-thread (Failed)
215 - msg-bittorrent-ucontext (Failed)
216 - msg-bittorrent-raw (Failed)
217 - msg-bittorrent-boost (Failed)
218 - msg-bittorrent-parallel-thread (Failed)
219 - msg-bittorrent-parallel-ucontext (Failed)
220 - msg-bittorrent-parallel-raw (Failed)
221 - msg-kademlia-thread (Failed)
222 - msg-kademlia-ucontext (Failed)
223 - msg-kademlia-raw (Failed)
224 - msg-kademlia-boost (Failed)
225 - msg-kademlia-parallel-thread (Failed)
226 - msg-kademlia-parallel-ucontext (Failed)
227 - msg-kademlia-parallel-raw (Failed)
233 - tracing-trace-platform (Failed)
249 - tesh-parser-bogus-missing-gw (Failed)
251 - tesh-simdag-bypass (Failed)
252 - tesh-simdag-flatifier (Failed)
253 - tesh-simdag-link (Failed)
255 - tesh-simdag-parser (Failed)
256 - tesh-simdag-parser-sym-full (Failed)
276 - tesh-simdag-full-links01 (SEGFAULT)
277 - tesh-simdag-full-links02 (SEGFAULT)
278 - tesh-simdag-one-link-g5k (SEGFAULT)
279 - simdag-simdag (Failed)
281 - simdag-seq-access (Failed)
283 - simdag-fail (Failed)
284 - simdag-avail (Failed)
288 - simdag-prop (Failed)
292 - java-async (Failed)
293 - java-bittorrent (Failed)
294 - java-bypass (Failed)
295 - java-chord (Failed)
296 - java-cloud (Failed)
297 - java-cloud-migration (Failed)
298 - java-commTime (Failed)
299 - java-kademlia (Failed)
300 - java-kill (Failed)
301 - java-masterslave (Failed)
302 - java-migration (Failed)
303 - java-mutualExclusion (Failed)
304 - java-pingPong (Failed)
305 - java-priority (Failed)
306 - java-startKillTime (Failed)
307 - java-suspend (Failed)
308 - java-tracing (Failed)
309 - tesh-java-sleep-host-off (Failed)

Process autorestart seem to only work with CAS01 cpus

The global host_that_restart is used by surf to notify simix of all processes that restart at the current scheduling round.

First, relying on a global to return a result is rather ugly. Second, it should be done in the cpu_interface in order to work with any CPU model instead of being drown in the specific CAS01 model.

Test msg-exception is disabled

This test is expected to display a backtrace, which is not portable across computers (full path to source files is displayed). I seem to remember that there is a way to get "short" backtraces, but I am not sure and I've no idea of how.

The easier could be to change the test to avoid the backtrace (catch it and test programatically that it has the right form, whatever it may be).

MSG (ptask_L07) : segmentation fault on communication between processes

Hello,

My simulator doesn't work since commit eae2ca6. I tried to create a MWE and I finally got one, which is below. Has the way to communicate between processes changed with this commit?

MWE:

#include <stdio.h>

#include <simgrid/msg.h>

XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "mwe");

void send_message(const char *dst, void *data)
{
    msg_task_t task_sent = MSG_task_create(NULL, 0, 1e-6, data);
    XBT_INFO("message from '%s' to '%s'", MSG_process_get_name(MSG_process_self()), dst);
    MSG_task_send(task_sent, dst);
}

int submitter(int argc, char ** argv)
{
    send_message("server", NULL);
    // ...
    return 0;
}

int server(int argc, char ** argv)
{
    msg_task_t task_received = NULL;
    MSG_task_receive(&task_received, "server");
    void * data = MSG_task_get_data(task_received);
    // ...
    MSG_task_destroy(task_received);
    return 0;
}


int main(int argc, char ** argv)
{
    MSG_init(&argc, argv);
    MSG_config("host/model", "ptask_L07");

    const char * platform_filename = argv[1];
    MSG_create_environment(platform_filename);

    msg_host_t master_host = MSG_get_host_by_name("Jupiter");

    MSG_process_create("submitter", submitter, NULL, master_host);
    MSG_process_create("server", server, NULL, master_host);

    msg_error_t err = MSG_main();

    if (err == MSG_OK)
        printf("Okay.\n");
    else
        printf("Oops!\n");

    return 0;
}

Execution on commit 2b7c35f and before:

[0.000000] [surf_host/INFO] Switching to the L07 model to handle parallel tasks.
[Jupiter:submitter:(1) 0.000000] [mwe/INFO] message from 'submitter' to 'server'
Okay.

Execution on commit eae2ca6 and after:

[0.000000] [surf_host/INFO] Switching to the L07 model to handle parallel tasks.
[Jupiter:submitter:(1) 0.000000] [mwe/INFO] message from 'submitter' to 'server'
Segmentation fault.
Erreur de segmentation (core dumped)

Msg.ireceive without message in the mailbox gives strange results

This bug has been observed in java, but should be present in C as well. Observed on commit b23e1eb.

Making an ireceive on a mailbox while there is no message gives strange result.

String mailbox = "my_mailbox";
Task.listen(mailbox); // returns false
Task.irecv(mailbox); // returns non-null Comm ; expected : null
Task.listen(mailbox); // returns true ; expected : false

All subsequent calls to listen returns true on this mailbox.
Calling Comm.waitCompletion() on the Comm object returned by Task.irecv causes a "deadlock" according to the logged message.

No MSG_comm_waitany in Java

The equivalent of this function that allows developers to implement multiple "listeners" in a single process is missing in the Java binding.

something like
Vector myListeners = new Vector();
[...]
int completedOne = myListeners.waitAny()

would be awesome!

Thx.

Energy is unimplemented for model ptask_L07

Hello,

I would like to use the energy plugin of SimGrid but it looks ilke it is not implemented for the ptask_L07 model at the moment. Do you plan to implement it soon ? It is more a feature request than an issue but I did not know where it should be put...

ptask_L07 energy hello world:

#include <stdio.h>
#include <simgrid/msg.h>
#include <simgrid/plugins.h>

int main(int argc, char ** argv)
{
    sg_energy_plugin_init();
    MSG_init(&argc, argv);

    // Without the following line, everything works
    MSG_config("host/model", "ptask_L07");

    const char * platform_filename = argv[1];
    MSG_create_environment(platform_filename);

    xbt_dynar_t all_hosts = MSG_hosts_as_dynar();
    msg_host_t host;
    unsigned int i;

    xbt_dynar_foreach(all_hosts, i, host)
    {
        printf("Host %s has %d pstates\n",
            MSG_host_get_name(host),
            MSG_host_get_nb_pstates(host));
    }

    msg_error_t err = MSG_main();

    if (err == MSG_OK)
        printf("Okay.\n");
    else
        printf("Oops!\n");

    return 0;
}

Execution with energy_platform.xml as parameter:

[0.000000] [surf_host/INFO] Switching to the L07 model to handle parallel tasks.
** SimGrid: UNCAUGHT EXCEPTION received on ./a.out(0): category: unknown error; value: 0
** Function getNbPstates unimplemented
** Thrown by () in this process
[0.000000] /home/carni/proj/simgrid-dev/src/xbt/ex.c:148: [xbt_ex/CRITICAL] Function getNbPstates unimplemented

**   In _ZN6CpuL0712getNbPstatesEv() at /home/carni/proj/simgrid-dev/src/surf/host_ptask_L07.hpp:124
**   In SIMIX_simcall_handle() at /home/carni/proj/simgrid-dev/src/simix/popping_generated.c:375
**   In simcall_BODY_host_get_nb_pstates() at /home/carni/proj/simgrid-dev/src/simix/popping_bodies.c:268
**   In main() at /home/carni/proj/test/simgrid_bug/unimplemented.c:21 (discriminator 3)

Execution with energy_platform.xml as parameter (but without the "host/model" being overwritten):

Host MyHost1 has 3 pstates
Host MyHost2 has 1 pstates
Okay.
[0.000000] [surf_energy/INFO] Total energy of host MyHost1: 0.000000 Joules
[0.000000] [surf_energy/INFO] Total energy of host MyHost2: 0.000000 Joules

javadoc is necessary to build the doc, even if we don't build java

Hello,

when building the documentation, (cmake -Denable_documentation=true), javadoc is mandatory even if java is not enabled (-Denable_java=false). In that case, if javadoc is not to be found the compilation process fails and stops.

We should test for javadoc (and use it) only if java is enabled.

[MC] Catch unexpected termination of the client (with ptrace)

The current version of the model-checker is not able to detect and handle properly the unexpected termination of the model-checked process (segfault, etc.): the model-checked application dies and the model-checker continue to work without noticing it. At some point, it tries to read from the model-checked memory which fails (because the model-checked is dead).

We should probably ptrace() the model-checked (by default):

  • ability to detect when the model-checked dies;
  • ability to get the state of the model-checked when it dies (such as the recorded path in order to replay it outside of the model-checker).

Cleaner snapshoting logic

Another benefit of using ptrace() is that we would implement a cleaner snapshoting/restoration logic. Currently, it relies on the fact that the (single) thread is declutching from the application contexts by switching to a specific non-snapshoted maestro stack (this maestro process not touch snapshoted data during snapshot/restores). With ptrace, we could just freeze the thread(s) and restore them as well.

Debugging of the model-checked

However, if we ptrace() the model-checked we won't be able to attach it with a debugger (because a process can only be ptraced by a single tracer):

  • either make the ptrace support optional (short-term solution);
  • or (in the long term), let the model-checker expose a GDB-compatible socket-based debugging API (which could then be extended to add additional features -- see rr for a similar project implementing this idea).

Task.listen doesn't work on async mailbox

It seems that Task.listen is broken on async mailbox as it always return false.
Here is a small example giving the wrong result. Waiting before listening doesn't change the result.

Main.java :

package irecvTest2;

import org.simgrid.msg.Msg;

public class Main{

    public static void main(String[] args) {
        Msg.init(args);

        String platf = "platform.xml";
        String deploy = "deploy.xml";

        Msg.createEnvironment(platf);
        Msg.deployApplication(deploy);

        Msg.run();
    }

}

Test.java :

package irecvTest2;

import org.simgrid.msg.Host;
import org.simgrid.msg.MsgException;
import org.simgrid.msg.Process;
import org.simgrid.msg.Task;

public class Test extends Process {

    public Test(Host host, String name, String[] args) {
        super(host, name, args);
    }


    @Override
    public void main(String[] args) throws MsgException {       
        new Task("a", 0, 0).isend("ma_mailbox");
        System.out.println(Task.listen("ma_mailbox")); // True

        Host.setAsyncMailbox("ma_mailbox2");
        new Task("b", 0, 0).isend("ma_mailbox2");
        System.out.println(Task.listen("ma_mailbox2")); // False, but message "b" is in the mailbox, expecting true
    }
}

platform.xml :

<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
    <AS id="theservers" routing="Full">
        <host id="server_0" power="100Gf" />
        <link id="server_0_link" bandwidth="10GBps" latency="50us" />
        <router id="server_router" />
        <route src="server_0" dst="server_router" symmetrical="YES">
            <link_ctn id="server_0_link" />
        </route>
    </AS>
</platform>

deploy.xml :

<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
  <process host="server_0" function="irecvTest2.Test">
  </process>
</platform>

Simgrid+Java aborts on FreeBSD

(gdb) bt
#0  0x0000000800cc064c in thr_kill () from /lib/libc.so.7
#1  0x0000000800d64c4b in abort () from /lib/libc.so.7
#2  0x0000000802870ea4 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libsupc++.so.1
#3  0x0000000802875473 in std::set_unexpected () from /usr/lib/libsupc++.so.1
#4  0x00000008028754b3 in std::terminate () from /usr/lib/libsupc++.so.1
#5  0x000000080287541a in __cxa_throw () from /usr/lib/libsupc++.so.1
#6  0x0000000818d3d8ee in boost::throw_exception () from /var/tmp/simgrid-743603178807308728.tmp
#7  0x0000000818d3d84e in boost::unordered::detail::table_impl, std::__1::allocator > const, Link*> >, std::__1::basic_string, std::__1::allocator >, Link*, boost::hash, std::__1::allocator > >, std::__1::equal_to, std::__1::allocator > > > >::at () from /var/tmp/simgrid-743603178807308728.tmp
#8  0x0000000818d33b6c in Link::byName () from /var/tmp/simgrid-743603178807308728.tmp
#9  0x0000000818d2ec87 in NetworkCm02Model::createLink () from /var/tmp/simgrid-743603178807308728.tmp
#10 0x0000000818d2eb2f in NetworkCm02Model::NetworkCm02Model () from /var/tmp/simgrid-743603178807308728.tmp
#11 0x0000000818d2e501 in surf_network_model_init_LegrandVelho () from /var/tmp/simgrid-743603178807308728.tmp
#12 0x0000000818d9dd7f in surf_host_model_init_current_default () from /var/tmp/simgrid-743603178807308728.tmp
#13 0x0000000818cf4f43 in surf_config_models_setup () from /var/tmp/simgrid-743603178807308728.tmp
#14 0x0000000818d4dd5b in sg_platf_new_AS_begin () from /var/tmp/simgrid-743603178807308728.tmp
#15 0x0000000818d7c317 in surf_parse_lex () from /var/tmp/simgrid-743603178807308728.tmp
#16 0x0000000818d985e0 in parse_platform_file () from /var/tmp/simgrid-743603178807308728.tmp
#17 0x0000000818d01b62 in SIMIX_create_environment () from /var/tmp/simgrid-743603178807308728.tmp
#18 0x000000081990b2d9 in Java_org_simgrid_msg_Msg_createEnvironment () from /var/tmp/simgrid-java-4307680542500182031.tmp
#19 0x00000008030c9f70 in ?? ()
#20 0x0000000806818f18 in ?? ()
#21 0x0000000806870fc8 in ?? ()
#22 0x00007fffffbfd9e0 in ?? ()
#23 0x00000008130b8b70 in ?? ()
#24 0x00007fffffbfda40 in ?? ()
#25 0x00000008130b9210 in ?? ()
#26 0x0000000000000000 in ?? (

This is weird as Link::byName() is supposed to catch this exception:

Link *Link::byName(const char* name) {
      Link * res = NULL;
      try {
          res = links->at(name);
      } catch (std::out_of_range& e) {}

      return res;
}

Host.all() is filled with null

It is impossible to get the hosts using Host.all() or Host.getByName() : both return null instead of Host.
However, Host.all() has the right size.

For instance:
Msg.info("Test : "+Host.all().length+" "+Host.all()[0]);
[controller:cloudmasterslave.Master:(1) 0.000000] [jmsg/INFO] Test : 5 null

Missing PMPI_Comm_set_errhandler in smpi

Hi all,

With Arnaud Giersch we tried to compile Petsc with smpi.
After some difficulties we succeed to compile it. When we run an example of petsc, it fails with the message : MPI_Comm_set_errhandler Not yet implemented
Is it possible to implement it?
Maybe other mpi functions will be needed after...

Thanks in advance,

Raphaรซl Couturier

msg_get_host_msgload should be implemented or removed

At some point, we killed the implementation of that function and added a THROW_UNIMPLEMENTED instead. I seem to remember that it was during the conversion to simix2, but anyway.

Such function is a trap for our users: it should either be removed [from the documentation], or actually implemented.

MSG_process_create called from user code causes abort when tracing/msg/process is enabled

Run the following code with --cfg=tracing:1 --cfg=tracing/msg/process:1 to reproduce this issue.

The problem appears because the call to MSG_process_create from outside the maestro process causes a yield, not giving the opportunity to the tracer register the creation of this process. The task is executed right way, giving the following error:

[poa:Thread:(2) 0.000000] /home/schnorr/workspace/simgrid.git2/src/xbt/ex.c:148: [xbt_ex/CRITICAL] container with name Thread-2 not found

**   In PJ_container_get() at /home/schnorr/workspace/simgrid.git2/src/instr/instr_paje_containers.c:146
**   In TRACE_msg_task_execute_start() at /home/schnorr/workspace/simgrid.git2/src/msg/instr_msg_task.c:53
**   In MSG_parallel_task_execute() at /home/schnorr/workspace/simgrid.git2/src/msg/msg_gos.c:57
**   In MSG_task_execute() at /home/schnorr/workspace/simgrid.git2/src/msg/msg_gos.c:31
**   In slave_th() at /home/schnorr/SimGrid_Paje_debug/main.c:7
**   In smx_ctx_raw_wrapper() at /home/schnorr/workspace/simgrid.git2/src/simix/smx_context_raw.c:391
Aborted

main.c

#include <simgrid/msg.h>

int slave_th(int argc, char *argv[])
{  
  msg_task_t argument = (msg_task_t) MSG_process_get_data(MSG_process_self());
  MSG_task_execute(argument);
  MSG_task_destroy(argument);
  return 0;
}                

int slave(int argc, char *argv[])
{
  msg_task_t task = MSG_task_create("Task", 0, 0, NULL);
  MSG_process_create("Thread", slave_th, task, MSG_host_self()); 
  return 0; 
}

int main(int argc, char *argv[])
{
  msg_error_t res = MSG_OK;
  MSG_init(&argc, argv);
  MSG_create_environment("my_platform.xml");
  MSG_function_register("slave", slave);
  MSG_launch_application("my_deployment.xml");
  res = MSG_main();
  if (res == MSG_OK)
    return 0;
  else
    return 1;
}                               

my_platform.xml

<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
<AS  id="AS0"  routing="Full">
   <host id="poa" power="48Gf" core="10"/>
</AS>
</platform>

my_deployment.xml

<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
  <process host="poa" function="slave"/>
</platform>

CMake doesn't correctly check for valgrind and graphviz

I installed Debian Testing on my new system and ran cmake, which returned without problems. I then ran make and after 3%, I get these errors:

src/simdag/sd_dotloader.c:20:29: fatal error: graphviz/cgraph.h: No such file or directory

src/simix/smx_context.c:32:32: fatal error: valgrind/valgrind.h: No such file or directory

Shouldn't cmake already tell me that I am missing these libraries?

PSG should probably be integrated

PeerSimGrid is an SimGrid interface mimicking PeerSim. This is very valuable as PeerSim still enjoys a rather large user base (in the P2P community), but that software is not maintained anymore since 2005.
https://gforge.inria.fr/projects/psg/

Integrating it properly in SimGrid should not add much maintainance burden to us, and would ensure that it keeps up to date with the changes in SimGrid.

java.lang.UnsatisfiedLinkError on simgrid 3.12 jar for

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/simgrid-java5420305011244000193/libsimgrid.so: libboost_context.so.1.55.0: cannot open shared object file: No such file or directory

The simgrid 3.12 jar seems to have dependancy on libboost_context.so (on Linux amd64 at least).
It may be a good idea to ship it with the jar.

Energy : infinite loop if no power range properties are specified for a host

Hello,

When using the energy plugin, if the watt_per_state property of one host is not specified in the platform file, the MWE below goes into an infinite loop and I think this behaviour is not wanted. The results were obtained with simgrid revision 1ea2b84 (2015-09-22).

MWE :

#include <stdio.h>
#include <simgrid/msg.h>
#include <simgrid/plugins.h>

int main(int argc, char ** argv)
{
    sg_energy_plugin_init();
    MSG_init(&argc, argv);

    const char * platform_filename = argv[1];
    MSG_create_environment(platform_filename);

    msg_error_t err = MSG_main();

    if (err == MSG_OK)
        printf("Okay.\n");
    else
        printf("Oops!\n");

    return 0;
}

Execution with energy_platform.xml (all hosts are fully specified) :

Okay.
[0.000000] [surf_energy/INFO] Total energy of host MyHost1: 0.000000 Joules
[0.000000] [surf_energy/INFO] Total energy of host MyHost2: 0.000000 Joules

Execution with small_platform.xml (all hosts are NOT specified at all) :

Okay.
** SimGrid: UNCAUGHT EXCEPTION received on ./a.out(0): category: unknown error; value: 0
** No power range properties specified for host Fafard
** Thrown by () in this process
[0.000000] /home/carni/proj/simgrid-dev/src/xbt/ex.c:148: [xbt_ex/CRITICAL] No power range properties specified for host Fafard
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes

** SimGrid: UNCAUGHT EXCEPTION received on ./a.out(0): category: unknown error; value: 0
** Assertion dict failed
** Thrown by () in this process
[0.000000] /home/carni/proj/simgrid-dev/src/xbt/ex.c:148: [xbt_ex/CRITICAL] Assertion dict failed
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes

** SimGrid: UNCAUGHT EXCEPTION received on ./a.out(0): category: unknown error; value: 0
** Assertion dict failed
** Thrown by () in this process
[0.000000] /home/carni/proj/simgrid-dev/src/xbt/ex.c:148: [xbt_ex/CRITICAL] Assertion dict failed
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes

** SimGrid: UNCAUGHT EXCEPTION received on ./a.out(0): category: unknown error; value: 0
** Assertion dict failed
** Thrown by () in this process
[0.000000] /home/carni/proj/simgrid-dev/src/xbt/ex.c:148: [xbt_ex/CRITICAL] Assertion dict failed
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes
/usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes

etc.

Change the smpirun script to make the -wrapper option more intuitive

If a developer wants to use gdb interactively with smpirun, he has to add

-wrapper "gdb --args" -foreground

It is quite unintuitive that the -foreground option is necessary and I believe we should fix that. Unfortunately, @randomstuff argues that there are use cases where "-foreground" is not wanted with -wrapper; a -gdb option is also not a solution since -wrapper is useful with many tools.

Background: The -foreground option was introduced by @randomstuff in fefd7e2 to make sure that sub-processes terminate before the script terminates (if it receives a signal); otherwise, they would become zombies after they terminated. We did have many zombies on the CI servers, so this change was introduced.

Thanks @stanisic for reporting this issue.

Thread safety issue with `SIMIX_process_cleanup()`

While trying to find the root cause of the occasional failure of the kademlia test, I found a thread-safety issue:

#7  0x00007ffff79a9b6d in xbt_swag_remove (obj=0x61c2c0, swag=0x60d9b0) at /home/corona/workspace/simgrid/src/xbt/swag.c:141
#8  0x00007ffff78878a9 in SIMIX_process_cleanup (process=0x61c2c0) at /home/corona/workspace/simgrid/src/simix/smx_process.c:96
#9  0x00007ffff78473a5 in MSG_process_cleanup_from_SIMIX (smx_proc=0x61c2c0) at /home/corona/workspace/simgrid/src/msg/msg_process.c:52
#10 0x00007ffff7877ed8 in smx_ctx_base_stop (context=0x61c410) at /home/corona/workspace/simgrid/src/simix/smx_context_base.c:89
#11 0x00007ffff797d31f in smx_ctx_sysv_stop_parallel (context=0x61c410) at /home/corona/workspace/simgrid/src/simix/smx_context_sysv.c:242
#12 0x00007ffff797d0bd in smx_ctx_sysv_wrapper (first=6407184) at /home/corona/workspace/simgrid/src/simix/smx_context_sysv.c:191
#13 0x00007ffff679cf60 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#14 0x0000000000000000 in ?? ()

When running in parallel mode all worker threads can call the SIMIX_process_cleanup() concurrently which does things such as:

XBT_DEBUG("%p should not be run anymore",process);
xbt_swag_remove(process, simix_global->process_list);
xbt_swag_remove(process, SIMIX_host_priv(process->smx_host)->process_list);
xbt_swag_insert(process, simix_global->process_to_destroy);

The SWAG are modified concurrently by the worker threads without synchronization. In some cases, they go into inconsistent states (for example, swag->count is no more consistent with the number of elements really in the swag).

The code above those lines might need synchronization as well.

Shall we just add some synchronization here or should this really be done in the maestro (and not in the workers)?

File Host.cpp is not installed by CMake

I just built and installed commit 3cfe66e and it worked.
However, when compiling my simulator, Host.cpp seems to be missing.
The file is in the git tree but does not seem to be installed by CMake. Hacking my CPLUS_INCLUDE_PATH environment variable allowed me to compile successfully.

In file included from /usr/include/simgrid/msg.h:13:
In file included from /usr/include/simgrid/simix.h:16:
In file included from /usr/include/simgrid/platf.h:13:
/usr/include/simgrid/host.h:18:10: fatal error: 'simgrid/Host.hpp' file not found
#include <simgrid/Host.hpp>

simgrid_full.jar broken on Mac OSX

simgrid_full.jar contains the native libraries so that you can use SimGrid as if it were a pure Java library. We need to embeed both libsimgrid and libsimgrid-java. (side note: that's split to allow the construction of two binary packages on Debian, allowing the users to depend on java only if they need it).

The trick is that at startup, we try to load the libraries on disk, and if not found, we use the ones included in the jar file. That's done here: https://github.com/mquinson/simgrid/blob/master/src/bindings/java/org/simgrid/NativeLib.java#L37

On some operating systems, we load the lib directly from the jarfile (from memory), but some other operating systems (Mac OSX) forbid it. As a result, we have to write it on disk before loading it. We do so in a temporary directory, and we clean it automatically at shutdown. All this is the purpose of the loadLib function, here: https://github.com/mquinson/simgrid/blob/master/src/bindings/java/org/simgrid/NativeLib.java#L72

To complicate the debug, our testing infrastructure is not good on Mac OSX. http://ci.inria.fr/ does not provide any Mac daemon at the current time. Travis says to be at capacity for this arch and does not accept any new project on that arch. We only have one machine located in Nancy on which we can test. A cron table still pushes the results to http://cdash.inria.fr/CDash/index.php?project=SimGrid but it sometimes fails for other reasons.

That is why we didnt detect earlier that we get the following warning at config time:

CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

 simgrid
 simgrid-java

This warning is for project developers. Use -Wno-dev to suppress it.

The meaning of this warning is given here: http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH In short, that because libraries contain the full path to their dependencies on Mac. I guess that it's to allow the installation of several version of the same library, similarly to Gentoo multihoming. Even if that functionality may be good for users in general, it breaks our trick of unpacking the native lib to a temporary path before loading it.

The cmake link above explains that we have to choose how we want to install our libs, depending on how our application will use them, and provides several configuration flavors. At the end, the fix should be easy, as it was done for another project here: Nuand/bladeRF@58d4870

The Java tests on that build daemon seem to work, even if they are marked broken because of debug messages about the locations of native libraries loaded. (side note: I fail to see where they are produced, which bugs me). It seems to me that we are testing against the simgrid_full library and not the simgrid.jar one (https://github.com/mquinson/simgrid/blob/master/buildtools/Cmake/AddTests.cmake#L526) so I guess that the thing is finding the external libs and not trying to use the internal ones. I'm not sure of how to make our test more robust here.

So we have several bugs here:

  • RPATH not set in a way that allows simgrid_full (and I dunno how to do that yet)
  • debug messages breaking the tests for nothing
  • Testing infrastructure not robust to the fact that simgrid_full gets unable to load internal libs

Cannot build SimGrid 3.12 on mac

Hi,
Iโ€™m trying to install SimGrid 3.12 on mac book pro, I have downloaded the source and when I used clang compiler to compile it, i got a lot of file not found errors, so I used GNU C compiler, in the terminal I wrote ,
โ€œcmake -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=G++-5 -DCC=gcc-5 -DCXX=g++-5 -DCMAKE_INSTALL_PREFIX=/opt/simgrid .โ€

and the output is
โ€œ Cmake version 3.4.3
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/local/bin/gcc-5
-- Check for working C compiler: /usr/local/bin/gcc-5 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/G++-5
-- Check for working CXX compiler: /usr/local/bin/G++-5 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning (dev) at /usr/local/Cellar/cmake/3.4.3/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:88 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.

Quoted variables like "CXX" will no longer be dereferenced when the policy
is set to NEW. Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.4.3/share/cmake/Modules/CMakeTestCXXCompiler.cmake:68 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:5 (project)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Performing Test HAVE_C_STACK_CLEANER
-- Performing Test HAVE_C_STACK_CLEANER - Failed
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_C11
-- Performing Test COMPILER_SUPPORTS_C11 - Success
-- Found Perl: /usr/bin/perl (found version "5.18.2")
-- System processor: x86_64 (x86_64, 64 bits)
-- Looking for agraph.h
-- Looking for agraph.h - not found
-- Looking for cgraph.h
-- Looking for cgraph.h - found
-- Looking for graph.h
-- Looking for graph.h - not found
-- Looking for lib agraph
-- Looking for lib agraph - not found
-- Looking for lib cgraph
-- Looking for lib cgraph - found
-- Looking for lib graph
-- Looking for lib graph - not found
-- Looking for lib cdt
-- Looking for lib cdt - found
-- Looking for sigc++/sigc++.h
-- Looking for sigc++/sigc++.h - not found
-- Looking for sigc++config.h
-- Looking for sigc++config.h - not found
-- Looking for libsigc++
-- Looking for libsigc++ - not found
-- Boost version: 1.60.0
-- Boost version: 1.60.0
-- Found the following Boost libraries:
-- context
Found Boost.Context API v2
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for backtrace in execinfo
-- Looking for backtrace in execinfo - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for sem_init in pthread
-- Looking for sem_init in pthread - found
-- Looking for sem_open in pthread
-- Looking for sem_open in pthread - found
-- Looking for sem_timedwait in pthread
-- Looking for sem_timedwait in pthread - not found
-- Looking for pthread_mutex_timedlock in pthread
-- Looking for pthread_mutex_timedlock in pthread - not found
-- Looking for 4 include files stdlib.h, ..., float.h
-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for socket.h
-- Looking for socket.h - not found
-- Looking for stat.h
-- Looking for stat.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/ptrace.h
-- Looking for sys/ptrace.h - not found
-- Looking for windows.h
-- Looking for windows.h - not found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/sysctl.h
-- Looking for sys/sysctl.h - found
-- Looking for time.h
-- Looking for time.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for ucontext.h
-- Looking for ucontext.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for linux/futex.h
-- Looking for linux/futex.h - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for getdtablesize
-- Looking for getdtablesize - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for readv
-- Looking for readv - found
-- Looking for popen
-- Looking for popen - found
-- Looking for signal
-- Looking for signal - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for asprintf
-- Looking for asprintf - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for makecontext
-- Looking for makecontext - found
-- Looking for process_vm_readv
-- Looking for process_vm_readv - not found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for bin gfortran
-- SMPI Fortran is disabled on Windows and MacOS platforms. Please contact the SimGrid team if you need it.
-- Fortran support for smpi is disabled.
-- Warning: no support for SMPI automatic privatization on this platform
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- We are using GNU dynamic linker
-- sem_open is compilable
-- sem_open is executable
/Users/abdelazi/simgrid/tools/cmake/test_prog/prog_sem_init.c: In function 'main':
/Users/abdelazi/simgrid/tools/cmake/test_prog/prog_sem_init.c:15:3: warning: 'sem_init' is deprecated [-Wdeprecated-declarations]
if (sem_init(&s, 0, 0) != 0)
^
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/semaphore.h:29:0,
from /Users/abdelazi/simgrid/tools/cmake/test_prog/prog_sem_init.c:10:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/semaphore.h:55:5: note: declared here
int sem_init(sem_t *, int, unsigned int) __deprecated;
^
-- sem_init is compilable
-- Bin /Users/abdelazi/simgrid/sem_init exists!
-- Warning: sem_init not executable
-- Compilation output: ''
-- Exit result of sem_init: 1
-- Support for thread context factory
-- Git version: 7f819b2 more cleanups in XML files
-- Git date: 2016-02-18 14:14:03 +0100
-- LTO does not seem usable -- try updating your build chain.
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.8.11")
-- Doxygen version: 1.8.11

Configuration of package `simgrid':
BUILDNAME ...................: APPLE
SITE ........................: Darwin_15.3.0_x86_64
Release .....................: simgrid-3.13-devel (release build)

    Compiler: C .................: /usr/local/bin/gcc-5 (GNU)
            version .............: 5.2.0
    Compiler: C++ ...............: /usr/local/bin/G++-5 (GNU)
            version .............: 5.2.0
    Linker: .....................: /usr/bin/ld
            version .............: 

    CFlags ......................:  -g3 -std=gnu11   -O3 -funroll-loops -fno-strict-aliasing  -finline-functions   -D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE
    CXXFlags ....................:  -g3 -std=gnu++11 -O3 -funroll-loops -fno-strict-aliasing  -finline-functions 
    LDFlags .....................: -Wl,-search_paths_first -Wl,-headerpad_max_install_names
    with LTO ....................: OFF

    Compile NS-3 ................: NO  (hint: )
    Compile Java ................: NO
    Compile Scala................: 
    Compile Lua .................: 
    Compile Smpi ................: 1
    Compile MPI testsuite .......: OFF
    Compile Smpi f77 ............: 0
    Compile Smpi f90 ............: 0
    Compile Boost.Context support: 2

    Maintainer mode .............: OFF
    Documentation................: ON
    Model checking ..............: 0
    Tracing mode ................: ON
    Jedule  mode ................: OFF
    Latency bound ...............: OFF
    Graphviz mode ...............: 1
    Sigc++ mode .................: 0
    Mallocators .................: ON

    Simgrid dependencies ........: -lm /usr/local/lib/libboost_context-mt.dylib -lcgraph -Wl,-U -Wl,_smpi_simulated_main

    INSTALL_PREFIX ..............: /opt/simgrid

-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

simgrid

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

CC

โ€œ

After that I typed make and it stopped at 5%
โ€œ[ %5 ] Building CXX object CMakeFiles/simgrid.dir/src/simdag/sd_dotloader.cpp.o
In file included from /Users/abdelazi/simgrid/include/xbt/sysdep.h:14:0,
from /Users/abdelazi/simgrid/include/xbt.h:13,
from /Users/abdelazi/simgrid/include/simgrid/forward.h:10,
from /Users/abdelazi/simgrid/include/simgrid/link.h:12,
from /Users/abdelazi/simgrid/include/simgrid/simdag.h:14,
from /Users/abdelazi/simgrid/src/simdag/simdag_private.h:11,
from /Users/abdelazi/simgrid/src/simdag/sd_dotloader.cpp:7:
/Users/abdelazi/simgrid/src/simdag/sd_dotloader.cpp: In function 'xbt_dynar_s* SD_dotload_generic(const char_, seq_par_t, bool)':
/Users/abdelazi/simgrid/src/simdag/sd_dotloader.cpp:251:101: error: 'basename' was not declared in this scope
XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", basename((char_)filename));
^
/Users/abdelazi/simgrid/include/xbt/log.h:649:40: note: in definition of macro XBT_ERROR'
_xbt_log_event_log(&_log_ev, VA_ARGS);
^
make[2]: *** [CMakeFiles/simgrid.dir/src/simdag/sd_dotloader.cpp.o] Error 1
make[1]: *** [CMakeFiles/simgrid.dir/all] Error 2
make: *** [all] Error 2โ€

anyone can help ?

GDB stub for SimGrid

By implementing a GDB stub in the model-checker we would be able to easily compare different snapshots from GDB. This would be very valuable in order to understand/fix the state comparison.

A GDB stub might be used to make GDB aware of the contexts.

We need a new context factory for Mac OSX

The support for swapcontext was removed from OSX 10.9 by Apple, so simgrid is unable to compile out of the box on these machines (this function was removed from posix 2008).

We could try to change the cmake stuff to pick the raw assembly contexts on Mac too (these are amd64 processors after all).

We could devise a new factory based on Boost.Context. Boost would be better than us at maintaining our portability layer.

See also https://lists.gforge.inria.fr/pipermail/simgrid-user/2015-June/003708.html

dijkstra don't like symmetrical routes

The following platform file triggers a segfault in the parsing code (tested with the flatifier)

<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
<platform version="4">
   <AS id="AS_2" routing="Dijkstra">
     <host id="AS_2_host1" speed="1000000000"/>
     <link id="AS_2_link1" bandwidth="1250000000" latency="5E-4"/>
     <router id="central_router"/>
     <route src="central_router" dst="AS_2_host1"><link_ctn id="AS_2_link1"/></route>
   </AS>
</platform>

The backtrace is:

==22531== Invalid read of size 8
==22531==    at 0x5317E54: simgrid::surf::AsDijkstra::addRoute(s_sg_platf_route_cbarg*) (surf_routing_dijkstra.cpp:350)
==22531==    by 0x52D6428: sg_platf_new_route (sg_platf.cpp:503)
==22531==    by 0x533195A: ETag_surfxml_route (surfxml_sax_cb.cpp:764)

It seems that the current code is unable to detect whether a given edge was already given or not. We disabled that detection in the direct case, and this is what happens when the code for symmetrical==true tries to detect it anyway.

The proposed fix is to reimplement completely that algorithm, killing xbt_graph on the way. Also, only the cached version needs to be included in a released software...

Cannot use simgrid_full.jar on Linux

It seems I'm having a similar issue to #5 on my Debian box if I'm trying to use the simgrid_full.jar (instead of relying of systemwide simgrid .so) files:

$ java -cp .:simgrid_full.jar kademlia.Kademlia ../platforms/platform.xml kademlia/kademlia.xml
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/simgrid-java-8378003860515004911.tmp: libsimgrid.so.3.12: Ne peut ouvrir le fichier d'objet partagรฉ: Aucun fichier ou dossier de ce type
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
    at java.lang.Runtime.load0(Runtime.java:795)
    at java.lang.System.load(System.java:1062)
    at org.simgrid.NativeLib.loadLib(NativeLib.java:89)
    at org.simgrid.NativeLib.nativeInit(NativeLib.java:43)
    at org.simgrid.msg.Msg.nativeInit(Msg.java:20)
    at org.simgrid.msg.Msg.(Msg.java:25)
    at kademlia.Kademlia.main(Kademlia.java:16)

This happen when trying to load libsimgrid-java:

NativeLib.nativeInit("simgrid");
NativeLib.nativeInit("simgrid-java");

There is no libsimgrid.so.3.12 in the JAR anyway, only libsimgrid.so.

[MC] please provide an option to make MPI_Send asynchronous

When there is enough underlying buffering, this operation becomes asynchronous and non-blocking. It would thus be useful in practice to study the application behavior when this hypothesis holds, before moving to the harder case where it does not hold.

Thanks,

Typo in simgrid-smpi-101.pdf

Hello,

The page 10 of simgrid-smpi-101.pdf talks about setting --cfg=smpi/privatize_global_variables=yes but SimGrid says that ':' should be used instead of '='.

MSG (ptask_L07) : segmentation fault on communication between processes

My simulator does not work on the latest dev version (commit da53a4f).
I was not to able to compile commit da53a4f directly so I changed the line 194 of src/simix/BoostContext.cpp :

-    &boost_maestro_context_->fc_, this->fc_,
+    &maestro_context_->fc_, this->fc_,

The following MWE reproduces the same problem.
The MWE is the same as in issue 28 but I couldn't reopen it.

MWE

#include <stdio.h>

#include <simgrid/msg.h>

XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "mwe");

void send_message(const char *dst, void *data)
{
    msg_task_t task_sent = MSG_task_create(NULL, 0, 1e-6, data);
    XBT_INFO("message from '%s' to '%s'", MSG_process_get_name(MSG_process_self()), dst);
    MSG_task_send(task_sent, dst);
}

int submitter(int argc, char ** argv)
{
    send_message("server", NULL);
    // ...
    return 0;
}

int server(int argc, char ** argv)
{
    msg_task_t task_received = NULL;
    MSG_task_receive(&task_received, "server");
    void * data = MSG_task_get_data(task_received);
    // ...
    MSG_task_destroy(task_received);
    return 0;
}


int main(int argc, char ** argv)
{
    MSG_init(&argc, argv);
    MSG_config("host/model", "ptask_L07");

    const char * platform_filename = argv[1];
    MSG_create_environment(platform_filename);

    msg_host_t master_host = MSG_get_host_by_name("Jupiter");

    MSG_process_create("submitter", submitter, NULL, master_host);
    MSG_process_create("server", server, NULL, master_host);

    msg_error_t err = MSG_main();

    if (err == MSG_OK)
        printf("Okay.\n");
    else
        printf("Oops!\n");

    return 0;
}

Build

clang -lsimgrid mwe.c -o mwe
#gcc -lsimgrid mwe.c -o mwe

Using either clang3.7.0-6 or gcc5.3.0-2 produces the same problem.

Execution

./mwe small_platform.xml

Output

[0.000000] [surf_host/INFO] Switching to the L07 model to handle parallel tasks.
[Jupiter:submitter:(1) 0.000000] [mwe/INFO] message from 'submitter' to 'server'
Access violation detected.
This can result from a programming error in your code or, although less likely,
from a bug in SimGrid itself.  This can also be the sign of a bug in the OS or
in third-party libraries.  Failing hardware can sometimes generate such errors
too.
Finally, if nothing of the above applies, this can result from a stack overflow.
Try to increase stack size with --cfg=contexts/stack_size (current size is 8192 KiB).
Erreur de segmentation (core dumped)

DVFS implemented but not working for ptask_L07

I just commited the ability to use DVFS for every kind of CPUs (in b4b4040).

It is working in the sense that when I ask the current peak speed after switching the pstate, I get the right value. But unfortunately, something is not connected correctly because it has no impact on the computation speed: the machine computes exactly as fast as before when I switch the pstate. It means that the current peek speed is not used by ptask_L07 model.

I digged a bit into the problem, in vain. I see that the CpuCas01 model creates a new variable from the CPU constraint, and then sets a bound that corresponds to the speed of the CPU, but this method is not applicable to this case, as there is still only one variable for the computation, but a whole set of CPUs. I could take the min of all speeds as a bound, but I'm not sure that it would interact properly with traces (or maybe the ptask model does not accept availability traces?).

I could further dig into the maxmin world, but I think that others (@alegrand or maybe Fabien Chaix) could fix the error in no time. So please guys, could you give me a hand? Or at least some hints on how to fix the problem? Thanks in advance.

Compilation issue when building in a subdirectory

I tried to compile the latest SimGrid revision this afternoon (commit 2211665) and I got several problems about missing include files. I build SimGrid in a subdirectory of the git tree (simgrid-dev/build). I'm using cmake 3.3.2 and I got the same problem with clang 3.7.0-5 and gcc 5.2.0-2.

The following files caused problems:

  • internal_config.h
  • context_sysv_config.h
  • portable.h

I managed to compile with some little hacks but I report the issue here since there is a problem in the building process. The compilation worked with the following hacks (executed from my git tree root):

mkdir build && cd build
cmake .. -Denable_documentation=0
make # FAIL

cd ..
ln -s ../build/src/internal_config.h src/
ln -s ../build/src/context_sysv_config.h src/
ln -s ../build/src/internal_config.h include/
ln -s ../src/portable.h include/

cd build
make # WORKS

The SimGrid storage issues

I found the SimGrid uses a file,such as context.txt,to simulate the content on the disk. But after I did some operations like msg_file_move or msg_file_write on the disk, I found context.txt was not changed. I thought since I created a new file, such as hello.txt,of size 100, then context.txt should have one more line 'hello.txt 100'.

smpi-energy still broken (wrong destructor call order)

Hello,

The smpi-energy machines fail here, and that's because simgrid::surf::Host::onDestruction is called too late. We equiped simgrid::surf::Host with the equivalent of ObservableLifecycle, but that should be done in simgrid::Host, not sg::surf::Host.

Right now, the surf::Host is an extension and you really want it to be registered soon enough. We could hack it by finding why SMPI registers it too late, but we'd better solve the issue by moving the events and ObservableLifecylce to simgrid::Host instead.

I cannot do it right now, so feel free to proceed if you can.
Mt

Execution error of some examples when tracing of msg processes is enabled

Hello,
I'm currently creating a MSG-based simulator. When I enable tracing (with --cfg=tracing:1 --cfg=tracing/msg/process:1) I get an exception saying that a container (corresponding to a process) cannot be found.

As a MWE, I found that the example masterslave_kill.c (examples/msg/masterslave) crashes in the same way. Some steps to reproduce the error are given above.

cd SG_DEV_ROOT
cd examples/msg/masterslave
gcc -g -lsimgrid -o msk masterslave_kill.c
./msk ../../platforms/small_platform.xml deployment_masterslave_kill.xml --cfg=tracing:1 --cfg=tracing/msg/process:1

Compile environment path leak when compiling simgrid

On make install, some path from the compiling environment leak to the installed files.
This is not wanted for package management on linux distributions (for example ArchLinux).

$ grep -R "$(pwd)/src" pkg/
Binary file pkg/simgrid-java-git/opt/simgrid/lib/libsimgrid.so.3.13 matches
Binary file pkg/simgrid-java-git/opt/simgrid/lib/libsimgrid-java.so.3.13 matches
Binary file pkg/simgrid-java-git/opt/simgrid/lib/libsimgrid-java.so matches
Binary file pkg/simgrid-java-git/opt/simgrid/lib/libsimgrid.so matches
Binary file pkg/simgrid-java-git/opt/simgrid/bin/graphicator matches
pkg/simgrid-java-git/opt/simgrid/bin/tesh:use lib "/home/orion/simgrid-aur/src/simgrid/bin";
$ grep -R "$(pwd)/pkg" pkg/
pkg/simgrid-java-git/opt/simgrid/bin/smpicxx:INCLUDEARGS="-I/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/include -I/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/include/smpi"
pkg/simgrid-java-git/opt/simgrid/bin/smpicxx:CMAKE_LINKARGS="-L/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/lib"
pkg/simgrid-java-git/opt/simgrid/bin/smpicxx:    list_add CXXFLAGS "-include" "/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/include/smpi/smpi_main.h"
pkg/simgrid-java-git/opt/simgrid/bin/smpicxx:    list_add LINKARGS "/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/lib\libsimgrid.dll"
pkg/simgrid-java-git/opt/simgrid/bin/smpirun:export LD_LIBRARY_PATH="/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
pkg/simgrid-java-git/opt/simgrid/bin/smpicc:INCLUDEARGS="-I/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/include -I/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/include/smpi"
pkg/simgrid-java-git/opt/simgrid/bin/smpicc:CMAKE_LINKARGS="-L/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/lib"
pkg/simgrid-java-git/opt/simgrid/bin/smpicc:    list_add CFLAGS "-include" "/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/include/smpi/smpi_main.h"
pkg/simgrid-java-git/opt/simgrid/bin/smpicc:    list_add LINKARGS "/home/orion/simgrid-aur/pkg/simgrid-java-git/opt/simgrid/lib\libsimgrid.dll"

Feature request: dynamic SMPI replay

Hello,

This post is more a feature request than a bug issue but I couldn't find a more
appropriate section so I post it here.

In my simulator, I would like to replay several SMPI time-independent traces
dynamically: the execution of those traces is driven by another real process
at runtime, so I cannot use a deployment file nor create all the processes
before calling the first smpi_replay_run nor guess which processes would be
run or which ones wouldn't.

I talked about it with Arnaud and we analyzed the source code of this part of
SimGrid together. We concluded that the current source code does not allow such
dynamic behaviours because some data structures are static (the process_data
and index_to_process_data arrays) and because of some assumptions, like
all processes existing before calling smpi_replay_run.

I tried in vain little hacks to make it work. I think the data structures will
need to be changed in order to allow a more dynamic behaviour but I lack SimGrid
global vision and I don't know how to implement it correctly. I also fear that
keeping the data of finished jobs in memory would be detrimental. Can you guide
me on how this should be implemented?

I attached an example of what I would like to do within my simulator. My real
simulator contains many MSG processes (which are not run at the same time, have
different lifespans and whose execution cannot be planned). Some processes
dedicated to launch SMPI jobs will be run at random times during my simulation.

Thanks in advance,
Millian

Example

Compilation

clang -std=c99 -lsimgrid example.c

Source code

#define _XOPEN_SOURCE 700
#define _GNU_SOURCE

#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <simgrid/msg.h>
#include <xbt/sysdep.h>
#include <xbt/log.h>
#include <xbt/asserts.h>
#include <smpi/smpi.h>

XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "mwe");

int smpi_replay(int argc, char *argv[])
{
    smpi_replay_run(&argc, &argv);
    return 0;
}

typedef struct
{
    double nb_seconds_to_sleep;
    char job_id_str[8];
    int job_size;
    char tit_filename[64];
} msg_runner_args;

int msg_job_runner(int argc, char *argv[])
{
    (void) argc;
    (void) argv;

    // Retrieve process arguments
    msg_runner_args * args = MSG_process_get_data(MSG_process_self());
    XBT_INFO("Runner of job %s has been launched", args->job_id_str);

    // Sleep for the required number of seconds
    MSG_process_sleep(args->nb_seconds_to_sleep);

    // OPen the file describing the job
    FILE* fp = fopen(args->tit_filename, "r");
    xbt_assert(fp != NULL, "Cannot read file '%s'", args->tit_filename);

    // Read the file, which contains other filenames (the time-independent-traces)
    char ** filename_by_rank = xbt_new(char *, args->job_size);

    ssize_t read;
    char * line = NULL;
    size_t n = 0;
    int lines_read = 0;
    while (((read = xbt_getline(&line, &n, fp)) != -1) && lines_read < args->job_size)
    {
        char * line_break_pos = strchrnul(line, '\n'); // Trimming
        *line_break_pos = '\0';
        asprintf(&filename_by_rank[lines_read], "%s", line);
        lines_read++;
        free(line);
        line = NULL;
    }
    free(line);
    fclose(fp);

    // Static mapping from MPI ranks to SimGrid hosts to avoid more complexity
    msg_host_t hosts[4];
    hosts[0] = MSG_host_by_name("Jupiter");
    hosts[1] = MSG_host_by_name("Fafard");
    hosts[2] = MSG_host_by_name("Ginette");
    hosts[3] = MSG_host_by_name("Bourassa");

    // Run the job
    for (int i = 0; i < args->job_size; ++i)
    {
        char *str_pname = NULL;
        asprintf(&str_pname, "%s_%d", args->job_id_str, i);

        char *str_rank_id  = NULL;
        asprintf(&str_rank_id, "%d", i);

        char ** sub_argv = xbt_new(char*, 5);
        sub_argv[0] = xbt_strdup("1");
        sub_argv[1] = xbt_strdup(args->job_id_str);
        sub_argv[2] = str_rank_id;
        sub_argv[3] = xbt_strdup(filename_by_rank[i]);
        sub_argv[4] = xbt_strdup("0");

        XBT_INFO("Job %s, rank %d launched", args->job_id_str, i);
        MSG_process_create_with_arguments(str_pname, smpi_replay, NULL, hosts[i], 5, sub_argv);
        free(str_pname);
    }

    XBT_INFO("Job %s launched", args->job_id_str);
    // How could I wait here for job termination (= all SMPI processes finalized)?

    // Cleanup
    for (int i = 0; i < args->job_size; ++i)
        free(filename_by_rank[i]);
    xbt_free(filename_by_rank);
    xbt_free(args);

    return 0;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        printf("Usage: %s platform_file\n", argv[0]);
        printf("example: %s msg_platform.xml\n", argv[0]);
        exit(1);
    }

    const char *platform_file = argv[1];

    MSG_init(&argc, argv);

    /*  Simulation setting */
    MSG_create_environment(platform_file);

    /* The jobs run in this example are always the same.
       Hence, we can guess what SMPI apps should be registered. */

    const char * job_id_1 = "1";
    const char * job_id_2 = "2";
    const char * job_id_3 = "3";
    const char * job_id_4 = "4";

    SMPI_app_instance_register(job_id_1, smpi_replay, 2);
    SMPI_app_instance_register(job_id_2, smpi_replay, 4);
    SMPI_app_instance_register(job_id_3, smpi_replay, 2);
    SMPI_app_instance_register(job_id_4, smpi_replay, 4);

    SMPI_init();

    // create args and run processes
    msg_runner_args * args1 = xbt_new(msg_runner_args, 1);
    msg_runner_args * args2 = xbt_new(msg_runner_args, 1);
    msg_runner_args * args3 = xbt_new(msg_runner_args, 1);
    msg_runner_args * args4 = xbt_new(msg_runner_args, 1);

    args1->nb_seconds_to_sleep = 0;
    strcpy(args1->job_id_str, job_id_1);
    args1->job_size = 2;
    sprintf(args1->tit_filename, "app1/app.tit");

    args2->nb_seconds_to_sleep = 2;
    strcpy(args2->job_id_str, job_id_2);
    args2->job_size = 4;
    sprintf(args2->tit_filename, "app2/app.tit");

    args3->nb_seconds_to_sleep = 4;
    strcpy(args3->job_id_str, job_id_3);
    args3->job_size = 2;
    sprintf(args3->tit_filename, "app1/app.tit");

    args4->nb_seconds_to_sleep = 26;
    strcpy(args4->job_id_str, job_id_4);
    args4->job_size = 4;
    sprintf(args4->tit_filename, "app2/app.tit");

    msg_host_t host = MSG_host_by_name("Jupiter");

    MSG_process_create("runner_1", msg_job_runner, args1, host);
    MSG_process_create("runner_2", msg_job_runner, args2, host);
    MSG_process_create("runner_3", msg_job_runner, args3, host);
    MSG_process_create("runner_4", msg_job_runner, args4, host);

    msg_error_t res = MSG_main();

    XBT_INFO("Simulation time %g", MSG_get_clock());

    //SMPI_finalize();
    if (res == MSG_OK)
        return 0;
    else
        return 1;
}

[Energy] Bad Joules consumption when null computational power pstates are used

sg_issue_bad_energy_consumption.zip
Hello,

I'm currently adding energy support in my simulator and I use some pstates as sleep pstates whose computational power is null. Hosts that are in sleep pstate are not supposed to compute any task but they can run a process to simulate their bootup.

I managed to implement this behaviour but SimGrid tells me that such hosts have consumed -NaN Joules.
Are pstates whose computational power is null illegal? I can use epsilon flop/s instead but I don't find it very elegant.

Minimal working example

Source code mwe.c

#include <stdio.h>

#include <simgrid/msg.h>
#include <simgrid/plugins.h>

XBT_LOG_NEW_DEFAULT_CATEGORY(mwe, "mwe");

int worker(int argc, char ** argv)
{
    msg_host_t host = MSG_process_get_host(MSG_process_self());
    msg_host_t host_list[1] = {host};

    double * flop_amount = xbt_new(double, 1);
    double * bytes_amount = xbt_new(double, 1);
    flop_amount[0] = 1e6;
    bytes_amount[0] = 0;

    msg_task_t task = MSG_parallel_task_create("task", 1, host_list, flop_amount, bytes_amount, NULL);
    MSG_task_execute(task);
    MSG_task_destroy(task);

    return 0;
}

int worker_dvfs(int argc, char ** argv)
{
    msg_host_t host = MSG_process_get_host(MSG_process_self());
    msg_host_t host_list[1] = {host};

    double * flop_amount = xbt_new(double, 1);
    double * bytes_amount = xbt_new(double, 1);
    flop_amount[0] = 1e6;
    bytes_amount[0] = 0;

    MSG_host_set_pstate(host, 1);

    msg_task_t task = MSG_parallel_task_create("task", 1, host_list, flop_amount, bytes_amount, NULL);
    MSG_task_execute(task);
    MSG_task_destroy(task);

    MSG_host_set_pstate(host, 2);

    return 0;
}


int main(int argc, char ** argv)
{
    sg_energy_plugin_init();
    MSG_init(&argc, argv);
    MSG_config("host/model", "ptask_L07");

    const char * platform_filename = argv[1];
    MSG_create_environment(platform_filename);

    // This host will simply compute 1e6 flop
    msg_host_t worker_host = MSG_get_host_by_name("MyHost1");
    // This host will compute 1e6 flop then switch to sleep state 2 of computational power 0.
    msg_host_t worker_host_dvfs0 = MSG_get_host_by_name("MyHost2");
    // This host will compute 1e6 flop then switch to sleep state 2 of computational power epsilon.
    msg_host_t worker_host_dvfs = MSG_get_host_by_name("MyHost3");

    MSG_process_create("worker", worker, NULL, worker_host);
    MSG_process_create("worker_dvfs0", worker_dvfs, NULL, worker_host_dvfs0);
    MSG_process_create("worker_dvfs", worker_dvfs, NULL, worker_host_dvfs);

    msg_error_t err = MSG_main();

    if (err == MSG_OK)
        printf("Okay.\n");
    else
        printf("Oops!\n");

    return 0;
}

Platform file energy_platform.xml

<?xml version='1.0'?>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
<AS  id="AS0"  routing="Full">
  <host id="MyHost1" power="100.0Mf,50.0Mf,0Mf" pstate="0" >
        <prop id="watt_per_state" value="100.0:200.0, 93.0:170.0, 10:10" />
        <prop id="watt_off" value="10" />
  </host>
  <host id="MyHost2" power="100.0Mf,50.0Mf,0Mf" pstate="0" >
        <prop id="watt_per_state" value="100.0:200.0, 93.0:170.0, 10:10" />
        <prop id="watt_off" value="10" />
  </host>
  <host id="MyHost3" power="100.0Mf,50.0Mf,0.0001Mf" pstate="0" >
        <prop id="watt_per_state" value="100.0:200.0, 93.0:170.0, 10:10" />
        <prop id="watt_off" value="10" />
  </host>
  <link id="bus" bandwidth="100kBps" latency="0"/>
  <route src="MyHost1" dst="MyHost2"><link_ctn id="bus"/></route>
  <route src="MyHost1" dst="MyHost3"><link_ctn id="bus"/></route>
  <route src="MyHost2" dst="MyHost3"><link_ctn id="bus"/></route>
</AS>
</platform>

Compilation

clang -lsimgrid mwe.c -o mwe

Execution

./mwe energy_platform.xml

Output

[0.000000] [surf_host/INFO] Switching to the L07 model to handle parallel tasks.
Okay.
[0.020000] [surf_energy/INFO] Total energy of host MyHost1: 3.000000 Joules
[0.020000] [surf_energy/INFO] Total energy of host MyHost2: -nan Joules
[0.020000] [surf_energy/INFO] Total energy of host MyHost3: 3.400000 Joules

Fatal error: internal_config.h: No such file or directory (Include dirs not properly configured)

I have a Debian testing. I just clone the git version from INRIA's repo, HEAD is 3bda7845c0cceaaeedd5d0371434927c8cf6231d. Cmake runs okay, I disable the documentation option using ccmake and then hit enter after make. I end up with the following compilation error in a out-of-the-source compilation scheme (I have created a build directory in root to compile, which appears as b in the copy and paste below):

[  0%] Building CXX object CMakeFiles/simgrid.dir/src/s4u/s4u_actor.cpp.o
/usr/bin/c++   -Dsimgrid_EXPORTS -g3 -std=gnu++11 -O3 -funroll-loops -fno-strict-aliasing  
-finline-functions  -flto  -fPIC -I/home/schnorr/workspace/simgrid.git2 
-I/home/schnorr/workspace/simgrid.git2/include -I/home/schnorr/workspace/simgrid.git2/src/include  
-I/home/schnorr/workspace/simgrid.git2/b/include -I/usr/include/graphviz    -o CMakeFiles/simgrid.dir/src/s4u/s4u_actor.cpp.o -c /home/schnorr/workspace/simgrid.git2/src/s4u/s4u_actor.cpp
In file included from /home/schnorr/workspace/simgrid.git2/src/include/surf/surf.h:16:0,
                 from /home/schnorr/workspace/simgrid.git2/src/msg/msg_private.h:12,
                 from /home/schnorr/workspace/simgrid.git2/src/s4u/s4u_actor.cpp:8:
/home/schnorr/workspace/simgrid.git2/src/portable.h:13:29: fatal error: internal_config.h: No such file or directory
compilation terminated.

It turns out that internal_config.h is created in my build/src directory, but that dir is not include as a possible includes of the g++ and gcc commands. I have manually added the build directory in cmake but I think that is not what we want, right? I feel that a fix should pass through the edition of some cmake build configuration file, but I'm not sure exactly where.

Is this happening only with me?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.