import org.simgrid.msg.NativeException;
class Main {
+ private Main() {
+ throw new IllegalAccessError("Utility class");
+ }
+
public static void main(String[] args) throws HostNotFoundException, NativeException{
Msg.init(args);
if(args.length < 1) {
import org.simgrid.msg.HostNotFoundException;
public class Receiver extends Process {
- static final double COMM_SIZE_LAT = 1;
- static final double COMM_SIZE_BW = 100000000;
+ private static final double COMM_SIZE_BW = 100000000;
public Receiver(String hostname, String name, String[]args) throws HostNotFoundException, NativeException{
super(hostname,name,args);
}
Msg.info("Got at time "+ timeGot);
Msg.info("Was sent at time "+timeSent);
- time=timeSent;
+ time = timeSent;
double communicationTime = timeGot - time;
Msg.info("Communication time : " + communicationTime);
import org.simgrid.msg.HostNotFoundException;
public class Sender extends Process {
- private final double commSizeLat = 1;
- final double commSizeBw = 100000000;
+ private static final double COMM_SIZE_LAT = 1;
public Sender(String hostname, String name, String[] args) throws HostNotFoundException, NativeException {
super(hostname,name,args);
Msg.info("sender time: " + time);
- task = new PingPongTask("no name",computeDuration,commSizeLat);
+ task = new PingPongTask("no name",computeDuration,COMM_SIZE_LAT);
task.setTime(time);
task.send(mailboxes[pos]);
import org.simgrid.msg.HostNotFoundException;
class Main {
+ private Main() {
+ throw new IllegalAccessError("Utility class");
+ }
+
public static void main(String[] args) throws NativeException, HostNotFoundException {
Msg.init(args);
import org.simgrid.msg.MsgException;
class Main {
- public static final double task_comp_size = 10;
- public static final double task_comm_size = 10;
- public static final int hostNB = 2 ;
+ public static final double TASK_COMP_SIZE = 10;
+ public static final double TASK_COMM_SIZE = 10;
+ public static final int NHOSTS = 2 ;
+
+ private Main() {
+ throw new IllegalAccessError("Utility class");
+ }
+
public static void main(String[] args) throws MsgException {
Msg.init(args);
/* Construct the platform */
Msg.createEnvironment(args[0]);
Host[] hosts = Host.all();
- if (hosts.length < hostNB+1) {
- Msg.info("I need at least "+ (hostNB+1) +" hosts in the platform file, but " + args[0] + " contains only "
+ if (hosts.length < NHOSTS+1) {
+ Msg.info("I need at least "+ (NHOSTS+1) +" hosts in the platform file, but " + args[0] + " contains only "
+ hosts.length + " hosts");
System.exit(42);
}
- Msg.info("Start"+ hostNB +" hosts");
+ Msg.info("Start "+ NHOSTS +" hosts");
new Master(hosts[0],"Master",hosts).start();
/* Execute the simulation */
Msg.run();
}
public void main(String[] args) throws MsgException {
- int workersCount = Main.hostNB;
+ int workersCount = Main.NHOSTS;
ArrayList<VM> vms = new ArrayList<>();
// Create one VM per host and bind a process inside each one.
public void workBatch(int workersCount) throws MsgException {
for (int i = 0; i < workersCount; i++) {
- Task task = new Task("Task0" + i, Main.task_comp_size, Main.task_comm_size);
+ Task task = new Task("Task0" + i, Main.TASK_COMP_SIZE, Main.TASK_COMM_SIZE);
Msg.info("Sending to WRK0" + i);
task.send("MBOX:WRK0" + i);
}
$ java -classpath ${classpath:=.} cloud/masterworker/Main ${srcdir:=.}/../platforms/platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:maestro@) Using regular java threads.
-> [ 0.000000] (0:maestro@) Start2 hosts
+> [ 0.000000] (0:maestro@) Start 2 hosts
> [ 0.000000] (1:Master@Jacquelin) create VM00
> [ 0.000000] (1:Master@Jacquelin) Put Worker WRK00 on VM00
> [ 0.000000] (1:Master@Jacquelin) create VM01
import org.simgrid.msg.Host;
import org.simgrid.msg.Task;
import org.simgrid.msg.Process;
-import org.simgrid.msg.MsgException;
import org.simgrid.msg.HostFailureException;
import org.simgrid.msg.HostNotFoundException;
import org.simgrid.msg.TaskCancelledException;
import org.simgrid.msg.HostNotFoundException;
import org.simgrid.msg.NativeException;
-public class Main {
+class Main {
+ private Main() {
+ throw new IllegalAccessError("Utility class");
+ }
public static void main(String[] args) throws NativeException, HostNotFoundException {
Msg.energyInit();