Particle with unique tac <...> has NaN for its position

251 views
Skip to first unread message

José Manuel Ruiz Franco

unread,
Oct 14, 2019, 11:23:44 AM10/14/19
to hoomd-users
Dear HOOMD users,

I am trying to perform MPCD simulations of a polymer system. To do this, I define the number of solvent particles.
After that, I define the forces, and finally, I define the MPCD integrator. After that, when I run the simulation, I have the following
sentence:

Particle with unique tag <...> has NaN for its position

I have this problem using both, mpcd.collide.srd and mpcd.colloide.at, independently of the seed. The tag changes with the seed.
I am using HOOMD 2.7.0V

Thank you.

Jose.

Michael Howard

unread,
Oct 14, 2019, 12:59:36 PM10/14/19
to hoomd-users
Hi Jose,

Does the simulation run correctly if you replace the MPCD integrator with a Langevin integrator?

Please also supply a minimum reproducer script, the full error output, and details of how you ran the simulation (cpu / gpu, mpi / no mpi, etc.).

Regards,
Mike

José Manuel Ruiz Franco

unread,
Oct 14, 2019, 2:57:09 PM10/14/19
to hoomd...@googlegroups.com
Dear Mike,

thank you for your email. I am running the simulation on CPU. I fixed the problem by changing the seed.
Now, the seed of mpcd.colloid.srd starts from a higher number than 42. Indeed, I am using 744.ndeed, I am using 744.

Before, I had the following error output:

notice(2): -- Neighborlist exclusion statistics -- : notice(2): Particles with 2 exclusions : 4622 notice(2): Particles with 4 exclusions : 250 notice(2): Neighbors included by diameter : no notice(2): Neighbors excluded when in the same body: no
**ERROR**: Particle with unique tag 4040 has NaN for its position.
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-23-5360be8f9bb4> in <module>()
      5 
      6 #hoomd.run(100, callback=my_callback, callback_period=1)
----> 7 hoomd.run(10e1, quiet=True)

/home/proteus/.local/lib/python3.6/hoomd/__init__.py in run(tsteps, profile, limit_hours, limit_multiple, callback_period, callback, quiet)
    199     if not quiet:
    200         context.msg.notice(1, "** starting run **\n");
--> 201     context.current.system.run(int(tsteps), callback_period, callback, limit_hours, int(limit_multiple));
    202     if not quiet:
    203         context.msg.notice(1, "** run complete **\n");

RuntimeError: Error computing cell list

However, running the same code in my laptop with the HOOMD2.5V I didn't have this problem.

Regards,
Jose.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/4878dc7b-8368-47e5-84a9-75b89ddd4e3a%40googlegroups.com.

Michael Howard

unread,
Oct 14, 2019, 3:16:33 PM10/14/19
to hoomd-users
Hi José,

Changing the seed is probably only a quick fix, so there may still be an underlying issue. I have a guess what changed between those versions, but I need to be able to test. Can you please provide your simulation script and the full output so that I can investigate?

Regards,
Mike

José Manuel Ruiz Franco

unread,
Oct 16, 2019, 3:19:55 PM10/16/19
to hoomd...@googlegroups.com
Dear Mike,

I apologize for the delay. Below you will find the script and the output. I hope it can help.

Regards,
Jose.


Script:

# Library.
## Hoomd-Blue libraries.
import hoomd
import hoomd.md
from hoomd import mpcd

import gsd
import gsd.pygsd
import gsd.fl
import gsd.hoomd

hoomd.context.initialize("--mode=cpu")

box = hoomd.data.boxdim(L=20.)
system = hoomd.init.read_snapshot(hoomd.data.make_snapshot(N=2000, box=box))

# Initialize MPCD particles and set sorting period.
Ns = 5                                                 # Number of solvent particles per cell.
solv_particle = mpcd.init.make_random(N=int(Ns*box.get_volume()), kT=1.0, seed=42)
solv_particle.sorter.set_period(period=100)

# Define the forces.
nl = hoomd.md.nlist.cell();
lj = hoomd.md.pair.lj(r_cut=2.**(1./6.), nlist=nl);
lj.pair_coeff.set('A', 'A', epsilon=1.0, sigma=1.0);
colloid = hoomd.group.type('A')  ##hoomd.group.all.

# MPCD integrator with streaming and collision methods.
integrator = mpcd.integrator(dt=0.001)
mpcd.stream.bulk(period=1)
collider = mpcd.collide.srd(seed=7, period=100, angle=130., kT=1.0, group=colloid)
hoomd.md.integrate.nve(group=colloid)
collider.embed(colloid)

# Write Output.
hoomd.analyze.log(filename="log-output.log", quantities=['potential_energy', 'temperature'], period=1000, overwrite=True);

#Run.
hoomd.run(10, quiet=True)

Output:

notice(2): -- Neighborlist exclusion statistics -- :
notice(2): Particles with 0 exclusions             : 2000
notice(2): Neighbors included by diameter          : no
notice(2): Neighbors excluded when in the same body: no
**ERROR**: Particle with unique tag 1999 has NaN for its position.
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-99-7a2c37cff303> in <module>()
      5 
      6 #hoomd.run(100, callback=my_callback, callback_period=1)
----> 7 hoomd.run(10, quiet=True)

/home/proteus/.local/lib/python3.6/hoomd/__init__.py in run(tsteps, profile, limit_hours, limit_multiple, callback_period, callback, quiet)
    199     if not quiet:
    200         context.msg.notice(1, "** starting run **\n");
--> 201     context.current.system.run(int(tsteps), callback_period, callback, limit_hours, int(limit_multiple));
    202     if not quiet:
    203         context.msg.notice(1, "** run complete **\n");

RuntimeError: Error computing cell list

--
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.

Michael Howard

unread,
Oct 17, 2019, 9:55:15 AM10/17/19
to hoomd-users
Hi Jose,

Thanks for sharing the example. With the caveat that I've only read the script and not run it, I believe the problem is with your initial configuration for the MD (colloid) particles:

system = hoomd.init.read_snapshot(hoomd.data.make_snapshot(N=2000, box=box))

You are not specifying anything for the snapshot, so I think by default all of the particles get placed at the origin (0,0,0). Your WCA interactions are then divergent and the resulting behavior is undefined. I would expect the same error if you removed all of the MPCD parts and just ran NVE.

To fix the problem, try constructing a valid initial configuration for the colloids using either the snapshot API or one of the lattice methods.

Regards,
Mike
To unsubscribe from this group and stop receiving emails from it, send an email to hoomd...@googlegroups.com.

José Manuel Ruiz Franco

unread,
Nov 7, 2019, 4:36:11 AM11/7/19
to hoomd...@googlegroups.com
Dear Michael,

I followed your advice and I did not have problem with my simulations. But now, I have again the same error. I am starting from an initial configuration which I am reading from a file. So, basically, I read the file and I create an initial snapshot to start the simulation. Again, depending on the seed, hoomd-blue reports:

**ERROR**: Particle with unique tag 1498 has NaN for its position.
Traceback (most recent call last):
  File "MPCD.py", line 162, in <module>
    hoomd.run(10633303)
  File "/home/proteus/.local/lib/python3.6/hoomd/__init__.py", line 201, in run

    context.current.system.run(int(tsteps), callback_period, callback, limit_hours, int(limit_multiple));
RuntimeError: Error computing cell list

despite once the snapshot is created, all particles are a correct position. The initial seeds are 402 for mpcd.init.read_snapshot,
and 110 for mpcd.colloide.srd. Obviously, changing the seeds, the tag in the error changes.

I send you the script and the initial configuration.

In addition, could you please explain me what is the meaning of "typeid" and the difference betweem "typeid" and the "particle types" defined in the snapshot?

Thank you in advance.

Regards,
Jose

To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/c4d22703-f698-48cb-82c8-d093aab82927%40googlegroups.com.
MPCD.py
init.dat_pc5

Michael Howard

unread,
Nov 7, 2019, 11:32:09 AM11/7/19
to hoomd-users
Hi Jose,

I can reproduce your error using your script. I can make it go away if I disable the thermostat (don't set kT in collide.srd) or use collide.at instead (this is all with HOOMD 2.8.0). I can also make it go away if I do a short run of NVE and then turn on MPCD. This suggests to me that you still have a problem with your initial configuration, which is making some aspect of the algorithm become unstable. Try doing a short run with a Langevin thermostat (no MPCD solvent) to make your starting configuration, and then start using MPCD from there.

The types are the list of all particle "names" in the system. The typeid is the index into this list. So, if types = ('A','B') then typeid 0 is 'A' and typeid 1 is 'B'. This applies to bonds, angles, and dihedrals as well.

Regards,
Mike

Michael Howard

unread,
Nov 7, 2019, 6:29:09 PM11/7/19
to hoomd-users
Hi Jose,

I looked into this further, and I think that somehow your initial configuration was actually finding a rare corner-case for the code that resulted in a divide-by-zero error in the SRD thermostat. I believe I have fixed this potential issue:


I was able to run 1 step of a simplified version of your simulation with the new code. (The old code raised your error.)

You can either recompile this modified version of HOOMD, or you can use my suggestion to use a short simulation to tweak your initial configuration. It might also be enough to assign random initial velocities to the polymer, but I haven't tried this.

Thanks for reporting!

Regards,
Mike

José Manuel Ruiz Franco

unread,
Nov 8, 2019, 8:50:15 AM11/8/19
to hoomd...@googlegroups.com
Hi Mike,

I have updated HOOMD with the new fix, and it seems to work perfectly.

Thank you very much for your time and dedication! Above all, thank you very much for providing me with an accurate answer to the problem! 

Regards,
Jose.

To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hoomd-users/4939d116-e219-4c37-a375-edfac52e35dd%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages