Closed fqiang closed 8 years ago
I think the nonlinear solvers section should be restructured:
Looks good to me, beyond the minor cosmetic things I mentioned.
I think from the user's point of view, we probably want to hide as much as possible of the technical requirements from the user. The user will just need to run the model with mpirun -np NUM_PROCS julia model.jl
. And when the number of scenarios equals to the multiple of NUM_PROCS will give the best parallel efficiency.
We can probably achieve this by making StructuredModel as a type, and call MPI.Init in its type constructor and MPI.Finalized in its finalizer. Then the MPI will be finalized automatically when the StructuredModel goes out of scope. However, when this will be called will be dependent on Julia's GC. (Also, the MPI.Init and Finalize is called for root node only, ie parent==nothing
).
Feng, I think we should avoid this... it won't allow the user to reuse the communicator for cases when StructJuMP is resolved or embeded in a code that already has a communicator and/or still needs it after the model is solved, see what Miles said...
If the StructJuMP is resolved that means the model is still in scope and finalizer should be called yet. It is a good point that we also want to allow user to embed and uses his own communicator, which means that StructJuMP provides more flexibility to a more technical capable user.
closed and replaced with PR22 #22
This PR updates the StructJuMP to work with the StructJuMPSolverInterface.
id = 0
.