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

Fix gfnff printout for oniom and add $ignore topo #783

Merged
merged 9 commits into from
Jul 8, 2023

Conversation

Albkat
Copy link
Contributor

@Albkat Albkat commented Mar 13, 2023

  1. fix oniom gfn2:gfnff printout for structure optimization by printing energies and gradients during each cycle
  2. add $ignore topo instruction to bypass the topology check when cutting bonds
  3. comment: gfnff_eg.f90, timer.f90, oniom.f90

if (pr) then
call timer%new(10 + count([allocated(solvation)]),.false.)
else
call timer%new(1, .false.)
Copy link
Member

Choose a reason for hiding this comment

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

Don't print if not verbose.

@@ -612,7 +615,10 @@ subroutine gfnff_eg(env,pr,n,ichrg,at,xyz,makeq,g,etot,res_gff, &
! which is computed here to get the atomization energy De,n,at(n)
call goed_gfnff(env,.true.,n,at,sqrab,srab,dfloat(ichrg),eeqtmp,cn,qtmp,eesinf,solvation,param,topo)
de=-(etot - eesinf)
else
call timer%write(6)
Copy link
Member

Choose a reason for hiding this comment

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

Is this for debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is added to print the calculation time for a single cycle during the gfnff geometry optimization.

Gfnff_opt

Copy link
Member

Choose a reason for hiding this comment

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

How about a minpr level compared to a full pr level of verbosity? (better variable names highly appreciated)

Copy link
Contributor Author

@Albkat Albkat Mar 14, 2023

Choose a reason for hiding this comment

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

What do you think about adding an optional argument to the gfnff_eg only for the case of optimization?
Otherwise, I do not see the reason for changing pr into minpr (or maybe optpr as an alternative name).

Copy link
Member

Choose a reason for hiding this comment

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

I have to agree with @awvwgk here. I don't see this as a necessary default printout and would prefer if this would only be written if verbose is specified.
Additionally, it would be better if we make it more clear, that this is the single cycle time. total time might be misleading.

Copy link
Contributor Author

@Albkat Albkat May 26, 2023

Choose a reason for hiding this comment

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

So I added minpr/optpr option for geometry optimization + changed total time to iter.time for clarity.
Btw, I think we should reassign global printlevel var to TSet class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@awvwgk, I added the changes you requested.
@MtoLStoN, the output for gfnff optimization now looks like:

image

PS: In this PR I added the commit 78fd138 that only cleans and comments file timer.f90

src/oniom.f90 Outdated Show resolved Hide resolved
@Albkat Albkat added the enhancement New feature or request label Mar 15, 2023
Albkat and others added 6 commits June 20, 2023 11:29
Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
src/gfnff/calculator.f90 Outdated Show resolved Hide resolved
if (pr) call timer%new(10 + count([allocated(solvation)]),.false.)
if (pr) then
call timer%new(10 + count([allocated(solvation)]),.false.)
else if (present(minpr) .and. minpr) then
Copy link
Member

Choose a reason for hiding this comment

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

You cannot check for presence of an optional argument and use the argument in the same condition as the argument might not be present and the order of evaluation is not guaranteed.

Comment on lines 56 to 58
!> dummy arg list
class(tb_timer),intent(inout) :: self
!! instance of timer
Copy link
Member

Choose a reason for hiding this comment

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

Please be consistent, either add all comments before or after the variable name. In xtb I have been using comments before the variables so far.

src/type/timer.f90 Outdated Show resolved Hide resolved
src/type/timer.f90 Outdated Show resolved Hide resolved
src/type/timer.f90 Outdated Show resolved Hide resolved
call self%deallocate
if (n < 1) return
call timing(time_cpu,time_wall)
!! capture negative values
Copy link
Member

Choose a reason for hiding this comment

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

Both !! and !> create a docstring for tools like FORD or doxygen, these tools usually get confused if variables and statements are documented this way which are not part of the interface of the procedure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All right, I checked the FORD documentation, and see your point.
I try to be consistent within the source using only predocmark (!>) .

Did you try to generate xtb-docstring using FORD?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I tried a while ago, but never deployed because we don't had a good coverage of docstrings so far. Still good to work toward the goal of deploying the whole docs in the future like for tblite.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a lot of fun ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I rewrote all my comments in a consistent style, so I think this PR is good to go.

It will be helpful to establish some style guide in the best case directly in GitHub, but I am not aware if it is possible. Do you know any means of doing that?
Another possibility would be just add here a developer guide.

Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
.gitignore Outdated Show resolved Hide resolved
Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

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

Looks good to me now

@Albkat Albkat merged commit a623800 into grimme-lab:main Jul 8, 2023
9 checks passed
@Albkat Albkat deleted the dev branch July 21, 2023 08:55
marcelmbn pushed a commit to marcelmbn/xtb that referenced this pull request Aug 15, 2023
* add the 'ignore topo' in the control

Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>

* fix gfnff printout for oniom opt

Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>

* Update calculator.f90

* Update src/oniom.f90

Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>

* add minpr to print iter time during gfnff geo_opt

Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>

* clear timer.f90

Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>

* consistent comments: oniom.f90, gfnff_eg.f90, timer.f90

Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>

* Update .gitignore

---------

Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants