Date: Fri, 13 Jul 2001 11:38:23 -0700 (PDT)
From: Michael Crowley
Subject: Re: ewald bomb in amber 6

Regarding the num_ks/inhomogeneous problem.

It is time to admit that the message is not clear enough for users to
understand what is wrong and what to do about it.

The inhomogeneous error arises in parallel runs only and will show up
more often the higher the number of processors. For the reciprocal
part of the PME calculation in parallel, the space is evenly divided
among processors. Some arrays are needed with a size that depends on
the number of atoms in a processor's assigned region of space. We
make an estimate based on the average density of the system and the
volume of space assigned to the processor. We allocate 30% more space
than the average atom density of the whole system. When the system is
inhomogeneous, there are regions with more atoms than the average
density would predict. If it exceeds 30%, the error condition is
triggered and sander stops with the message. A system that triggers
the error must have either high density regions or too large a volume
so that the average density is 30% lower than the normal density.

Our initial assumption (I take responsibility) was that nobody would
want to run with such an inhomogeneous system (with very high density
areas or vacuum/low density regions) in a periodic system and the
best thing would be to give the message and stop.

The solution for users of amber6 depends on what the user wants to
simulate.

Case 1) If one wants to run with the inhomogeneity, then a small
change in the program, in src/sander/ew_recip.f is what is needed.
See below for the code change.

Case 2) Otherwise, one needs to fix the problem either by adjusting
incorrect boundary conditions or equilibrating at constant pressure
until the inconsistencies settle down. To avoid the error while
equilibrating, one can use fewer processors (one will never give the
problem, two is unlikely to trigger the error). The equilibration
will not necessarily be long, you can make a short (within reason)
time scale for the pressure scaling until the volume adjusts.

The next release of sander will not have the error condition but
will put a warning message in the output to alert the user that
the system is significantly inhomogeneous.

==================================================================
The change to code for Case 1 is lines 86-91 from:

# ifdef MPI
num_ks = min((((nxyslab(0)+order-1)*numatoms*4)/
$ (3*nfft3)),numatoms)
# else
num_ks = numatoms
# endif


to:

num_ks = numatoms


It will use more memory and the memory will not scale as well
for parallel, but it will run inhomogeneous systems.

Sincerely,
Mike Crowley