Debadutta,
You do not need to redefine any potentials after changing the number of
particles in the system. However, there may be a bug in the PPPM GPU
implementation that doesn't work when the number of particles changes.
Unfortunately, the PPPM code was contributed many years ago and none of
the HOOMD core developers actively use the module. We might be able to
find the cause of the bug, but to do so, it is absolutely essential that
we have a minimal script that reproduces the problem. See the recent
example by Sean
(
https://groups.google.com/forum/#!topic/hoomd-users/Jv6Yrh6i3L8) for an
excellent example of such a script.
---
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
http://www-personal.umich.edu/~joaander/
On 2/11/20 6:12 PM, DP wrote:
> The problem goes away when I run it in cpu mode instead of gpu. However,
> it is not at all efficient in that the speed is considerably reduced (of
> the order of 2 TPS).
>
> On Monday, February 10, 2020 at 8:38:56 PM UTC-6, DP wrote:
>
> Hi Joshua,
> Since using group.all() in pppm(as advised by you in another post)
> eliminates the need to update the charge group, am I correct in
> saying that one does not need to define pppm each time a particle is
> inserted into or removed from the system? I actually did that so as
> to minimize the memory consumption (**ERROR**: invalid argument
> before /hoomd/GPUArray.h:926 comes up after a few rounds of
> insertion and deletion in the grand canonical MD code). However, now
> the same error "*RuntimeError: CUFFT returned error 1 in file
> /home/dpo854/mycode/hoomd-blue/hoomd/md/PPPMForceComputeGPU.cc line
> 281" comes up.
> *
>
> On Friday, December 27, 2019 at 9:02:15 AM UTC-6, Jens wrote:
>
> Hi Debadutta,
>
> I examined your script. When I run it with HOOMD-blue 2.8.2, I
> get a lot of warning messages like these:
>
> *Warning*: analyze.log: The log quantity pair_ewald_energy has
> been registered more than once. Only the most recent
> registration takes effect
> *Warning*: analyze.log: The log quantity pppm_energy has been
> registered more than once. Only the most recent registration
> takes effect
>
> This indicates that the charge.pppm compute has been registered
> multiple times. This is probably because python garbage
> collector doesn’t properly release the old force compute when
> the local variable pppm is reassigned. While this may be
> considered a bug in current HOOMD-blue, it is unlikely we’ll fix
> this in HOOMD 2.x, since a rewrite of the python API for 3.0 is
> in progress. I’ve created a reminder here:
>
>
https://github.com/glotzerlab/hoomd-blue/issues/571
> <
https://github.com/glotzerlab/hoomd-blue/issues/571>
>
> There is an easy workaround though. Explicitly disable the pppm
> object before overwriting the variable. Like this:
>
> --- postrunana_orig.py2019-12-27 09:46:00.230948416 -0500
> +++ postrunana.py2019-12-27 09:46:18.393225815 -0500
>> *Equilibrate the system first*
>> *lange.disable()*
>> *energybefore=log.query('potential_energy')*
>> totinser=50000
>> wtest=0.0
>> for i in range(totinser):
>> tneg = system.particles.add('A')
>> tpos = system.particles.add('B')
>> posrandx=random.uniform(-Le/2,Le/2)
>> posrandy=random.uniform(-Le/2,Le/2)
>> posrandz=random.uniform(-Le/2,Le/2)
>> negrandx=random.uniform(-Le/2,Le/2)
>> negrandy=random.uniform(-Le/2,Le/2)
>> negrandz=random.uniform(-Le/2,Le/2)
>> pos=system.particles.get(tpos)
>> neg=system.particles.get(tneg)
>> pos.position=[posrandx,posrandy,posrandz]*! Inserted a
>> particle pair in random locations*
>> neg.position=[negrandx,negrandy,negrandz]
>>
>> hoomd.run(1)
>> energyafter=log.query('potential_energy')*! energy
>> after insertion*
>> print(energyafter, energybefore)
>> wtest=wtest+exp(-(energyafter-energybefore))
>>
>> system.particles.remove(tneg)
>> system.particles.remove(tpos)
>> hoomd.run(1)
>> energyremoval=log.query('potential_energy')*! energy
>> after the removal of the test particle pair
>> *
>> *When I compute the system potential energy here it
>> turns out to be different from the energy before
>> insertion*
>> lange.enable() !*enable the integrator to let the
>> particles move*
>> hoomd.run(10)
>> energybefore=log.query('potential_energy')*! energy
>> before insertion*
>> <
https://groups.google.com/d/msgid/hoomd-users/41c0c049-2e0f-44d5-a779-3f18218787ca%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> <postrunana.py><trajectory.gsd>
>
> --
> 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
> <mailto:
hoomd-users...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/hoomd-users/48344f41-5118-4ed9-b149-214ab4a576d9%40googlegroups.com
> <
https://groups.google.com/d/msgid/hoomd-users/48344f41-5118-4ed9-b149-214ab4a576d9%40googlegroups.com?utm_medium=email&utm_source=footer>.