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

Struct pastix_data_s in CalculiX seems inconsistent with that in PaStiX4CalculiX #16

Open
uebian opened this issue Jul 28, 2022 · 3 comments

Comments

@uebian
Copy link

uebian commented Jul 28, 2022

Struct pastix_data_s in CalculiX which is declared in the ccx_2.19/src/pastix.c is inconsistent with that in PaStiX4CalculiX, which is declared in pastixdata.h. As a result, there is a Segmentation fault on ccx_2.19/src/pastix.c:759, when calling pastix_data->iparm[IPARM_GPU_NBR]=0;. When debuging with GDB, pastix_data->iparm is always 0.

I'm using gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 and following the instructions in CalculiX's README.INSTALL file when setting up the environment.

Is this a bug or a mistake from my side while setting up/compiling?

Any help is appreciated.

@uebian uebian changed the title Stuct pastix_data_s in CalculiX seems inconsistent with that in PaStiX4CalculiX Struct pastix_data_s in CalculiX seems inconsistent with that in PaStiX4CalculiX Jul 28, 2022
@Kabbone
Copy link
Contributor

Kabbone commented Jul 28, 2022

I honestly don't remember why I choose the same name, but I don't think this was on purpose because they are clearly not related to each other.
But this should not be a problem, because pastixdata.h is not included in pastix.c. The pastix_data you are refering to is of type pastix_data_t.
So the problem is located somewhere else.

@uebian
Copy link
Author

uebian commented Jul 29, 2022

In ccx, global variable pastix_data with type pastix_data_s is initilized on pastix.c:262 through calling PaStiX's API pastixInit. However, in PaStiX, this API's argument pastix_data is treated as type pastix_data_t which actually has different type from the caller.
As a result, when I set breakpoint on the end of pastixInit, the value pastix_data->iparm is not null. However, after it returns to CCX, on pastix.c:264, the pointer pastix_data is interpreted as a type that is different from where it is initilized and the value pastix_data->iparm is null because of that.
What's more, changing pastix_data_s in CCX to pastix_data_ss and copy the definition of pastix_data_s from pastixdata.h to pastix.c seems solve this problem, but I don't know if this is actually a bug in CalculiX or some mistakes when compiling this software.

@uebian
Copy link
Author

uebian commented Aug 10, 2022

I'm still getting Segmentation fault after re-compiling CalculiX and PaStiX4CalculiX, is there any follow up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants