-
Notifications
You must be signed in to change notification settings - Fork 17
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
Dev sdp parallel #102
Dev sdp parallel #102
Conversation
|
||
- v (Array) | ||
the value function to interpolate | ||
- dim_states (Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the markdown everywhere :)
I do not understand what is the type of V now ? |
import StochDynamicProgramming, Distributions | ||
println("library loaded") | ||
|
||
@everywhere begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to define the instance across all workers if we parallelize. The user won't have to do it if we develop an interface with macros
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To answer the question above regarding the type of V (I cannot answer directly below I don't know why maybe you commented the PR then commented a diff after). V is now a SharedArray because it is shared by multiple processes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then add a comment explaining the line. Otherwise user won't know if they need to copy it, modify it etc...
Same for V, at least in the comments above the function you should say that V is an array or a sharedArray of this or that form.
I made the changes you required. Frapac is benchmarking to conclude if we have to switch to the old implementation of SDP if it is not parallelized. I don't think we should because the new implementation is slower only on really small instances but faster of others even if it is not parallelized. |
- V (Array of SharedArray) | ||
the array containing the discretized value functions at each time step | ||
|
||
- Vitp (Interpolations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "Interpolations" ?
I updated the battery example. It is more correct now and I think clearer. Thanks to frapac benchmark it seems that it is better to keep this implementation and not make a switch so after we have convert the comments to markdown I think we can merge. Unless you have other comments of course |
@frapac can you use your script to convert the docstrings to markdown please? After that I think this PR can be merged |
closes #75 with PR #100
Add working implementation of parallelized SDP using multiprocessing
small benchmark:
TODO: update doc with frapac help