-/* Copyright (c) 2006-2014. The SimGrid Team.
+/* Copyright (c) 2006-2019. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
System.exit(1);
}
- int num = Integer.valueOf(args[0]).intValue();
- //Msg.info("Receiving on 'worker_"+num+"'");
+ int num = Integer.parseInt(args[0]);
+ Msg.debug("Receiving on 'worker_"+num+"'");
while(true) {
Task task = Task.receive("worker_"+num);
- if (task.getName().equals("finalize")) {
+ if ("finalize".equals(task.getName())) {
break;
}
- Msg.info("Received \"" + task.getName() + "\". Processing it.");
+ Msg.info("Received \"" + task.getName() + "\". Processing it (my pid is "+getPID()+").");
try {
task.execute();
- } catch (TaskCancelledException e) {}
+ } catch (TaskCancelledException e) {
+ e.printStackTrace();
+ }
}
Msg.info("Received Finalize. I'm done. See you!");