Page 1 of 1

Some trouble with examples

Posted: Tue Jan 16, 2018 4:38 pm
by mmj
Hi everybody

I am a newbie FB user. I just installed it and try to run the included examples. For water tutorial ones everything is fine, but when I sent liquid bromine optimization I got an error messagge:


#========================================================#
#| Main Optimizer |#
#| Newton-Raphson Method (Adaptive Trust Radius) |#
#| |#
#| Convergence criteria (1 of 3 needed): |#
#| Objective Function : 5.000e-01 |#
#| Norm of Gradient : 1.000e-02 |#
#| Parameter step size : 5.000e-02 |#
#========================================================#
#========================================================================#
#| Color Key for Objective Function -=X2=- |#
#| Bold = Initial step |#
#| Green = Current lowest value of objective function (best estimate) |#
#| Red = Objective function rises, step rejected |#
#| No color = Not at the lowest value |#
#========================================================================#
#========================================================#
#| Iteration 0: Evaluating objective function |#
#| and derivatives through second order |#
#========================================================#
#========================================================#
#| Target: LiquidBromine - launching MD simulations |#
#| Time steps: 1000 (eq) + 50000 (md) |#
#========================================================#
Running condensed phase simulation locally.
You may tail -f /home/manuel/Descargas/forcebalance-v1.3.1/studies/003_liquid_bromine/optimize.tmp/LiquidBromine/iter_0000/298.15K-1.0atm/npt.out in another terminal window
Executing process: bash rungmx.sh python npt.py gromacs 298.150 1.000 Output: npt.out
Received an error message:

[====] Error Message [====]
Traceback (most recent call last):
File "npt.py", line 62, in <module>
from forcebalance.forcefield import FF
ImportError: No module named forcebalance.forcefield

real 0m0.060s
user 0m0.046s
sys 0m0.013s
bzip2: Can't open input file npt_result.p: No such file or directory.


I checked installation again and it seems to be fine. Am I missing something? Thanks in advance

Re: Some trouble with examples

Posted: Wed Jan 17, 2018 11:25 am
by leeping
Hello Manuel,

Thanks for posting your question. When the liquid bromine example runs, it actually executes a script "rungmx.sh" which then executes a Python script "npt.py". It is important that "rungmx.sh" sets the environment variables correctly so that "npt.py" can import the ForceBalance modules. It's possible this script is altering your environment and not executing the correct version of Python.

Can you look carefully at the script "rungmx.sh" and make any needed modifications? You should make edits to "src/data/rungmx.sh" and reinstall ForceBalance for your changes to take effect.

Thanks,

- Lee-Ping

Re: Some trouble with examples

Posted: Thu Jan 18, 2018 12:33 pm
by mmj
Thank you very much for your answer, Lee-Ping, I appreciate you take some tome for my question. As you told me, I checked rungmx.sh and I found necessary to add appropriate $PYTHONPATH so that FB modules can be called. I reinstalled FB and ran it again, and the error disappeared. But now I got a new error:

[====] Error Message [====]
Traceback (most recent call last):
File "npt.py", line 712, in <module>
main()
File "npt.py", line 341, in main
ML = Molecule(liquid_fnm)
File "/usr/local/lib/python2.7/dist-packages/forcebalance/molecule.py", line 937, in __init__
self.topology = self.build_topology()
File "/usr/local/lib/python2.7/dist-packages/forcebalance/molecule.py", line 1377, in build_topology
dxij = contact.atom_distances(np.array([self.xyzs[sn]]),AtomIterator,np.array([self.boxes[sn].a, self.boxes[sn].b, self.boxes[sn].c]))
File "/usr/local/lib/python2.7/dist-packages/forcebalance/contact.py", line 58, in atom_distances
if box == None:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I also looked for fixing this on my own, but it seems to be related to an ambiguity found by Python. Do you suggest any idea?

Re: Some trouble with examples

Posted: Thu Jan 18, 2018 3:34 pm
by mmj
Update! I found the real problem: Mi bashrc file was exporting an additional /lib folder of another Python version. I just avoided it and the FB is finally running very well for the examples. Thank you again.

Re: Some trouble with examples

Posted: Sun Jan 21, 2018 8:15 am
by leeping
That's great! Please let me know if you have any more issues.