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

Use of PetscScalar instead of PetscReal Types #3

Open
lazersos opened this issue Jan 2, 2018 · 7 comments
Open

Use of PetscScalar instead of PetscReal Types #3

lazersos opened this issue Jan 2, 2018 · 7 comments

Comments

@lazersos
Copy link
Collaborator

lazersos commented Jan 2, 2018

The code is written using the PetscScalar type, but when linked to the complex version of the Petsc this type is of type COMPLEX making many of the logical statements syntactically incorrect. Also there are some issues with other intrinsic functions. The fix is to use the PetscReal type. However, this may introduce other issues. I'm going to test it out.

@lazersos
Copy link
Collaborator Author

lazersos commented Jan 2, 2018

Just a quick update is seems that for some reason, the diagnostic.F90 routines need a few arrays to be PetscScalar. The same is true in populateMatrix.F90.

@lazersos
Copy link
Collaborator Author

lazersos commented Jan 2, 2018

Compilation seems fine now. However, the PPPL build of PetSc was done without MUMPS so I need to get that corrected before I make more progress.

@landreman
Copy link
Owner

landreman commented Jan 2, 2018 via email

@lazersos
Copy link
Collaborator Author

lazersos commented Jan 2, 2018

@landreman
Just spitballing here but in SFINCS many of the variables are declared as PetscScalar. When compiled and linked with PETSc complex this automatically changes the type to the Fortran COMPLEX type. This should result in twice the memory usage. If they were all typed as PetscReal then I would suspect this memory usage behavior would disappear.
I could be wrong though. It depends on how casting is being handled internally. If PETSc was pure Fortran then at some level there must be differently defined subroutines for those with REAL, DOUBLE PRECISION, and COMPLEX input types. In the end the issue will be the interface to STELLOPT. When linking to GENE we link to complex PETSc and SLEPc. Either way I'll explore if there is a workaround.
Of course first I have to get the IT group at PPPL to compile PETSc with MUMPS support.
-Sam

@amollen
Copy link
Collaborator

amollen commented May 18, 2020

@lazersos Noticed this old issue. Can I close it?

@lazersos
Copy link
Collaborator Author

@amollen Has SFINCS been updated to use the PetscReal?

@amollen
Copy link
Collaborator

amollen commented May 18, 2020

@lazersos No it doesn't look like. I don't think anyone is working on it though. Maybe it is straightforward just changing all PetscScalar to PetscReal. Since the issue is more than two years old I thought it had just been left behind. But we can keep it open in case someone gets interested in doing it.

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

3 participants