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

Need new architecture for passing operations to contained objects #1

Closed
1 of 4 tasks
stiber opened this issue Dec 17, 2019 · 3 comments · Fixed by #27
Closed
1 of 4 tasks

Need new architecture for passing operations to contained objects #1

stiber opened this issue Dec 17, 2019 · 3 comments · Fixed by #27
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@stiber
Copy link
Contributor

stiber commented Dec 17, 2019

What kind of issue is this?

  • Bug report
  • Feature request
  • Question not answered in documentation
  • Cleanup needed

Right now, we have a high degree of nesting of objects in other objects, which means that operations done at a high level, for example from main(), must be passed down a long chain of method calls to reach the object that can actually perform the operation. We need to fix this.

What is affected by this?

How do we replicate the issue/how would it work?

Expected behavior (i.e. solution or outline of what it would look like)

Other Comments

@stiber stiber transferred this issue from UWB-Biocomputing/BrainGrid Jun 24, 2020
@stiber
Copy link
Contributor Author

stiber commented Jun 24, 2020

Here are the common operations provided by simulation entities:

  • retrieveParameters()
  • allocateCPUMemory()
  • allocateGPUMemory()
  • initializeState()
  • copyToGPU()
  • copyFromGPU()
  • deallocateGPUMemory()
  • deallocateCPUMemory()
  • shutdown()

And maybe serialization/deserialization operations, but the architecture of cereal pretty much precludes these being implemented using the chain of command pattern.

@stiber stiber added the enhancement New feature or request label Jun 24, 2020
@stiber stiber added this to the Sprint 2 milestone Jun 25, 2020
@stiber
Copy link
Contributor Author

stiber commented Jul 2, 2020

Hi @christopherdokeefe, I know we had a very brief conversation about the structure of the chain. In particular, you originally had one chain, with each node having a function and the operation it handles. At that point in time, I was thinking that Simulator would implement a separate chair for each operation type, with a separate public method for each type, and so I argued for a separate chain for each operation type, you you have now in ChainOperationManager.

However, you should have argued against this. With the agreement that we'll have a separate OperationManager class, with a single executeOperation() method, separate chains is more complex than it needs to be. So, yeh, I guess I'm saying that we should go back to a single chain with each ChainNode having a data members like:

std::function<void()> function;
Operations::op operation;

This will not only greatly simplify the code, but will mean we can add or modify the set of operations with minimal changes.

@christopherdokeefe
Copy link
Collaborator

christopherdokeefe commented Jul 2, 2020 via email

@stiber stiber linked a pull request Jul 4, 2020 that will close this issue
@stiber stiber closed this as completed Jul 16, 2020
jasleenksaini added a commit that referenced this issue Aug 5, 2024
jasleenksaini added a commit that referenced this issue Aug 5, 2024
jasleenksaini added a commit that referenced this issue Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants