import org.simgrid.msg.NativeException;
class Main {
- public static void main(String[] args) throws HostNotFoundException,NativeException{
+ public static void main(String[] args) throws HostNotFoundException, NativeException{
Msg.init(args);
if(args.length < 1) {
Msg.info("Usage : Main platform_file");
import org.simgrid.msg.HostNotFoundException;
public class Receiver extends Process {
- static final double commSizeLat = 1;
- static final double commSizeBw = 100000000;
+ static final double COMM_SIZE_LAT = 1;
+ static final double COMM_SIZE_BW = 100000000;
public Receiver(String hostname, String name, String[]args) throws HostNotFoundException, NativeException{
super(hostname,name,args);
}
double communicationTime = timeGot - time;
Msg.info("Communication time : " + communicationTime);
- Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----");
+ Msg.info(" --- bw "+ COMM_SIZE_BW/communicationTime + " ----");
Msg.info("goodbye!");
}
}
\ No newline at end of file
public void main(String[] args) throws MsgException {
int workersCount = Main.hostNB;
- ArrayList<VM> vms = new ArrayList<VM>();
+ ArrayList<VM> vms = new ArrayList<>();
// Create one VM per host and bind a process inside each one.
for (int i = 0; i < workersCount; i++) {
Msg.info("Let's shut down the simulation and kill everyone.");
for (int i = 0; i < vms.size(); i++) {
- vms.get(i).shutdown();
- vms.get(i).finalize();
+ vms.get(i).shutdown();
+ vms.get(i).finalize();
}
Msg.info("Master done.");
}
try {
task.execute();
} catch (HostFailureException | TaskCancelledException e) {
+ Msg.error(e.getMessage());
e.printStackTrace();
}
Msg.info("This worker is done.");
}
@Override
- public void main(String[] strings) throws MsgException, HostNotFoundException {
- double startTime = 0;
- double endTime = 0;
-
+ public void main(String[] strings) throws HostNotFoundException, HostFailureException {
/* get hosts */
Host host1 = Host.getByName("MyHost1");
Host host2 = Host.getByName("MyHost2");