When doing a normal mode calculation with PME and (thread-)MPI,
the PME forces were incorrect. Also fixed some EM/NM output layout.
Fixes #1308
Change-Id: Ia7862fa62e235336c546824afdcbe28f37b145c5
if (inputrec->eI == eiNM || EI_TPI(inputrec->eI))
{
if (inputrec->eI == eiNM || EI_TPI(inputrec->eI))
{
- /* Steps are divided over the nodes iso splitting the atoms */
+ /* Dims/steps are divided over the nodes iso splitting the atoms */
min_atoms_per_mpi_thread = 0;
}
else
min_atoms_per_mpi_thread = 0;
}
else
cr->duty = (DUTY_PP | DUTY_PME);
npme_major = 1;
npme_minor = 1;
cr->duty = (DUTY_PP | DUTY_PME);
npme_major = 1;
npme_minor = 1;
- if (!EI_TPI(inputrec->eI))
+ /* NM and TPI perform single node energy calculations in parallel */
+ if (!(inputrec->eI == eiNM || EI_TPI(inputrec->eI)))
{
npme_major = cr->nnodes;
}
{
npme_major = cr->nnodes;
}
#include "pme.h"
#include "bondf.h"
#include "gmx_omp_nthreads.h"
#include "pme.h"
#include "bondf.h"
#include "gmx_omp_nthreads.h"
if (bLastStep)
{
sprintf(buffer,
if (bLastStep)
{
sprintf(buffer,
- "\nEnergy minimization reached the maximum number"
- "of steps before the forces reached the requested"
+ "\nEnergy minimization reached the maximum number "
+ "of steps before the forces reached the requested "
"precision Fmax < %g.\n", ftol);
}
else
{
sprintf(buffer,
"precision Fmax < %g.\n", ftol);
}
else
{
sprintf(buffer,
- "\nEnergy minimization has stopped, but the forces have"
- "not converged to the requested precision Fmax < %g (which"
- "may not be possible for your system). It stopped"
- "because the algorithm tried to make a new step whose size"
- "was too small, or there was no change in the energy since"
- "last step. Either way, we regard the minimization as"
- "converged to within the available machine precision,"
+ "\nEnergy minimization has stopped, but the forces have "
+ "not converged to the requested precision Fmax < %g (which "
+ "may not be possible for your system). It stopped "
+ "because the algorithm tried to make a new step whose size "
+ "was too small, or there was no change in the energy since "
+ "last step. Either way, we regard the minimization as "
+ "converged to within the available machine precision, "
"given your starting configuration and EM parameters.\n%s%s",
ftol,
sizeof(real) < sizeof(double) ?
"given your starting configuration and EM parameters.\n%s%s",
ftol,
sizeof(real) < sizeof(double) ?
- "\nDouble precision normally gives you higher accuracy, but"
- "this is often not needed for preparing to run molecular"
+ "\nDouble precision normally gives you higher accuracy, but "
+ "this is often not needed for preparing to run molecular "
"dynamics.\n" :
"",
bConstrain ?
"dynamics.\n" :
"",
bConstrain ?
rvec mu_tot;
rvec *fneg, *dfdx;
gmx_bool bSparse; /* use sparse matrix storage format */
rvec mu_tot;
rvec *fneg, *dfdx;
gmx_bool bSparse; /* use sparse matrix storage format */
gmx_sparsematrix_t * sparse_matrix = NULL;
real * full_matrix = NULL;
em_state_t * state_work;
gmx_sparsematrix_t * sparse_matrix = NULL;
real * full_matrix = NULL;
em_state_t * state_work;
*/
if (EEL_FULL(fr->eeltype) || fr->rlist == 0.0)
{
*/
if (EEL_FULL(fr->eeltype) || fr->rlist == 0.0)
{
- fprintf(stderr, "Non-cutoff electrostatics used, forcing full Hessian format.\n");
+ md_print_info(cr, fplog, "Non-cutoff electrostatics used, forcing full Hessian format.\n");
bSparse = FALSE;
}
else if (top_global->natoms < 1000)
{
bSparse = FALSE;
}
else if (top_global->natoms < 1000)
{
- fprintf(stderr, "Small system size (N=%d), using full Hessian format.\n", top_global->natoms);
+ md_print_info(cr, fplog, "Small system size (N=%d), using full Hessian format.\n", top_global->natoms);
bSparse = FALSE;
}
else
{
bSparse = FALSE;
}
else
{
- fprintf(stderr, "Using compressed symmetric sparse Hessian format.\n");
+ md_print_info(cr, fplog, "Using compressed symmetric sparse Hessian format.\n");
- sz = DIM*top_global->natoms;
+ if (MASTER(cr))
+ {
+ sz = DIM*top_global->natoms;
- fprintf(stderr, "Allocating Hessian memory...\n\n");
+ fprintf(stderr, "Allocating Hessian memory...\n\n");
- if (bSparse)
- {
- sparse_matrix = gmx_sparsematrix_init(sz);
- sparse_matrix->compressed_symmetric = TRUE;
- }
- else
- {
- snew(full_matrix, sz*sz);
+ if (bSparse)
+ {
+ sparse_matrix = gmx_sparsematrix_init(sz);
+ sparse_matrix->compressed_symmetric = TRUE;
+ }
+ else
+ {
+ snew(full_matrix, sz*sz);
+ }
/* if forces are not small, warn user */
get_state_f_norm_max(cr, &(inputrec->opts), mdatoms, state_work);
/* if forces are not small, warn user */
get_state_f_norm_max(cr, &(inputrec->opts), mdatoms, state_work);
+ md_print_info(cr, fplog, "Maximum force:%12.5e\n", state_work->fmax);
+ if (state_work->fmax > 1.0e-3)
- fprintf(stderr, "Maximum force:%12.5e\n", state_work->fmax);
- if (state_work->fmax > 1.0e-3)
- {
- fprintf(stderr, "Maximum force probably not small enough to");
- fprintf(stderr, " ensure that you are in an \nenergy well. ");
- fprintf(stderr, "Be aware that negative eigenvalues may occur");
- fprintf(stderr, " when the\nresulting matrix is diagonalized.\n");
- }
+ md_print_info(cr, fplog,
+ "The force is probably not small enough to "
+ "ensure that you are at a minimum.\n"
+ "Be aware that negative eigenvalues may occur\n"
+ "when the resulting matrix is diagonalized.\n\n");
}
/***********************************************************
}
/***********************************************************