-
Notifications
You must be signed in to change notification settings - Fork 91
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
Python interface #1068
Python interface #1068
Conversation
@jameshcorbett can you add methods to |
@cssherman do you have an idea on how to modify |
@corbett5 - I expect that shouldn't be too difficult. Since the primary while loop is written with restarts in mind, calling EventManager::Run() will cause it to automatically resume where it stopped. I'd suggest adding an additional pythonInterrupt flag that the events can set to handle the breaking. Also, this comes to mind: https://xkcd.com/292/ |
make sure to create a |
Awesome, thanks! |
@rrsettgast Where do we need to be able to return back into python to set boundary conditions? Currently it returns after |
@corbett5 Can we use "baton passing" terminology? I would propose that we want to pass the baton around a couple of places prior to the event loop:
Of course, this is just my thinking. I am very open to improving the approach. |
I like the baton. So before and after |
e7bc82d
to
04ac9cf
Compare
Closes #792 |
I would say that we shouldn't have any of the baton passing in virtual functions and the solver passes should be placed in |
And in |
We may just remove |
Looks like LaplaceFEM is the only place. |
8dd3dda
to
453c3f4
Compare
CommunicationTools(); | ||
~CommunicationTools(); | ||
|
||
static void AssignGlobalIndices( ObjectManagerBase & object, |
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.
wait...no static functions?
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.
Static functions are fine, but one of the methods had a static variable. I made the variable a class member and therefore all of the previous static methods that then used this now non-static function had to be non-static.
@@ -1,123 +0,0 @@ | |||
/* |
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.
It's OK to get rid of these old binding examples
@@ -1,2 +0,0 @@ | |||
build |
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 not get rid of this package. In #990 I'm planning to change the name to geosx_xml_tools
, which is more descriptive of what it actually does
@corbett5 - since we'll be accessing a number of 1D arrays, it would be useful to define the aperture = problem.getWrapper(aperture_key).value(True)
# This is much more convenient than (np.prod(np.shape(aperture)) > 0)
if len(aperture):
print('do something') |
We can definitely do that. Actually, Ben and I have been talking about making it so that Arrays and SortedArrays behave exactly like Numpy arrays, so you could pass them to |
By the way, I just finished up some documentation for all the Python LvArray classes. If you pull the latest branch of LvArray (it's not in GEOSX yet, I need to make some changes before I can incorporate it) and make the documentation, you'll see a new section "LvArray in Python" which outlines all the classes and their methods. Hopefully tomorrow I can make something for the pygeosx module as well. |
Makes perfect sense to me |
@corbett5 @jameshcorbett - I was curious to see what would happen if I tried running an xml file with a python hook using the primary geosx executable. Obviously, this usage shouldn't work. We should work on the error message though:
|
Yeah that's not the best error message, thanks! |
a87143e
to
ec163ec
Compare
I just force-pushed a bunch of changes. Here's a summary:
Ben and I were talking about what should happen when the callback raises an exception. Usually you want to propagate the exception back to Python immediately, so that the user sees it right away. Unfortunately, doing so would require a lot of changes to the code base, because all of the functions between Ben also suggested that I ask you @cssherman whether you think it would be useful to have callbacks in other locations in the code. It would be very easy to do---the hardest part would be determining how to make it clear for the user what all the different callbacks are for (maybe something like |
I'm sure you're right. To change the subject, then, I think what @corbett5 wanted to know about the callbacks is whether you think we should add more of them. Right now there's only one kind: it's on the physics solver, and it's called after applying the boundary conditions. (So it may be called multiple times during one call to
Oh OK, that makes sense, cool. |
Closes #792 |
e46828c
to
ef37751
Compare
@rrsettgast @cssherman Okay this is up-to-date with I'm sure there's still work to be done, but I think it's in a good state to merge. That way we can get some people using it and some feedback. |
@corbett5 - cool! I'll do some work to update the separate branch with the python helper functions I built to work with the new interface. |
@cssherman awesome! We're going to give a walkthrough at the meeting Thursday, it'd be nice if you could talk about the virtual environment and the stuff you have cooking on that branch a little bit. |
@corbett5 - to make things easier, could we enable the ssl package in the python distribution (a config option, required to run pip)? It would also be very useful to also install the virtualenv package so that users can build virtual python environments on shared systems. |
004cf8e
to
4be095c
Compare
@cssherman I'll do that tomorrow. Spack builds Python with SSL by default, and I pointed it to the LC installation but I guess I didn't point correctly as Python failed to build the |
e48bbec
to
899aef6
Compare
Okay, in my opinion this is ready to merge. @cssherman The two Python installations in |
@bmhan12 The cuda-debug build is failing although it looks to me like it's actually passing. Thoughts? |
That's odd, I can't see why the exit code would change. Does it fail when you rerun the job? |
High up the build log, there's this:
|
@klevzoff wow thanks! That's funny it still ran. |
Group::Group( string const & name, | ||
Group * const parent ): | ||
m_parent( parent ), | ||
Group::Group( std::string const & name, |
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.
remove std::
899aef6
to
22010fa
Compare
Related to
GEOS-DEV/LvArray#186
https://github.com/GEOSX/integratedTests/pull/78
GEOS-DEV/PAMELA#46
GEOS-DEV/PVTPackage#37