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

Generalize ParameterControlServer #3

Open
SimonHeybrock opened this issue Nov 10, 2015 · 5 comments
Open

Generalize ParameterControlServer #3

SimonHeybrock opened this issue Nov 10, 2015 · 5 comments

Comments

@SimonHeybrock
Copy link
Contributor

Need:

  • trigger support (zero arguments)
  • multi-argument support (e.g., for workpace ID plus rebin parameters)
@MichaelWedel
Copy link
Contributor

It may eventually be easier to use another external library for this:

But I'd go as far as saying that this is more than maintenance, because for that we need to rethink how multiple objects are exposed on the server side.

For the long term I think this is definitely the more flexible approach.

@SimonHeybrock
Copy link
Contributor Author

Well, I had RPC in mind. But on the other hand we should not forget that on the backend commands will be distributed via MPI, so it is not clear if it is possible or even makes sense to fit a generic RPC thing on top of it.

@MichaelWedel
Copy link
Contributor

The advantage I can see is that it seems to be completely transparent. In the MPI-case I imagine the MantidBackendWorker on the master rank is exposed through the RPC-interface. The client does not need to care what happens inside the method-call (because it does not know anything about what's going on on the server).

Server:

class Something(object):
   @parameter.setter
   def parameter(self, value):
      if self._is_master():
          # Distribute through MPI - I guess this could be generalized further
          # by putting it into some MPI-attribute-handling class?
      else:
          # Do whatever is appropriate

# Serve "Something"-object through rpc

Client:

something = zerorpc.Client()
something.connect(...)

somthing.parameter = 5

That is, if the properties are accessible like that through RPC. Maybe this is easier to look at together in person.

@MichaelWedel
Copy link
Contributor

Okay, I just tested and the decorator does not seem to work like that with zerorpc.

@MichaelWedel
Copy link
Contributor

With pizco it works, but that requires python3.

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

No branches or pull requests

2 participants