Skip to content

Conversation

@TiborGY
Copy link
Contributor

@TiborGY TiborGY commented Sep 24, 2022

Description

There are some IO functions declared in psio.h instead of psio.hpp, which manipulate the state of the global PSIO object. Some of these functions are never called, a few other functions are declared but never defined.
This PR removes them.

User API & Changelog headlines

  • No user facing or API changes

Dev notes & details

  • Unused global-scope psio_* functions are removed

Status

  • Ready for review
  • Ready for merge

Copy link
Contributor

@JonathonMisiewicz JonathonMisiewicz left a comment

Choose a reason for hiding this comment

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

Given how difficult PSIO is to use for non-experts (which is anybody who is going to be using it nowadays), I'd rather keep thin but descriptive wrappers.

@loriab
Copy link
Member

loriab commented Sep 24, 2022

btw, don't exert much effort on anything only used by optking as hopefully that gets deleted by end of year.

@TiborGY TiborGY marked this pull request as ready for review September 24, 2022 21:40
@TiborGY
Copy link
Contributor Author

TiborGY commented Sep 24, 2022

Given how difficult PSIO is to use for non-experts (which is anybody who is going to be using it nowadays), I'd rather keep thin but descriptive wrappers.

Very well. The two functions in question are now preserved.

@JonathonMisiewicz JonathonMisiewicz dismissed their stale review September 24, 2022 22:38

Feedback adopted.

Copy link
Member

@loriab loriab left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me, and will help define more tightly the needed I/O interface. Would be good to get 3rd review from an early developer.

@lothian
Copy link
Contributor

lothian commented Oct 3, 2022

Just to confirm: these are almost all just removal of the C-based wrapper functions, correct?

@TiborGY
Copy link
Contributor Author

TiborGY commented Oct 3, 2022

Just to confirm: these are almost all just removal of the C-based wrapper functions, correct?

Yes.

As far as I can tell different modules seem to be using PSIO in slightly different ways. The newer modules tend to create their own PSIO object and then call its member functions, but older modules seem to be more reliant on global state. To satisfy this, there is a "global PSIO object", and some wrapper functions have been written that usually do the same thing as the corresponding PSIO member functions, except they are regular functions and they manipulate the "global PSIO object".

This PR removes the unused ones.

@lothian
Copy link
Contributor

lothian commented Oct 3, 2022

Yes, I believe the global PSIO object was to created to minimize the changes needed to older modules that worked with the pre-OOP version of the library.

@JonathonMisiewicz JonathonMisiewicz merged commit ac8f87a into psi4:master Oct 3, 2022
@loriab loriab added this to the Psi4 1.7 milestone Oct 3, 2022
@loriab loriab added the cleanup For issues where the goal is to make Psi4 a little cleaner. label Oct 3, 2022
@TiborGY TiborGY deleted the psio_remove_unused_2 branch October 6, 2022 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup For issues where the goal is to make Psi4 a little cleaner.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants