# Fix stupid flags on Windows
########################################################################
SET(SHARED_LIBS_DEFAULT ON)
-IF( (CMAKE_GENERATOR MATCHES "Visual Studio" OR CMAKE_GENERATOR MATCHES "NMake") AND MSVC )
+IF( MSVC )
STRING(REPLACE /MD /MT CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE)
STRING(REPLACE /MD /MT CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
SET(SHARED_LIBS_DEFAULT OFF)
ENDIF()
-IF(CMAKE_GENERATOR MATCHES "NMake" AND CMAKE_C_COMPILER_ID MATCHES "Intel")
+IF( WIN32 AND NOT CYGWIN AND CMAKE_C_COMPILER_ID MATCHES "Intel" )
STRING(REPLACE /GZ /RTC1 CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE)
STRING(REPLACE /GZ /RTC1 CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(GMX_IA32_ASM ON CACHE BOOL "Add SSE assembly files for i386" FORCE)
endif (GMX_64_BIT)
- if(CMAKE_GENERATOR MATCHES "Visual Studio" OR CMAKE_GENERATOR MATCHES NMake )
+ if( WIN32 AND NOT CYGWIN )
option(GMX_ASM_USEASM_NASM "Use Nasm for assembly instead of compiler (necessary on windows)" ON)
else()
option(GMX_ASM_USEASM_NASM "Use Nasm for assembly instead of compiler (necessary on windows)" OFF)
/* Define to 1 if you have the lstat() function. */
#cmakedefine HAVE_LSTAT
+/* Define to 1 if you have the sigaction() function. */
+#cmakedefine HAVE_SIGACTION
+
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H
# If PKGVERSION ends in a date, replace it with the head commit.
version=`echo $PKGVERSION | sed -e 's/-dev-[0-9]*$/-dev/'`-$date-$shorthash$dirtystr
#version=$PKGVERSION-$date-$shorthash$dirtystr
- # Find the name of the remote which has the git.gromacs.org:gromacs in its url.
+ # Find the names of remotes that come from the official git/gerrit repos.
# If not found, just set baserev to "unknown".
- gmxremote=`git --git-dir=$GITDIR config --get-regexp 'remote\..*\.url' 'git\.gromacs\.org[:|/]gromacs' | sed -e 's/remote\.\(.*\)\.url.*/\1/'`
- if test "x$gmxremote" = "x" ; then
+ gmxremotes=`git --git-dir=$GITDIR config --get-regexp 'remote\..*\.url' '\.gromacs\.org[:/].*gromacs(\.git)?$' | sed -e 's/remote\.\(.*\)\.url.*/\1/'`
+ if test "x$gmxremotes" = "x" ; then
baserev="unknown"
else
- # Find the most recent ancestral commit that appears in $gmxremote.
- # Gets the hash and the number of local commits that are newer than
- # the found commit.
- baserev=`git --git-dir=$GITDIR rev-list HEAD | git --git-dir=$GITDIR name-rev --stdin --refs=refs/remotes/$gmxremote/* | awk 'NF > 1 {print $1 " (" NR-1 " newer local commits)"; exit 0}'`
+ # Construct a command that produces a reverse-time-ordered list of
+ # commits and their annotated names in $gmxremotes.
+ revcommand="git --git-dir=$GITDIR rev-list HEAD"
+ for remote in $gmxremotes ; do
+ revcommand="$revcommand | git --git-dir=$GITDIR name-rev --stdin --refs='refs/remotes/$remote/*'"
+ done
+ # Get the hash of the first commit that is found in $gmxremotes and
+ # the number of local commits that are newer than the found commit.
+ baserev=`eval $revcommand | awk 'NF > 1 {print $1 " (" NR-1 " newer local commits)"; exit 0}'`
# Extract the base hash
basehash=`expr "$baserev" : '\([0123456789abcdef]*\) '`
# Do not report the base revision if it is the same as the most recent commit
#ifdef HAVE_SIGACTION
struct sigaction act;
act.sa_handler = signal_handler;
- act.flags = SA_RESTART;
- sigaction(signum,act);
+ act.sa_flags = SA_RESTART;
+ sigaction(signum,&act,NULL);
#else
signal(signum,signal_handler);
#endif
for (s=0;s<2;s++) { /*loop over first two FFT steps (corner rotations)*/
#ifdef GMX_MPI
- if (GMX_PARALLEL_ENV_INITIALIZED && cart[s] !=0 && P[s]>1 )
+ if (GMX_PARALLEL_ENV_INITIALIZED && cart[s]!=MPI_COMM_NULL && P[s]>1)
{
bParallelDim = 1;
}
clear_mat(shake_vir);
clear_mat(pres);
- /* Calculate long range corrections to pressure and energy */
- calc_dispcorr(fplog,inputrec,fr,count,top_global->natoms,ems->s.box,ems->s.lambda,
- pres,force_vir,&prescorr,&enercorr,&dvdlcorr);
- /* don't think these next 4 lines can be moved in for now, because we
- don't always want to write it -- figure out how to clean this up MRS 8/4/2009 */
- enerd->term[F_DISPCORR] = enercorr;
- enerd->term[F_EPOT] += enercorr;
- enerd->term[F_PRES] += prescorr;
- enerd->term[F_DVDL] += dvdlcorr;
-
/* Communicate stuff when parallel */
if (PAR(cr) && inputrec->eI != eiNM)
{
wallcycle_stop(wcycle,ewcMoveE);
}
+ /* Calculate long range corrections to pressure and energy */
+ calc_dispcorr(fplog,inputrec,fr,count,top_global->natoms,ems->s.box,ems->s.lambda,
+ pres,force_vir,&prescorr,&enercorr,&dvdlcorr);
+ enerd->term[F_DISPCORR] = enercorr;
+ enerd->term[F_EPOT] += enercorr;
+ enerd->term[F_PRES] += prescorr;
+ enerd->term[F_DVDL] += dvdlcorr;
+
ems->epot = enerd->term[F_EPOT];
if (constr) {
srenew(work->mhy ,work->nalloc);
srenew(work->mhz ,work->nalloc);
srenew(work->m2 ,work->nalloc);
- srenew(work->denom,work->nalloc);
/* Allocate an aligned pointer for SSE operations, including 3 extra
* elements at the end since SSE operates on 4 elements at a time.
*/
}
-void gather_f_bsplines(gmx_pme_t pme,real *grid,
- gmx_bool bClearF,pme_atomcomm_t *atc,
- splinedata_t *spline,
- real scale)
+static void gather_f_bsplines(gmx_pme_t pme,real *grid,
+ gmx_bool bClearF,pme_atomcomm_t *atc,
+ splinedata_t *spline,
+ real scale)
{
/* sum forces for local particles */
int nn,n,ithx,ithy,ithz,i0,j0,k0;
for(nn=0; nn<spline->n; nn++)
{
n = spline->ind[nn];
- qn = atc->q[n];
+ qn = scale*atc->q[n];
if (bClearF)
{
pme->nnodes_minor = nnodes_minor;
#ifdef GMX_MPI
- if (PAR(cr))
+ if (nnodes_major*nnodes_minor > 1)
{
- pme->mpi_comm = cr->mpi_comm_mygroup;
+ pme->mpi_comm = cr->mpi_comm_mygroup;
MPI_Comm_rank(pme->mpi_comm,&pme->nodeid);
MPI_Comm_size(pme->mpi_comm,&pme->nnodes);
+ if (pme->nnodes != nnodes_major*nnodes_minor)
+ {
+ gmx_incons("PME node count mismatch");
+ }
+ }
+ else
+ {
+ pme->mpi_comm = MPI_COMM_NULL;
}
#endif
pmegrid_t *grid;
/* make local bsplines */
- if (grids->nthread == 1)
+ if (grids == NULL || grids->nthread == 1)
{
spline = &atc->spline[0];
cs2 += (double)c2;
#endif
- if (grids->nthread > 1)
+ if (bSpread && grids->nthread > 1)
{
#ifdef PME_TIME_THREADS
c3 = omp_cyc_start();
}
atc = &pme->atc_energy;
+ atc->nthread = 1;
+ if (atc->spline == NULL)
+ {
+ snew(atc->spline,atc->nthread);
+ }
atc->nslab = 1;
atc->bSpread = TRUE;
atc->pme_order = pme->pme_order;