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

examples not running in FFX -- multiple issues #243

Closed
blakemertz opened this issue Apr 5, 2024 · 2 comments
Closed

examples not running in FFX -- multiple issues #243

blakemertz opened this issue Apr 5, 2024 · 2 comments

Comments

@blakemertz
Copy link

Trying to run through some of the examples on the FFX website. I have gotten minimization to run successfully in two different instances. I started running into crashes when trying to do a GPU-accelerated sidechain optimization: https://ffx.biochem.uiowa.edu/examples-gpuSideChain.html

FFX is not accepting all of the provided options. The message about long-form arguments shouldn't apply here, since I am using one-letter flags for all of the options.

/media/bak11/binaries/git/forcefieldx/bin/ffxc ManyBody -Dplatform=OMM -a 2 -l 2 -tC 1000 -x 1 -p 1 4gvd.pdb_2

 Fri Apr 05 13:46:16 CDT 2024
 Process ID 169103 on nei-gpu.

 Command line arguments:
 [ManyBody, -a, 2, -l, 2, -tC, 1000, -x, 1, -p, 1, 4gvd.pdb_2]

 Starting up the command line interface.

 Executing internal script: ffx.algorithms.groovy.ManyBody

Apr 05, 2024 1:46:16 PM ffx.utilities.FFXScript init
WARNING:  The usual source of this exception is when long-form arguments (such as --uaA) are only preceded by one dash (such as -uaA, which is an error).

Apr 05, 2024 1:46:16 PM ffx.ui.ModelingShell runFFXScript
SEVERE:  Uncaught error: FFX is shutting down.

picocli.CommandLine$UnmatchedArgumentException: Unknown options: '-tC', '-x', '1', '-p', '1', '4gvd.pdb_2'
	at picocli.CommandLine$Interpreter.validateConstraints(CommandLine.java:13662)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13614)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13559)
	at picocli.CommandLine$Interpreter.parse(CommandLine.java:13454)
	at picocli.CommandLine.parseArgs(CommandLine.java:1552)
	at ffx.utilities.FFXScript.init(FFXScript.java:295)
	at ffx.algorithms.cli.AlgorithmsScript.init(AlgorithmsScript.java:126)
	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:336)
	at ffx.algorithms.groovy.ManyBody.run(ManyBody.groovy:109)
	at ffx.algorithms.groovy.ManyBody.run(ManyBody.groovy)
	at ffx.utilities.FFXScript.run(FFXScript.java:72)
	at ffx.ui.ModelingShell.runFFXScript(ModelingShell.java:724)
	at ffx.Main.runScript(Main.java:574)
	at ffx.Main.startCommandLineInterface(Main.java:430)
	at ffx.Main.main(Main.java:215)


 picocli.CommandLine$UnmatchedArgumentException: Unknown options: '-tC', '-x', '1', '-p', '1', '4gvd.pdb_2'
 Force Field X will not continue.
 Shutting down...

When I moved on to the MC-OST free energy example of transformation of one water molecule, I get a different error message when trying to run Dynamics:

/media/bak11/binaries/git/forcefieldx/bin/ffxc DynamicsOpenMM -n 1000000 -d 1.0 -z 100 -i STOCHASTIC -t 298.15 -k 10.0 -w 10.0 -F XYZ waterbox_min.xyz

 Fri Apr 05 13:56:03 CDT 2024
 Process ID 169444 on nei-gpu.

 Command line arguments:
 [DynamicsOpenMM, -n, 1000000, -d, 1.0, -z, 100, -i, STOCHASTIC, -t, 298.15, -k, 10.0, -w, 10.0, -F, XYZ, waterbox_min.xyz]

 Starting up the command line interface.

Apr 05, 2024 1:56:04 PM ffx.utilities.FFXScript getScript
WARNING:  DynamicsOpenMM was not found.

When I specify the OMM platform (and rename a copy of waterbox.properties to waterbox_min.properties), Dynamics will now run, but crashes while trying to find a library associated with openMM:

/media/bak11/binaries/git/forcefieldx/bin/ffxc Dynamics -Dplatform=OMM -n 1000000 -d 1.0 -z 100 -i STOCHASTIC -t 298.15 -k 10.0 -w 10.0 -F XYZ waterbox_min.xyz

 Fri Apr 05 14:05:28 CDT 2024
 Process ID 169707 on nei-gpu.

 Command line arguments:
 [Dynamics, -n, 1000000, -d, 1.0, -z, 100, -i, STOCHASTIC, -t, 298.15, -k, 10.0, -w, 10.0, -F, XYZ, waterbox_min.xyz]

 Starting up the command line interface.

 Executing internal script: ffx.algorithms.groovy.Dynamics

 Parsing: Internal force field (amoeba-water-2003).
 Parsing: Structure properties from (/media/bak11/binaries/git/forcefieldx/examples/waterbox_min.properties).
 Parsing: JVM system properties (i.e. command line -Dkey=value pairs).

 Opening waterbox_min.xyz with 12000 atoms

 Constructing Force Field AMOEBA-WATER-2003

 SMP threads:                                16

 Density:                                 1.003 (g/cc)

 Unit Cell
  A-axis:                                49.232 (  49.232,    0.000,    0.000)
  B-axis:                                49.232 (   0.000,   49.232,    0.000)
  C-axis:                                49.232 (   0.000,    0.000,   49.232)
  Alpha:                                 90.000
  Beta:                                  90.000
  Gamma:                                 90.000
  Space group
   Number:                                    1
   Symbol:                                   P1
   Number of Symmetry Operators:              1

 Bonded Terms
  Bonds:                                   8000
  Angles:                                  4000
  Urey-Bradleys:                           4000

 Non-Bonded Terms

  Van der Waals
   Switch Start:                         10.800 (A)
   Cut-Off:                              12.000 (A)
   Long-Range Correction:                 FALSE


 Electrostatics
   Polarization:                         MUTUAL
    SCF Convergence Criteria:         1.000e-06
    SCF Predictor:                         NONE
    SCF Algorithm:                           CG
    CG Preconditioner Cut-Off:            4.500
    CG Preconditioner Ewald Coeff.:       0.000
    CG Preconditioner Scale:              2.000
    CG Preconditioner Mode:     FLETCHER_REEVES
   Particle-mesh Ewald
    Ewald Coefficient:                    0.545
    Particle Cut-Off:                     7.000 (A)
    B-Spline Order:                           5
    Mesh Density:                         1.200
    Mesh Dimensions:              ( 60, 60, 60)
    Grid Method:                        SPATIAL


  Overall system charge:                  0.000

 Initializing OpenMM
Exception in thread "Thread-8" java.lang.UnsatisfiedLinkError: Error looking up function 'OpenMM_LangevinMiddleIntegrator_getRandomNumberSeed': /lib/x86_64-linux-gnu/libOpenMM.so: undefined symbol: OpenMM_LangevinMiddleIntegrator_getRandomNumberSeed
	at com.sun.jna.Function.<init>(Function.java:255)
	at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:618)
	at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:594)
	at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:580)
	at com.sun.jna.Native.register(Native.java:1900)
	at edu.uiowa.jopenmm.OpenMMLibrary.<clinit>(OpenMMLibrary.java:29)
	at ffx.potential.openmm.OpenMMContext.loadPlatform(OpenMMContext.java:362)
	at ffx.potential.openmm.OpenMMContext.<init>(OpenMMContext.java:137)
	at ffx.potential.openmm.OpenMMEnergy.<init>(OpenMMEnergy.java:140)
	at ffx.potential.ForceFieldEnergy.energyFactory(ForceFieldEnergy.java:1845)
	at ffx.potential.ForceFieldEnergy.energyFactory(ForceFieldEnergy.java:1826)
	at ffx.ui.UIFileOpener.open(UIFileOpener.java:185)
	at ffx.ui.UIFileOpener.run(UIFileOpener.java:159)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Apr 05, 2024 2:05:31 PM ffx.ui.ModelingShell runFFXScript
SEVERE:  Uncaught error: FFX is shutting down.

java.lang.NullPointerException: Cannot invoke "ffx.potential.openmm.OpenMMContext.update()" because "this.openMMContext" is null
	at ffx.potential.openmm.OpenMMEnergy.energy(OpenMMEnergy.java:293)
	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:336)
	at ffx.algorithms.groovy.Dynamics.run(Dynamics.groovy:149)
	at ffx.algorithms.groovy.Dynamics.run(Dynamics.groovy)
	at ffx.utilities.FFXScript.run(FFXScript.java:72)
	at ffx.ui.ModelingShell.runFFXScript(ModelingShell.java:724)
	at ffx.Main.runScript(Main.java:574)
	at ffx.Main.startCommandLineInterface(Main.java:430)
	at ffx.Main.main(Main.java:215)


 java.lang.NullPointerException: Cannot invoke "ffx.potential.openmm.OpenMMContext.update()" because "this.openMMContext" is null
 Force Field X will not continue.
 Shutting down...

It looks like FFX is referencing my Debian-based installation of openMM (/usr/lib/libOpenMM.so). I was under the impression that FFX was rolling its own installation of openMM? (See my other issue #242) This may also be an issue where documentation either needs to be updated or included, as the link I tried following earlier is currently broken (https://ffx.biochem.uiowa.edu/modules/openmm/index.html).

@anessler
Copy link
Contributor

anessler commented Apr 9, 2024

Hello blakemertz,

Unfortunately I have not had sufficient time to experiment with utilizing independent installations of OpenMM, therefore I will have to defer responding to the third issue until a later date. Additionally, it would not surprise me if the documentation needs to be updated... However, I believe I may have solutions to the first two issues (both of which the examples will need to be corrected/updated):

I believe the UnmatchedArgumentException is a typo in the example as FFX flags with more than one letter use two dashes (e.g., "--tC 1000") whereas flags with only one letter use a single dash (e.g., "-a 2", "-l 2").

I believe when the example for "DynamicsOpenMM" was written, "Dynamics" and "DynamicsOpenMM" were two separate commands. Now they should both be accessed through the "Dynamics" command with additional flags to specify the use of OpenMM (e.g., "ffxc -Dplatform=OMM Dynamics --mdE OpenMM ..."). Typing "ffxc --help" will display the list of currently available commands.

All the best,
anessler

@blakemertz
Copy link
Author

@anessler thanks for the response -- I think we will have to wait for @mjschnie to chime in on the openMM issue, as that is a bit more complicated, I am afraid.

Usage: ManyBody [-EhOTVz] [--dee] [--oP] [--oT] [--tR] [-a=0]
                [--ac=<selection>] [--bB=0.0] [--bC=1] [--bL=20.0] [--ch=<A>]
                [--clashThreshold=25.0] [--eR=none] [--fB=<finalBox>]
                [--fR=<final>] [--iB=<initialBox>] [--iC=<inclusionCutoff>]
                [--increment=3] [--iR=<interestedResidue>] [--kPH=0.0] [-l=-1]
                [-L=2] [--lR=<list>] [--mC=-1] [--nB=3,3,3]
                [--pairClashThreshold=25.0] [--pH=0] [--pr=1] [--radius=2.0]
                [--sR=<start>] [--tC=3.0] [--thC=3.0] [--uc=<selection>]
                [--window=7] file
 Run ManyBody algorithm on a system.
      file                  XYZ or PDB input file.
  -h, --help                Print command help and exit.
  -V, --version             Print the Force Field X version and exit.

 Many-Body Optimization Options
  -a, --algorithm=0         Algorithm: default automatic settings (0),
                              independent residues (1), all with rotamer
                              elimination (2), all brute force (3), sliding
                              window (4), or box optimization (5)
      --dee, --deadEnd      Use dead-end elimination criteria instead of
                              Goldstein criteria.
  -E, --decompose           Print energy decomposition for the input structure
                              (no optimization!).
      --eR, --energyRestart=none
                            Load energy restart file from a previous run
                              (requires that all parameters are the same).
  -L, --library=2           Ponder and Richards (1) or Richardson (2) rotamer
                              library.
      --mC, --monteCarlo=-1 Follow elimination criteria with (n) Monte Carlo
                              steps, or enumerate all remaining conformations,
                              whichever is smaller.
  -O, --noOriginal          Do not include starting coordinates as their own
                              rotamer.
      --pH, --titrationPH=0  Optimize the titration state of ASP, GLU, HIS and
                              LYS residues at the given pH (pH = 0 turns off
                              titration
      --tR, --titration      Turn on titration state optimization
  -z, --revert              Revert unfavorable changes.

 Many-Body Box Optimization Options
      --bB, --boxBorderSize=0.0
                            Extent of overlap between optimization boxes in
                              Angstroms.
      --bC, --boxInclusionCriterion=1
                            Criterion to use for adding a residue to a box: (1)
                              uses C alpha only (N1/9 for nucleic acids), (2)
                              uses any atom, and (3) uses any rotamer
      --bL, --approxBoxLength=20.0
                            Approximate side lengths of boxes to be constructed
                              (over-rides numXYZBoxes).
      --fB, --finalBox=<finalBox>
                            Final box to optimize.
      --iB, --initialBox=<initialBox>
                            Initial box to optimize.
      --nB, --numBoxes=3,3,3
                            Specify number of boxes along X, Y, and Z (default:
                              3,3,3)

 Many-Body Window Optimization Options
      --increment=3         Sliding window increment.
      --window=7            Size of the sliding window with respect to adjacent
                              residues.

 Many-Body Energy Expansion and Cut-off Options
      --clashThreshold=25.0 The threshold for pruning clashes.
      --kPH, --pHRestraint=0.0
                            Only allow titration state to change fromstandard
                              state is self energy exceeds the restraint.
      --pairClashThreshold=25.0
                            The threshold for pruning pair clashes.
      --pr, --prune=1       Prune no clashes (0), only single clashes (1), or
                              all clashes (2)
      --radius=2.0          The sliding box and window cutoff radius
                              (Angstroms).
  -T, --threeBody           Include 3-Body interactions in the elimination
                              criteria.
      --tC, --twoBodyCutoff=3.0
                            Cutoff distance for two body interactions.
      --thC, --threeBodyCutoff=3.0
                            Cutoff distance for three-body interactions.

 Many-Body Residue Selection Options
      --ch, --chain=<A>     Include only specified chain ID (default: all
                              chains).
      --fR, --final=<final> Final residue to optimize (default: all residues).
      --iC, --inclusionCutoff=<inclusionCutoff>
                            Distance which rotamers will be included when using
                              only protons, titratable residues, or interested
                              residue.
      --iR, --interestedResidue=<interestedResidue>
                            Optimize rotamers within some distance of a
                              specific residue.
      --lR, --listResidues=<list>
                            Select a list of residues to optimize (eg. A11,A24,
                              B40).
      --oP, --onlyProtons   Rotamer optimize only proton movement.
      --oT, --onlyTitration Rotamer optimize only titratable residues.
      --sR, --start=<start> Starting residue to optimize (default: all
                              residues).

 Alchemical Options
      --ac, --alchemicalAtoms=<selection>
                            Specify alchemical atoms [ALL, NONE, Range(s): 1-3,
                              6-N].
  -l, --lambda=-1           Initial lambda value.
      --uc, --unchargedAtoms=<selection>
                            Specify atoms without electrostatics [ALL, NONE,
                              Range(s): 1-3,6-N].

Looking at the help for ManyBody and the output error, -x and -p are not being accepted as arguments.

  • -p has been replaced by --pr (for pruning clashes)
  • -x appears to have been replaced by --sR?

When I replaced these flags with the updated ones and removed the call to openMM, the following now works:
ffxc ManyBody -a 2 -l 2 --sR 1 --pr 1 --tC 1000 4gvd.pdb_2
Just sucks that openMM cannot currently be utilized, as that is a significant slowdown in the code.....

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

No branches or pull requests

2 participants