Skip to content

Comments

Initialize maxmove input variable for all file types#98

Merged
lmiq merged 1 commit intom3g:masterfrom
Eigenstate:initialize-maxmove
Jul 11, 2025
Merged

Initialize maxmove input variable for all file types#98
lmiq merged 1 commit intom3g:masterfrom
Eigenstate:initialize-maxmove

Conversation

@Eigenstate
Copy link
Contributor

Problem

I noticed failures to converge when using input files in the xyz format, with output steps like:

--------------------------------------------------------------------------------

  Starting GENCAN loop:            2
  Scaling radii by:    1.0000000000000000

  Packing:|0                                                        100%|
          |***

  Function value from last GENCAN loop: f = .12819E+01
  Best function value before: f = .12819E+01
  Improvement from best function value:    -0.00 %
  Improvement from last loop:    -0.00 %
  Maximum violation of target distance:     0.199288
  Maximum violation of the constraints: .29794E+00
  All-type function value: .12819E+01
--------------------------------------------------------------------------------

  Moving worst molecules ...
  Function value before moving molecules:   1.2818851334743486
  Type         1 molecules with non-zero contributions:    3.52%
  Moving         0 molecules of type         1
  New positions will be based on good molecules (movebadrandom is not set)
   Moving:|0                                                        100%|
          ||
  Function value after moving molecules:   1.2818851334743486

--------------------------------------------------------------------------------

and no change in function value between steps.

The number of molecules to move is set in heuristics.F90:
nmove = min0(maxmove(itype),max0(int(nmols(itype)*frac),1))

and I found that maxmove was all 0, as it was only being parsed for the PDB file format.

This PR:

  • Sets the default value of maxmove to be the number of molecules of the type (as the default is according to the docs)
  • Parses maxmove from the structure section of input regardless of file type.

Testing

  • Tested that this fixed the systems I failed to build, both using the default and explicitly defining maxmove in the input.
  • Tests in testing/ pass.

maxmove sets the number of molecules that may be moved to a better
position and defaults to all molecules in the structure section. However
this was only being parsed for the pdb file format, resulting in 0
molecules being moved in movebad in heuristics.F90 and failure to
converge for inputs of non-pdb file formats.

This PR sets the default value regardless of file type and parses it out
of the structure section.
@lmiq
Copy link
Member

lmiq commented Jul 11, 2025

Thank you very much!

@lmiq lmiq merged commit 07e5e45 into m3g:master Jul 11, 2025
4 checks passed
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.

2 participants