-
Notifications
You must be signed in to change notification settings - Fork 9
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
Mixed C and C++ implementation #31
Comments
@cameronrutherford have we seen this behavior on other platforms or other GCC compilers? What's different here? I don't know much about C++. In C, one would allocate memory for a string and then use it. |
The object creation via PetscCalloc has nothing to do with the options. So, we need to fix the issue with options directly. The issue you are seeing with new is because PetscFree gets called on the struct when it's being destroyed and it requires the object to be created with PetscMalloc or PetscCalloc. |
This is the first time I've seen this issue @abhyshr. Quite a few bugs have cropped up recently for the first time which is very mysterious but we seem to be squashing them... @nychiang please provide a way to reproduce so we can try and fix things (spack spec I assume?) If we are using After using We did plan to fully transition ExaGO to C++ classes one day, but that isn't today. |
Hmm...what are these bugs? Have we documented them somewhere? Still feel using |
I just ran a SCOPFLOW test on newell with Valgrind. Is there some way of uploading a file to an issue? I don't see anything that allows you to do that but then, I'm an idiot... |
@abhyshr @cameronrutherford
|
@bjpalmer When creating a comment in GitHub, there is some text below the text box that says "attach files by dragging & dropping, selecting or pasting them". I have uploaded a screenshot of what I am seeing for reference.
@abhyshr This is the first time that I am seeing this. I still would like @nychiang to provide a more concrete spec of how ExaGO was built, so that we can reproduce. Very hard to try and implement a fix without a reproducer, or an error in our pipelines to catch this moving forward.
@nychiang despite not having a reproducer, I think I have followed from your links and debugging process. To summarize, the issue occurs because the OPFLOW struct has an To fix this, I think the easiest approach is to have Only tricky part would be to make sure that we free the associated memory created with |
This is the configuration that I got segmentation faults. @cameronrutherford |
Okay, so this sounds like something that is unique to It sounds like we can get some of the builds passing, but now this issue is specific to runtime errors that are happening with |
umm... I don't think this comes from I guess maybe some newly added cflags introduce this error into |
To verify this, could you try and run the same build with With #20 merged, we now have an easy way to kick off builds on Ascent, Incline, Newell and Deception too run tests, so if you want a new build of I currently have no path forward to reproducing this on our current EDIT: Tentatively assigning 1.6.1 release unless this is proven to be reproducible with |
I just tried it with
BTW, I think these errors cannot be detected by CI since they are removed from CI, due to I will suggest let's move on first, i.e., assign ExaGo 1.6.1 release with HiOp v1.0.1. |
Thanks for clarifying @nychiang, this is making some more sense. There are a set of overlapping issues here, but we are getting somewhere. Order of operations seems to be: Build errors:
Runtime errors:
Releases: Again, happy to provide specific builds/tests on our CI systems. Even though we have all these test failures, I think this release schedule makes the most sense. |
I have made a meta issue in #80 to keep track of this |
I compiled Exago on two different LLNL platforms, using both
gcc-8.3.1
andgcc-12.1.1
. In both cases, I encountered segmentation faults at runtime. Upon investigation, I discovered that certain objects were not being initialized correctly. For instance, theopflow->modelname
variable is a C++std::string
object, but it was not being allocated memory using the c-typecalloc
function.This issue led to a segmentation fault at the line where
opflow->modelname
was being assigned a value:opflow->modelname = OPFLOWOptions::model.opt
For more information about this type of error, you can refer to this discussion on Stack Overflow:
See Here.
It's worth noting that when I used
new
to initialize the opflow object and removed thePetscCalloc
function like this:I was able to compile and run Exago to solve test problems. However, I encountered segmentation faults when Petsc was used to release memory allocated for the
opflow
object. (It shouldn't since the memory is not managed/allocated by Petsc).@cameronrutherford @jaelynlitz @abhyshr
This is the configuration that I got segmentation faults.
The text was updated successfully, but these errors were encountered: