Installing hoomd and first using

443 views
Skip to first unread message

Денис Владимирович Ильинов

unread,
Jun 30, 2016, 8:13:19 AM6/30/16
to hoomd-users
Hello! I have installed hoomd through miniconda and everything was ok and was working. But then I removed conda and hoomd and now I have reinstalled hoomd. But when I started with script from quick start tutorial I are looking now this:

[ ~Miniconda2]$ python
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jun 29 2016, 11:08:50)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
>>> import hoomd
HOOMD-blue v2.0.0 CUDA (7.5) DOUBLE HPMC_MIXED MPI SSE SSE2 SSE3
Compiled: 06/22/2016
Copyright 2009-2016 The Regents of the University of Michigan.
-----
You are using HOOMD-blue. Please cite the following:
* J A Anderson, C D Lorenz, and A Travesset. "General purpose molecular dynamics
  simulations fully implemented on graphics processing units", Journal of
  Computational Physics 227 (2008) 5342--5359
* J Glaser, T D Nguyen, J A Anderson, P Liu, F Spiga, J A Millan, D C Morse, and
  S C Glotzer. "Strong scaling of general-purpose molecular dynamics simulations
  on GPUs", Computer Physics Communications 192 (2015) 97--107
-----
>>> from  hoomd _script import *
  File "<stdin>", line 1
    from  hoomd _script import *
                      ^
SyntaxError: invalid syntax
>>> context.initialize()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'context' is not defined
>>> # create 100 random particles of name A
... init.create_random(N=100, phi_p=0.01, name='A')
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
NameError: name 'init' is not defined
>>> # specify Lennard-Jones interactions between particle pairs
... lj = pair.lj(r_cut=3.0)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
NameError: name 'pair' is not defined
>>> lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'lj' is not defined
>>> # integrate at constant temperature
... all = group.all();
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
NameError: name 'group' is not defined
>>> integrate.mode_standard(dt=0.005)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'integrate' is not defined
>>> integrate.nvt(group=all, T=1.2, tau=0.5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'integrate' is not defined
>>> # run 10,000 time steps
... run(10e3)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
NameError: name 'run' is not defined
>>>

So, what can it be?  Please, help me)

Ludwig Schneider

unread,
Jun 30, 2016, 8:20:04 AM6/30/16
to hoomd...@googlegroups.com
Hi,


it seems, that during your re-installation process you changed from
hoomd v1.x to hoomd v2.x.

The commands you describe have changed in between the versions, refer
the changelog:

https://bitbucket.org/glotzer/hoomd-blue/src/a5dec838c7b3d9677d3ea8df8b93f14f52394e96/ChangeLog.md?fileviewer=file-view-default#markdown-header-v200

The organization in hoomd changed a little and some of your commands are
deprecated by now.
Check the new doc to fix your scripts.

http://hoomd-blue.readthedocs.io/en/stable/

I hope, I could help you,

Ludwig

Денис Владимирович Ильинов

unread,
Jun 30, 2016, 9:24:18 AM6/30/16
to hoomd-users
Thank you, Ludwig! It is possibly that you are right. But I have not any my own scripts yet. I want to say - it is right, that I firstly write "python" command, then write "import hoomd", and finally run the script? Also, now  I can't use command "hoomd" in my linux terminal window.  

четверг, 30 июня 2016 г., 15:13:19 UTC+3 пользователь Денис Владимирович Ильинов написал:

Денис Владимирович Ильинов

unread,
Jun 30, 2016, 9:53:20 AM6/30/16
to hoomd-users
And there is problem even with "run" NameError: name 'run' is not defined ! Why I have this trouble?


четверг, 30 июня 2016 г., 15:13:19 UTC+3 пользователь Денис Владимирович Ильинов написал:
Hello! I have installed hoomd through miniconda and everything was ok and was working. But then I removed conda and hoomd and now I have reinstalled hoomd. But when I started with script from quick start tutorial I are looking now this:

Ludwig Schneider

unread,
Jun 30, 2016, 9:57:09 AM6/30/16
to hoomd...@googlegroups.com
The run command is no longer defined in the global scope.

I attach a script, which works with mine v2 installation.

Unfortunately, I do not use a mini conda installation.

Try to run this script. And adjust your scripts accordingly.

I run it like:

python test.py


I think the hoomd cmd is longer part of the installation, but I could be
wrong. It is not needed anymore.
test.py

Денис Владимирович Ильинов

unread,
Jun 30, 2016, 10:37:51 AM6/30/16
to hoomd-users
Thanks! This script is running with success))  So you are right. But it is not good, that there is no possibility to utilize command hoomd in global scope I think.


четверг, 30 июня 2016 г., 15:13:19 UTC+3 пользователь Денис Владимирович Ильинов написал:
Hello! I have installed hoomd through miniconda and everything was ok and was working. But then I removed conda and hoomd and now I have reinstalled hoomd. But when I started with script from quick start tutorial I are looking now this:

Eric Irrgang

unread,
Jun 30, 2016, 11:13:38 AM6/30/16
to hoomd...@googlegroups.com
As with any python module, you can still import whatever you want into the global namespace. E.g.
    from hoomd import run, md
or
    from hoomd import *

--
You received this message because you are subscribed to the Google Groups "hoomd-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To post to this group, send email to hoomd...@googlegroups.com.
Visit this group at https://groups.google.com/group/hoomd-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages