Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add 'expedited' decorator for urgent messages #212

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

ZwFink
Copy link
Contributor

@ZwFink ZwFink commented Aug 7, 2021

This patch adds the @expedited decorator to enable urgent inter-PE messages to skip the message queue. This patch also lays the groundwork for adding additional entry method options such as priorities.

Example of usage:

from charm4py import charm, Chare, Array, expedited


class Test(Chare):
    """
    A chare array to test the element proxy.
    """

    def __init__(self):
        self.count = 0

    @expedited
    def say(self, msg):
        """
        Helper method which is called by invoking the element proxy.
        This method is expected to be called on only the chare for
        which the proxy is created.
        """

        self.count += 1
        print("Say", msg, "called on", self.thisIndex, "on PE", charm.myPe())
        if self.count == 2:
            assert self.thisIndex == (3,)
            exit()

    def start(self):
        proxy = self.thisProxy[3]
        proxy.say("bye")
        proxy.say("bye")


def main(args):
    arr_proxy = Array(Test, 6)
    arr_proxy[0].start()


charm.start(main)

@lgtm-com
Copy link

lgtm-com bot commented Sep 30, 2021

This pull request introduces 1 alert when merging d813e1d into 0b9a2be - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Sep 30, 2021

This pull request introduces 1 alert when merging eae8497 into 0b9a2be - view on LGTM.com

new alerts:

  • 1 for Unused local variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant