Merge branch 'release-4-5-patches'
authorSzilard Pall <pszilard@cbr.su.se>
Mon, 6 Sep 2010 21:17:55 +0000 (23:17 +0200)
committerSzilard Pall <pszilard@cbr.su.se>
Mon, 6 Sep 2010 21:17:55 +0000 (23:17 +0200)
CMakeLists.txt
include/thread_mpi/atomic/Makefile.am
include/thread_mpi/atomic/gcc_ppc.h
include/thread_mpi/atomic/hpux.h [deleted file]
include/thread_mpi/atomic/xlc_ppc.h
share/template/Makefile.am
src/gmxlib/thread_mpi/Makefile.am
src/gmxlib/thread_mpi/pthreads.c
src/gmxlib/thread_mpi/winthreads.c
src/tools/gmx_bar.c

index f0fce754dca34c848a57a2dab0ea4e0dd32a6878..d316f569a06e79b8b470e767a7e21b2dcc21f60f 100644 (file)
@@ -2,15 +2,21 @@ cmake_minimum_required(VERSION 2.6)
 
 project(Gromacs)
 include(Dart)
+mark_as_advanced(DART_ROOT)
 # PROJECT_VERSION should have the following structure: 
 # VERSION[-dev-SUFFIX] where the VERSION can have any form and the suffix
-set(PROJECT_VERSION "4.5.1"
-    CACHE STRING "Gromacs version string")
+set(PROJECT_VERSION "4.5.1")
+set(CUSTOM_VERSION_STRING ""
+    CACHE STRING "Custom version string (if empty, use hard-coded default)")
+mark_as_advanced(CUSTOM_VERSION_STRING)
+if (CUSTOM_VERSION_STRING)
+    set(PROJECT_VERSION ${CUSTOM_VERSION_STRING})
+endif (CUSTOM_VERSION_STRING)
 set(SOVERSION 6)
 # It is a bit irritating, but this has to be set separately for now!
 SET(CPACK_PACKAGE_VERSION_MAJOR "4")
 SET(CPACK_PACKAGE_VERSION_MINOR "5")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_PATCH "1")
 
 
 # Cmake modules/macros are in a subdirectory to keep this file cleaner
@@ -70,32 +76,40 @@ gmx_c_flags()
 ########################################################################
 # User input options                                                   #
 ########################################################################
-option(GMX_DOUBLE "Use double precision" OFF)
+option(GMX_DOUBLE "Use double precision. Much slower, use only if needed!)" OFF)
 option(GMX_MPI    "Build a parallel (message-passing) version of GROMACS" OFF)
 option(GMX_THREADS    "Build a parallel (thread-based) version of GROMACS)" ON)
 option(GMX_SOFTWARE_INVSQRT "Use GROMACS software 1/sqrt" ON)
+mark_as_advanced(GMX_SOFTWARE_INVSQRT)
 option(GMX_FAHCORE "Build a library with mdrun functionality" OFF)
+mark_as_advanced(GMX_FAHCORE)
 option(GMX_OPENMM "Accelerated execution on GPUs through the OpenMM library" OFF)
 set(GMX_ACCELERATION "auto" 
-    CACHE STRING "Accelerated kernels. Pick one of: none, SSE, BlueGene, Power6, ia64, altivec")
+    CACHE STRING "Accelerated kernels. Pick one of: auto, none, SSE, BlueGene, Power6, ia64, altivec")
 
 set(GMX_FFT_LIBRARY "fftw3" 
     CACHE STRING "FFT library choices: fftw3,fftw2,mkl,fftpack[built-in]")
 option(GMX_DISABLE_FFTW_MEASURE 
        "Do not optimize FFTW setups (not needed with SSE)" OFF)
+mark_as_advanced(GMX_DISABLE_FFTW_MEASURE)
 set(GMX_QMMM_PROGRAM "none" 
     CACHE STRING "QM package choices: none,gaussian,mopac,gamess,orca")
 option(GMX_BROKEN_CALLOC "Work around broken calloc()" OFF)
+mark_as_advanced(GMX_BROKEN_CALLOC)
 option(BUILD_SHARED_LIBS "Enable shared libraries (can be problematic with MPI, Windows)" ${SHARED_LIBS_DEFAULT})
 option(GMX_MPI_IN_PLACE "Enable MPI_IN_PLACE for MPIs that have it defined" ON)
-option(GMX_DLOPEN "Compile with dlopen, needed to read VMD supported file formats" ON)
 mark_as_advanced(GMX_MPI_IN_PLACE)
+option(GMX_DLOPEN "Compile with dlopen, needed to read VMD supported file formats" ON)
+mark_as_advanced(GMX_DLOPEN)
 
 
 option(GMX_IA32_ASM "Add SSE assembly files for IA32" OFF)
+mark_as_advanced(GMX_IA32_ASM)
 option(GMX_X86_64_ASM "Add SSE assembly files for X86_64" OFF)
+mark_as_advanced(GMX_X86_64_ASM)
 
 option(USE_VERSION_H "Generate development version string/information" ON)
+mark_as_advanced(USE_VERSION_H)
 
 option(GMX_DEFAULT_SUFFIX "Use default GROMACS suffixes" ON)
 set(GMX_BINARY_SUFFIX "" CACHE STRING "Suffix for GROMACS binaries (default: _d for double).")
@@ -109,6 +123,9 @@ if (GMX_DEFAULT_SUFFIX)
     set (GMX_BINARY_SUFFIX "_d")
     set (GMX_LIBS_SUFFIX "${GMX_LIBS_SUFFIX}_d")
   endif(GMX_DOUBLE)
+  mark_as_advanced(FORCE GMX_BINARY_SUFFIX GMX_LIBS_SUFFIX)
+else(GMX_DEFAULT_SUFFIX)
+   mark_as_advanced(CLEAR GMX_BINARY_SUFFIX GMX_LIBS_SUFFIX)
 endif(GMX_DEFAULT_SUFFIX)
 
 set(PKG_CFLAGS "")
@@ -188,6 +205,13 @@ if(GMX_OPENMM)
     if(GMX_FAHCORE)
         message(FATAL_ERROR "The OpenMM build does not support FAH build!")
     endif(GMX_FAHCORE)
+    set(GMX_DOUBLE OFF FORCE )
+    # mark as advanced the unused variables
+    mark_as_advanced(FORCE GMX_ACCELERATION GMX_MPI GMX_FFT_LIBRARY 
+        GMX_QMMM_PROGRAM GMX_THREADS GMX_DOUBLE)
+else(GMX_OPENMM)
+     mark_as_advanced(CLEAR GMX_ACCELERATION GMX_MPI GMX_FFT_LIBRARY 
+        GMX_QMMM_PROGRAM GMX_THREADS GMX_DOUBLE)   
 endif(GMX_OPENMM)
 
 
@@ -407,7 +431,7 @@ gmx_test_inline_asm_msvc_x86(GMX_X86_MSVC_INLINE_ASM)
 if (${GMX_ACCELERATION} STREQUAL "auto" AND NOT GMX_OPENMM)
   if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86|x64|x86_64|AMD64|amd64)")
 
-    set(GMX_ACCELERATION "SSE" CACHE STRING "Accelerated kernels. Pick one of: none, SSE, BlueGene, Power6, ia64, altivec" FORCE)
+    set(GMX_ACCELERATION "SSE" CACHE STRING "Accelerated kernels. Pick one of: auto, none, SSE, BlueGene, Power6, ia64, altivec" FORCE)
     
     if (GMX_64_BIT)
       set(GMX_X86_64_ASM ON CACHE BOOL "Add SSE assembly files for x86_64" FORCE)
@@ -417,7 +441,7 @@ if (${GMX_ACCELERATION} STREQUAL "auto" AND NOT GMX_OPENMM)
 
     # Determine the assembler/compiler to use
   else()
-    set(GMX_ACCELERATION "none" CACHE STRING "Accelerated kernels. Pick one of: none, SSE, BlueGene, Power6, ia64, altivec" FORCE)
+    set(GMX_ACCELERATION "none" CACHE STRING "Accelerated kernels. Pick one of: auto, none, SSE, BlueGene, Power6, ia64, altivec" FORCE)
   endif()
 endif (${GMX_ACCELERATION} STREQUAL "auto" AND NOT GMX_OPENMM)
 
@@ -458,9 +482,11 @@ elseif(${GMX_ACCELERATION} STREQUAL "SSE")
 
     if(CMAKE_GENERATOR MATCHES "Visual Studio")
       option(GMX_ASM_USEASM-NASM "Use Nasm for assembly instead of compiler (necessary on windows)" ON)
-    else(CMAKE_GENERATOR MATCHES "Visual Studio")
+    else()
       option(GMX_ASM_USEASM-NASM "Use Nasm for assembly instead of compiler (necessary on windows)" OFF)
-    endif(CMAKE_GENERATOR MATCHES "Visual Studio")
+    endif()
+       mark_as_advanced(GMX_ASM_USEASM-NASM)
+
     if (NOT GMX_64_BIT)
         # for 32-bit compiles, we might need to turn on sse 
         CHECK_C_COMPILER_FLAG("-msse2" XFLAGS_SSE)
@@ -510,7 +536,7 @@ elseif(${GMX_ACCELERATION} STREQUAL "ALTIVEC")
         set(GMX_PPC_ALTIVEC 1)
     endif(HAVE_ALTIVEC_H)
 else(${GMX_ACCELERATION} STREQUAL "NONE")
-    MESSAGE(FATAL_ERROR "Unrecognized option for accelerated kernels: ${GMX_ACCELERATION}. Pick one of none, SSE, Fortran, BlueGene, Power6, ia64, altivec")
+    MESSAGE(FATAL_ERROR "Unrecognized option for accelerated kernels: ${GMX_ACCELERATION}. Pick one of auto, none, SSE, Fortran, BlueGene, Power6, ia64, altivec")
 endif(${GMX_ACCELERATION} STREQUAL "NONE")
 
 
@@ -611,6 +637,8 @@ else(HAVE_MKL OR ACCELERATE_FRAMEWORK)
   set(GMX_EXTERNAL_BLAS FALSE CACHE BOOL "Use external LAPACK instead of built-in") 
   set(GMX_EXTERNAL_LAPACK FALSE CACHE BOOL "Use external LAPACK instead of built-in") 
 endif(HAVE_MKL OR ACCELERATE_FRAMEWORK)
+mark_as_advanced(GMX_EXTERNAL_LAPACK)
+mark_as_advanced(GMX_EXTERNAL_BLAS)
 
 # Math and thread libraries must often come after all others when linking...
 if(HAVE_LIBM)
@@ -684,7 +712,11 @@ ADD_CUSTOM_TARGET(uninstall
 # Tests                                                                #
 ########################################################################
 
-enable_testing()
-add_test(TestBuildAll make)
+include(CTest)
+mark_as_advanced(BUILD_TESTING)
+IF(BUILD_TESTING)
+       enable_testing()
+       add_test(TestBuildAll make)
+       add_subdirectory(tests)
+ENDIF()
 
-add_subdirectory(tests)
index 065022a0c734825ca6f4a149c4e78016ba6df58a..ca1292b75b57bdfe81e54a1cc3556a2cffc6940a 100644 (file)
@@ -3,11 +3,10 @@
 # Don't edit - this file is generated automatically from Makefile.am
 #
 
+pkgincludethread_mpidir = ${pkgincludedir}/thread_mpi/atomic
 
-pkgincludethread_mpiatomicdir = ${pkgincludedir}/thread_mpi/atomic
-
-pkgincludethread_mpiatomic_HEADERS = \
-       gcc.h            gcc_ppc.h        hpux.h           \
-       gcc_ia64.h       gcc_spinlock.h   msvc.h           xlc_ppc.h \
-       gcc_intrinsics.h gcc_x86.h        
+pkgincludethread_mpi_HEADERS = \
+       cycles.h         gcc_intrinsics.h gcc_x86.h\
+       gcc.h            gcc_ppc.h        msvc.h\
+       gcc_ia64.h       gcc_spinlock.h   xlc_ppc.h
 
index f8aa355d8fce19da4ffda91b4fdf47ccc3ce750d..bfaa43281b5ba56f695959105a6923748a805e6f 100644 (file)
@@ -36,14 +36,15 @@ files.
 */
 
 
-/* this file is not used any more. gcc intrinsics take care of it */
+/* NOTE:
 
+ ***************************************************************************
+  this file is not used any more. gcc intrinsics take care of the atomics 
+***************************************************************************
 
-/* PowerPC using proper GCC inline assembly. 
- * Recent versions of xlC (>=7.0) _partially_ support this, but since it is
- * not 100% compatible we provide a separate implementation for xlC in
- * the next section.
- */
+*/
+
+#error included gcc_ppc.h. This file is outdated
 
 
 
diff --git a/include/thread_mpi/atomic/hpux.h b/include/thread_mpi/atomic/hpux.h
deleted file mode 100644 (file)
index 567b58c..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
-This source code file is part of thread_mpi.  
-Written by Sander Pronk, Erik Lindahl, and possibly others. 
-
-Copyright (c) 2009, Sander Pronk, Erik Lindahl.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-1) Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2) Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3) Neither the name of the copyright holders nor the
-   names of its contributors may be used to endorse or promote products
-   derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY US ''AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL WE BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-If you want to redistribute modifications, please consider that
-scientific software is very special. Version control is crucial -
-bugs must be traceable. We will be happy to consider code for
-inclusion in the official distribution, but derived work should not
-be called official thread_mpi. Details are found in the README & COPYING
-files.
-*/
-
-
-/* HP compiler on ia64 */
-#include <machine/sys/inline.h>
-
-#define tMPI_Atomic_memory_barrier() _Asm_mf()
-
-#define tMPI_hpia64_fetchadd(a, i)                           \
-    _Asm_fetchadd((_Asm_fasz)_FASZ_W,(_Asm_sem)_SEM_REL,    \
-                  (UInt32*)a,(unsigned int) i,              \
-                  (_Asm_ldhint)LDHINT_NONE)
-
-typedef struct tMPI_Atomic
-{
-        volatile int       value; /*!< Volatile, to avoid compiler aliasing */
-}
-tMPI_Atomic_t;
-
-typedef struct tMPI_Atomic_ptr
-{
-        void* volatile*     value; /*!< Volatile, to avoid compiler aliasing */
-}
-tMPI_Atomic_ptr_t;
-
-
-
-typedef struct tMPI_Spinlock
-{
-    volatile unsigned int   lock; /*!< Volatile, to avoid compiler aliasing */
-}
-tMPI_Spinlock_t;
-
-
-static inline int tMPI_Atomic_cas(tMPI_Atomic_t *   a,
-                                     int              oldval,
-                                     int              newval)
-{
-    int ret;
-    
-    _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV,(Uint32)oldval,                  
-                   (_Asm_fence)(_UP_CALL_FENCE | _UP_SYS_FENCE |         
-                                _DOWN_CALL_FENCE | _DOWN_SYS_FENCE));
-                   
-    ret = _Asm_cmpxchg((_Asm_sz)SZ_W,(_Asm_sem)_SEM_ACQ,(Uint32*)a,    
-                       (Uint32)newval,(_Asm_ldhint)_LDHINT_NONE);
-                   
-    return ret==oldval;
-}
-
-
-
-static inline void* tMPI_Atomic_ptr_cas(tMPI_Atomic_ptr_t *  a,
-                                           void*               oldval,
-                                           void*               newval)
-{
-    void *ret;
-
-    /* todo: fix this */
-    
-    _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV,(Uint64)oldval,                  
-                   (_Asm_fence)(_UP_CALL_FENCE | _UP_SYS_FENCE |         
-                                _DOWN_CALL_FENCE | _DOWN_SYS_FENCE));
-                   
-    ret = _Asm_cmpxchg((_Asm_sz)SZ_W,(_Asm_sem)_SEM_ACQ,(Uint64)a,    
-                       (Uint64)newval,(_Asm_ldhint)_LDHINT_NONE);
-                   
-    return ret==oldval;
-}
-
-
-
-
-#define TMPI_SPINLOCK_INITIALIZER   { 0 }
-
-
-#define tMPI_Atomic_get(a)   ((a)->value) 
-#define tMPI_Atomic_set(a,i)  (((a)->value) = (i))
-
-
-static inline void tMPI_Atomic_add_return(tMPI_Atomic_t *       a, 
-                                         int                  i)
-{
-    int old,new;    
-    int __i = i;
-    
-    /* On HP-UX we don't know any macro to determine whether the increment
-     * is known at compile time, but hopefully the call uses something simple
-     * like a constant, and then the optimizer should be able to do the job.
-     */                         
-    if (  (__i ==   1) || (__i ==   4)  || (__i ==   8) || (__i ==  16) ||  
-          (__i ==  -1) || (__i ==  -4)  || (__i ==  -8) || (__i == -16) )
-    {
-        oldval = tMPI_hpia64_fetchadd(a,__i);
-        newval = oldval + i;
-    }
-    else
-    {
-        /* Use compare-exchange addition that works with any value */
-        do
-        {
-            oldval = tMPI_Atomic_get(a);
-            newval = oldval + i;
-        }
-        while(!tMPI_Atomic_cas(a,oldval,newval));
-    }
-    return newval;
-}
-
-
-
-static inline int tMPI_Atomic_fetch_add(tMPI_Atomic_t *     a,
-                                       int                i)
-{
-    int oldval,newval;    
-    int __i = i;
-    
-    /* On HP-UX we don't know any macro to determine whether the increment
-     * is known at compile time, but hopefully the call uses something simple
-     * like a constant, and then the optimizer should be able to do the job.
-     */                         
-    if (  (__i ==   1) || (__i ==   4)  || (__i ==   8) || (__i ==  16) ||
-          (__i ==  -1) || (__i ==  -4)  || (__i ==  -8) || (__i == -16) )
-    {
-        oldval = tMPI_hpia64_fetchadd(a,__i);
-        newval = oldval + i;
-    }
-    else
-    {
-        /* Use compare-exchange addition that works with any value */
-        do
-        {
-            oldval = tMPI_Atomic_get(a);
-            newval = oldval + i;
-        }
-        while(!tMPI_Atomic_cas(a,oldval,newval));
-    }
-    return oldval;
-}
-
-
-static inline void tMPI_Spinlock_init(tMPI_Spinlock_t *x)
-{
-    x->lock = 0;
-}
-
-
-
-
-
-static inline void tMPI_Spinlock_trylock(tMPI_Spinlock_t *x)
-{
-    int rc;
-
-    rc = _Asm_xchg((_Asm_sz)_SZ_W, (unsigned int *)x, 1        
-                    (_Asm_ldhit)_LDHINT_NONE);
-    
-    return ( (rc>0) ? 1 : 0);
-}
-
-
-static inline void tMPI_Spinlock_lock(tMPI_Spinlock_t *x)
-{
-    int      status = 1;
-    
-    do
-    {
-        if( *((unsigned int *)x->lock) == 0 ) 
-        {
-            status = tMPI_Spinlock_trylock(x);
-        }
-    } while( status != 0);
-}
-
-
-static inline void tMPI_Spinlock_unlock(tMPI_Spinlock_t *   x)
-{
-    _Asm_fetchadd((_Asm_fasz)_SZ_W,(_Asm_sem)_SEM_REL,                  
-                  (unsigned int *)x,-1,(_Asm_ldhint)_LDHINT_NONE);
-}
-
-
-
-static inline void tMPI_Spinlock_islocked(const tMPI_Spinlock_t *   x)
-{
-    return ( x->lock != 0 );
-}
-
-
-
-static inline void tMPI_Spinlock_wait(tMPI_Spinlock_t *   x)
-{
-    do
-    {
-        tMPI_Atomic_memory_barrier(); 
-    } 
-    while(spin_islocked(x));
-}
-
-
-#undef tMPI_hpia64_fetchadd
-
-
-
index 1bb7a60bed94bca5105b1a1dd925066f6cfc5532..f3df95937fbcbaa7ef27b4da1243383773fd80d4 100644 (file)
@@ -111,7 +111,7 @@ static inline int tMPI_Atomic_cas(tMPI_Atomic_t *a, int oldval, int newval)
     int ret;
 
     __fence(); /* this one needs to be here to avoid ptr. aliasing issues */
-    __eieio(); /* these memory barriers are neccesary */
+    __eieio(); 
     ret=(__compare_and_swap(&(a->value), &oldval, newval));
     __isync();
     __fence(); /* and this one needs to be here to avoid aliasing issues */
@@ -142,7 +142,7 @@ static inline int tMPI_Atomic_ptr_cas(tMPI_Atomic_ptr_t *a, void* oldval,
     volatile char* volatile* newv=newval;
 
     __fence(); /* this one needs to be here to avoid ptr. aliasing issues */
-    __eieio(); /* these memory barriers are neccesary */
+    __eieio(); 
 #if (!defined (__LP64__) ) && (!defined(__powerpc64__) ) 
     ret=__compare_and_swap((int *)&(a->value), (int*)&oldv, (int)newv);
 #else
@@ -230,37 +230,48 @@ static inline int tMPI_Atomic_fetch_add(tMPI_Atomic_t *a, int i)
 
 static inline void tMPI_Spinlock_init(tMPI_Spinlock_t *x)
 {
+    __fence();
     __clear_lock_mp((const int*)x,0);
+    __fence();
 }
 
 
 static inline void tMPI_Spinlock_lock(tMPI_Spinlock_t *x)
 {
+    __fence();
     do
     {
-        tMPI_Atomic_memory_barrier();
     }
     while(__check_lock_mp((int*)&(x->lock), 0, 1));
+    tMPI_Atomic_memory_barrier_acq();
 }
 
 
 static inline int tMPI_Spinlock_trylock(tMPI_Spinlock_t *x)
 {
+    int ret;
     /* Return 0 if we got the lock */
-    return (__check_lock_mp((int*)&(x->lock), 0, 1) != 0);
+    __fence();
+    ret=__check_lock_mp((int*)&(x->lock), 0, 1) != 0;
+    tMPI_Atomic_memory_barrier_acq();
+    return ret;
 }
 
 
 static inline void tMPI_Spinlock_unlock(tMPI_Spinlock_t *x)
 {
+    tMPI_Atomic_memory_barrier_rel();
     __clear_lock_mp((int*)&(x->lock),0);
 }
 
 
 static inline int tMPI_Spinlock_islocked(const tMPI_Spinlock_t *x)
 {
-    tMPI_Atomic_memory_barrier();
-    return ((x->lock) != 0);
+    int ret;
+    __fence();
+    ret=((x->lock) != 0);
+    tMPI_Atomic_memory_acq();
+    return ret;
 }
 
 
@@ -268,7 +279,6 @@ static inline void tMPI_Spinlock_wait(tMPI_Spinlock_t *x)
 {
     do
     {
-        tMPI_Atomic_memory_barrier();
     }
     while(spin_islocked(x));
 }
index 4b7ce59fc8bd39b02af9daa6afda33524fc7f708..458e25b4311e21d19a6c6de981fa9de69ded57fa 100644 (file)
@@ -23,7 +23,7 @@ template_DATA = template.c README Makefile.@host@_double Makefile.pkg
 else
 template_DATA = template.c README Makefile.@host@ Makefile.pkg
 endif
-EXTRA_DIST = template.c template_doc.c README Template.mak Makefile.pkg
+EXTRA_DIST = template.c template_doc.c README Template.mak Makefile.pkg CMakeLists.txt.template
 
 BUILT_SOURCES = gromacs
 
index f3a620361ff99f0ddf4b5645a97a136a005de63d..51a7cac1e57b06ed7feebfd417c95d4892c653b1 100644 (file)
@@ -10,17 +10,18 @@ AM_CPPFLAGS= -I$(top_srcdir)/include
 noinst_LTLIBRARIES = libthread_mpi.la
 
 # again, we assume that we're using pthreads if we're using autotools.
-libthread_mpi_la_SOURCES = alltoall.c      lock.c          reduce_fast.c \
-                          barrier.c       scatter.c       bcast.c \
-                          once.c          settings.h      collective.c \
-                          p2p.h           collective.h \
+libthread_mpi_la_SOURCES = alltoall.c      impl.h          pthreads.h \
+                          barrier.c       list.c          reduce.c \
+                          bcast.c         lock.c          reduce_fast.c \
+                          collective.c    once.c          scatter.c \
+                          collective.h    p2p.h           settings.h \
                           comm.c          p2p_protocol.c  tmpi_init.c \
                           errhandler.c    p2p_send_recv.c tmpi_ops.h \
                           event.c         p2p_wait.c      topology.c \
                           gather.c        profile.c       type.c \
-                          group.c         profile.h       hwinfo.c \
-                          pthreads.c      impl.h          pthreads.h \
-                          list.c          reduce.c
+                          group.c         profile.h       winthreads.c \
+                          hwinfo.c        pthreads.c      winthreads.h
+
 
 CLEANFILES     = *.la *~ \\\#*
 
index f87fda797d20216af749c8ff427c6d0e953587aa..22a3dd35cb116f9cc55e4efd9661e78097ef5949 100644 (file)
@@ -629,5 +629,10 @@ int tMPI_Thread_barrier_wait(tMPI_Thread_barrier_t *   barrier)
     return rc;
 }
 
+#else
+
+/* just to have some symbols */
+int tMPI_Thread_pthreads=0;
 
 #endif /* THREAD_PTHREADS */
+
index 83de6fa23c8171a99ad9e63db60facd61838591e..64993ae237e5f9f39c12b762cc273547350a75f5 100644 (file)
@@ -847,4 +847,10 @@ int tMPI_Thread_barrier_wait(tMPI_Thread_barrier_t *barrier)
     return ret;
 }
 
+#else
+
+/* just to have some symbols */
+int tMPI_Thread_winthreads=0;
+
 #endif /* THREAD_WINDOWS  */
+
index fdd3ead6174aceb8a406e210833957725533fbf6..ca4d1b676cbcce629dbaa3cd77ebb0027a770da6 100644 (file)
@@ -665,7 +665,7 @@ void lambdas_histogram(lambda_t *bl_head, const char *filename,
     int i;
 
     printf("\nWriting histogram to %s\n", filename);
-    sprintf(label_x, "[\\Delta]H (%s)", unit_energy);
+    sprintf(label_x, "\\DeltaH (%s)", unit_energy);
 
     fp=xvgropen_type(filename, title, label_x, label_y, exvggtXNY, oenv);
 
@@ -916,7 +916,7 @@ static void lambdas_impose_times(lambda_t *head, double begin, double end)
     lambda_t *lc;
     int j;
 
-    if (begin<=0 && end<0)
+    if (begin<=0 && end<0) 
     {
         return;
     }
@@ -967,9 +967,9 @@ static void lambdas_impose_times(lambda_t *head, double begin, double end)
     }
 
     /* calculate the actual times */
-    if (begin > 0)
+    if (begin > 0 )
     {
-        begin_t = (last_t - first_t)*begin + first_t;
+        begin_t = begin;
     }
     else
     {
@@ -978,13 +978,18 @@ static void lambdas_impose_times(lambda_t *head, double begin, double end)
 
     if (end >0 )
     {
-        end_t = (last_t - first_t)*end + first_t;
+        end_t = end;
     }
     else
     {
         end_t = last_t;
     }
     printf("\n   Samples in time interval: %.3f - %.3f\n", first_t, last_t);
+
+    if (begin_t > end_t)
+    {
+        return;
+    }
     printf("Removing samples outside of: %.3f - %.3f\n", begin_t, end_t);
 
     /* then impose them */
@@ -1991,7 +1996,7 @@ static void read_bar_xvg_lowlevel(char *fn, real *temp, xvg_t *ba)
             /* Read lambda from the legend */
             ba->lambda[i] = legend2lambda(fn,legend[i], &is_dhdl);
 
-            if (is_dhdl && native_lambda_read)
+            if (is_dhdl && !native_lambda_read)
             {
                 ba->native_lambda = ba->lambda[i];
                 native_lambda_read=TRUE;