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

C Library #89

Merged
merged 36 commits into from
Sep 12, 2023
Merged

C Library #89

merged 36 commits into from
Sep 12, 2023

Conversation

cindytsai
Copy link
Collaborator

C Library

  • Make libyt a C library. It is now compatible both in C and C++.
    • libyt defined struct now contains only constructor.
    • The constructor is there only if the library is compiled under g++.
    • Other checking and printing methods are moved elsewhere.
  • Hide internal libyt data away from user, and use LibytProcessControl (Singleton) to keep track of the data.
    • Process check points like libyt_initialized, param_yt_set ... are all moved to this class.
    • field_list, particle_list, grids_local, num_grids_local_MPI originally under yt_param_yt are also moved to this class.
  • Add libyt.libyt_info dict to libyt Python module. It keeps libyt info:
    • libyt_info["version"]: a tuple with version (major, minor, micro)
    • `libyt_info["interactive_mode"]: true/false, if it is in interactive mode or not.
  • Allow user to set INSTALL_PREFIX to install libyt to somewhere else.

Fix Bug

  • Fix bug when checking non-zero indexing hierarchy.

Update Doc

  • Fix GitHub alerted vulnerabilities activesupport, nokogiri.

GitHub Action

  • GitHub Action now tests if libyt can successfully installed to INSTALL_PREFIX.

Bug: cannot compile with -Dxxx, which is now libyt only compiles to interactive mode.
I know it is a bad practice to use singleton.
What I'm trying to do is to make libyt a C-library and hide libyt internal data from users with minimal changes to code.
I have plans to refactor libyt, so that it is easier to add more stuff. ()
There are some bugs in CMakeLists.txt, but at least CLion recognize my project file.
Will come back to fix this in this PR.
… LibytProcessControl singleton.

Hide libyt internal data away from user with minimal changes in source code. They are now inside LibytProcessControl singleton.
Fix the bug of not including string.h header in example.cpp, since I have removed string.h header out of yt_type_particle.h.
Since yt_macro.h is part of libyt API, but we don't need these two functions. It is for internal libyt usage.
Though I updated cmake and it worked on my machine, I think it is not ready to merge to main, since I still cannot make it to use mpicxx or specify g++ compiler. Some designed mpicxx compiler for specific CPUs or HPC systems may crash, even though I haven't tested yet.
…ON macro..

Set version in libyt_info["version"], and other info.
blablabla about replacing node12 with node16.
@cindytsai cindytsai added bug Something isn't working doc Improvements or additions to documentation enhancement New feature or request new-feature New feature. labels Sep 11, 2023
@cindytsai cindytsai self-assigned this Sep 11, 2023
@cindytsai cindytsai merged commit 0809b0e into yt-project:main Sep 12, 2023
4 checks passed
@cindytsai cindytsai deleted the PR-CLibrary branch September 12, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working doc Improvements or additions to documentation enhancement New feature or request new-feature New feature.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant