A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Spurious ~.
[simgrid.git]
/
examples
/
java
/
cloud
/
Slave.java
diff --git
a/examples/java/cloud/Slave.java
b/examples/java/cloud/Slave.java
index
8f7cde3
..
4d9963e
100644
(file)
--- a/
examples/java/cloud/Slave.java
+++ b/
examples/java/cloud/Slave.java
@@
-1,5
+1,6
@@
/*
/*
- * Copyright 2012. The SimGrid Team. All rights reserved.
+ * Copyright (c) 2012-2013. The SimGrid Team.
+ * All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package.
@@
-21,9
+22,15
@@
public class Slave extends Process {
public void main(String[] args) throws MsgException {
while(true) {
Msg.info("Receiving on " + "slave_" + number);
public void main(String[] args) throws MsgException {
while(true) {
Msg.info("Receiving on " + "slave_" + number);
- Task task = Task.receive("slave_"+number);
-
+ Task task;
+ try {
+ task = Task.receive("slave_"+number);
+ } catch (MsgException e) {
+ Msg.debug("Received failed. I'm done. See you!");
+ break;
+ }
if (task instanceof FinalizeTask) {
if (task instanceof FinalizeTask) {
+ Msg.info("Received Finalize. I'm done. See you!");
break;
}
Msg.info("Received \"" + task.getName() + "\". Processing it.");
break;
}
Msg.info("Received \"" + task.getName() + "\". Processing it.");
@@
-35,7
+42,6
@@
public class Slave extends Process {
Msg.info("\"" + task.getName() + "\" done ");
}
Msg.info("\"" + task.getName() + "\" done ");
}
- Msg.info("Received Finalize. I'm done. See you!");
}
}
\ No newline at end of file
}
}
\ No newline at end of file