4 * Copyright 2006,2007 Martin Quinson, Malek Cherier
5 * Copyright 2012 The SimGrid team
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the license (GNU LGPL) which comes with this package.
12 import org.simgrid.msg.Msg;
13 import org.simgrid.trace.Trace;
14 import org.simgrid.msg.NativeException;
16 public class TracingTest {
18 /* This only contains the launcher. If you do nothing more than than you can run
19 * java simgrid.msg.Msg
20 * which also contains such a launcher
23 public static void main(String[] args) throws NativeException {
24 /* initialize the MSG simulation. Must be done before anything else (even logging). */
27 Msg.info("Usage : PingPong platform_file deployment_file");
28 Msg.info("example : PingPong ping_pong_platform.xml ping_pong_deployment.xml");
32 /* construct the platform and deploy the application */
33 Msg.createEnvironment(args[0]);
34 Msg.deployApplication(args[1]);
36 /* Initialize some state for the hosts */
37 Trace.hostStateDeclare ("PM_STATE");
38 Trace.hostStateDeclareValue ("PM_STATE", "waitingPing", "0 0 1");
39 Trace.hostStateDeclareValue ("PM_STATE", "sendingPong", "0 1 0");
40 Trace.hostStateDeclareValue ("PM_STATE", "sendingPing", "0 1 1");
41 Trace.hostStateDeclareValue ("PM_STATE", "waitingPong", "1 0 0");
43 /* execute the simulation. */