Skip to content

Conversation

ares201005
Copy link
Collaborator

@ares201005 ares201005 commented Jul 6, 2023

C test for density matrix module (passed!)
Python script to generate c wrappers and headers
Add c interface for prg_chebyshev_mod module (Tests TBA)
Add c interface for prg_charges_mod (Tests TBA)

PS:

  1. I found I cannot re-pen previous PR, so created a new PR (will not close it this time).
  2. There are some ci tests fail, I will continue working on them. In the meanwhile, please comment on the code.
  3. I am working on the rest of the modules and corresponding tests as well, will push them into this PR once ready.

This change is Reviewable

@@ -88,6 +102,13 @@ if(PROGRESS_GRAPHLIB)
progress_test(prg_build_zmatGP)
endif()

# c test modules
progress_test(prg_density_c)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the c test names end with "_c" in order to avoid conflicts with Fortran test names.

@ares201005
Copy link
Collaborator Author

Now all the CI checks passed!

@@ -0,0 +1,43 @@
#include <stdlib.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this code supposed to do? Is 'scf' a good name for it? Please add comments

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still do not understand what this file is about. Maybe it should not be added yet?


end subroutine prg_build_density_T0_c

subroutine prg_build_density_T_c(norbs, ham_bml_c, rho_bml_c, threshold, bndfil, kbt, ef, eigenvalues_out) bind(C, name="prg_build_density_T")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you split these long lines?

@ares201005 ares201005 force-pushed the cinterface_pr branch 5 times, most recently from 69fa4c5 to 7bee93f Compare July 13, 2023 04:18
@ares201005
Copy link
Collaborator Author

Changes: 1) Removed scf.c and other commented lines; 2) Added sp2 tests.

@ares201005
Copy link
Collaborator Author

hmm, two CI tests fail on sp2, will work on the fix.

def get_public(fortran_code):

# Define the regex pattern to match lines starting with 'public ::'
pattern = re.compile(r'public ::(.*)')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pattern = re.compile(r'public ::(.*)')
pattern = re.compile(r'public *::(.*)')

The standard does not require exactly one whitespace after the public keyword.

C test for density matrix module and sp2 methods
C interface for prg_chebyshev_mod module
C interface for prg_charges_mod
Python script to generate c wrappers and headers
@ares201005
Copy link
Collaborator Author

Now this PR can be merged. Thanks.

@nicolasbock nicolasbock merged commit 0d7118a into master Jul 20, 2023
@nicolasbock nicolasbock deleted the cinterface_pr branch July 20, 2023 05:10
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

Successfully merging this pull request may close these issues.

3 participants