コード例 #1
0
 def __init__(self, args):
     # create Group of chares of type hello.Hello
     hello_chares = Group(hello.Hello)
     # create Group of chares of type goodbye.Goodbye
     bye_chares = Group(goodbye.Goodbye)
     # add bye_chares proxy to globals of module hello on every process
     future1 = charm.thisProxy.updateGlobals({'bye_chares': bye_chares},
                                             module_name='hello', awaitable=True)
     # add mainchare proxy to globals of module goodbye on every process
     future2 = charm.thisProxy.updateGlobals({'mainProxy': self.thisProxy},
                                             module_name='goodbye', awaitable=True)
     charm.wait((future1, future2))
     # broadcast a message to the hello chares
     hello_chares.SayHi()
コード例 #2
0
ファイル: hello_world.py プロジェクト: sdrave/charm4py
def main(args):
    # create Group of Hello objects (there will be one object on each core)
    hellos = Group(Hello)
    # call method 'SayHi' of all group members, wait for method to be invoked on all
    hellos.SayHi(awaitable=True).get()
    exit()