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
Update copyright lines for 2022.
[simgrid.git]
/
examples
/
python
/
network-nonlinear
/
network-nonlinear.py
diff --git
a/examples/python/network-nonlinear/network-nonlinear.py
b/examples/python/network-nonlinear/network-nonlinear.py
index
e4892af
..
66a4a97
100644
(file)
--- a/
examples/python/network-nonlinear/network-nonlinear.py
+++ b/
examples/python/network-nonlinear/network-nonlinear.py
@@
-1,4
+1,4
@@
-# Copyright (c) 2006-202
1
. The SimGrid Team. All rights reserved.
+# Copyright (c) 2006-202
2
. 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.
@@
-17,7
+17,7
@@
class Sender:
def __init__(self, msg_count: int, msg_size=int(1e6)):
self.msg_count = msg_count
self.msg_size = msg_size
def __init__(self, msg_count: int, msg_size=int(1e6)):
self.msg_count = msg_count
self.msg_size = msg_size
-
+
# Actors that are created as object will execute their __call__ method.
# So, the following constitutes the main function of the Sender actor.
def __call__(self):
# Actors that are created as object will execute their __call__ method.
# So, the following constitutes the main function of the Sender actor.
def __call__(self):
@@
-53,11
+53,11
@@
class Receiver:
pending_comms = []
this_actor.info("Wait for %d messages asynchronously" % self.msg_count)
pending_comms = []
this_actor.info("Wait for %d messages asynchronously" % self.msg_count)
- for
i
in range(self.msg_count):
+ for
_
in range(self.msg_count):
comm, data = mbox.get_async()
pending_comms.append(comm)
pending_msgs.append(data)
comm, data = mbox.get_async()
pending_comms.append(comm)
pending_msgs.append(data)
-
+
while len(pending_comms) > 0:
index = Comm.wait_any(pending_comms)
msg = pending_msgs[index].get()
while len(pending_comms) > 0:
index = Comm.wait_any(pending_comms)
msg = pending_msgs[index].get()
@@
-88,7
+88,7
@@
def load_platform():
________ __________
| Sender |===============| Receiver |
|________| Link1 |__________|
________ __________
| Sender |===============| Receiver |
|________| Link1 |__________|
-
+
"""
zone = NetZone.create_full_zone("Zone1")
sender = zone.create_host("sender", 1).seal()
"""
zone = NetZone.create_full_zone("Zone1")
sender = zone.create_host("sender", 1).seal()