Fixed compilation warnings and errors.
authorspoel <spoel>
Wed, 30 Aug 2006 09:51:53 +0000 (09:51 +0000)
committerspoel <spoel>
Wed, 30 Aug 2006 09:51:53 +0000 (09:51 +0000)
Implemented patches due to Axel Kohlmeyer for porting to Cray XMT.

46 files changed:
configure.ac
include/gmxfio.h
include/ns.h
src/contrib/anaf.c
src/gmxlib/enxio.c
src/gmxlib/gmxfio.c
src/gmxlib/mshift.c
src/gmxlib/mtxio.c
src/gmxlib/smalloc.c
src/gmxlib/stat.c
src/gmxlib/statutil.c
src/gmxlib/string2.c
src/gmxlib/tpxio.c
src/gmxlib/trnio.c
src/gmxlib/trxio.c
src/gmxlib/viewit.c
src/gmxlib/xtcio.c
src/kernel/gmxcheck.c
src/kernel/gmxdump.c
src/kernel/luck.c
src/kernel/md.c
src/kernel/repl_ex.c
src/kernel/topio.c
src/mdlib/domdec.c
src/mdlib/force.c
src/mdlib/ghat.c
src/mdlib/minimize.c
src/mdlib/pme.c
src/mdlib/qm_gamess.c
src/mdlib/qm_gaussian.c
src/mdlib/qm_mopac.c
src/mdlib/qmmm.c
src/mdlib/sim_util.c
src/mdlib/splittop.c
src/mdlib/wnblist.c
src/mdlib/wnblist.h [deleted file]
src/ngmx/dialogs.c
src/ngmx/ngmx.c
src/ngmx/xstat.c
src/tools/addconf.c
src/tools/correl.h
src/tools/do_dssp.c
src/tools/gmx_energy.c
src/tools/gmx_rdf.c
src/tools/gmx_sas.c
src/tools/gmx_trjconv.c

index ee1347ef71d58a845af5df08a2b2cbefe822a1cf..cf77ba45c5d6490fa85a996eed5435a3b5a4b9d0 100644 (file)
@@ -281,6 +281,29 @@ if test "$enable_mpi" = "yes"; then
   AC_TRY_LINK([#include <mpi.h>],[int argc; char **argv; MPI_Init(&argc,&argv);],
     AC_MSG_RESULT([yes]),AC_MSG_ERROR([Cannot compile and link MPI code with $CC]))
   AC_DEFINE(GMX_MPI,,[Make a parallel version of GROMACS using MPI])
+
+# on the cray xt3 we have to tell autoconf that we 
+# are actually cross-compiling even if the architecture
+# of host and target are the same. so we enforce 
+# cross-compilation if __QK_USER__ is defined
+  AC_MSG_CHECKING([for catamount])
+  AC_TRY_COMPILE([
+#if defined __QK_USER__
+#else
+#error not catamount
+#endif
+],,[
+  AC_MSG_RESULT(yes)
+  cross_compiling=yes 
+  AC_DEFINE(GMX_CRAY_XT3,[],[Enable special hacks for Cray XT3])
+  AC_DEFINE(GMX_NO_SYSTEM,[],[Ignore calls to system(3)])
+  AC_DEFINE(GMX_NO_NICE,[],[Ignore calls to nice(3)])
+  AC_DEFINE(GMX_BROKEN_CALLOC,[],[Don't use calloc(3)])
+  extra_LDFLAGS="$extra_LDFLAGS -lgmalloc -lacml"
+],[
+  AC_MSG_RESULT(no)
+])
+# end of "$enable_mpi" = "yes"
 fi
 
 if test "$enable_threads" = "yes"; then
index 7ff7b0253f8d23aa9a7c472c3776fddc10235aa9..72ceea410b8eae513c6a0b3946a570caa41c3a30 100644 (file)
@@ -68,7 +68,7 @@ extern char *comment_str[eitemNR];
  * Open and Close 
  ********************************************************/
 
-extern int fio_open(char *fn,char *mode);
+extern int gmx_fio_open(char *fn,char *mode);
 /* Open a new file for reading or writing.
  * The file type will be deduced from the file name.
  * If fn is NULL, stdin / stdout will be used for Ascii I/O (TPA type)
@@ -78,12 +78,12 @@ extern int fio_open(char *fn,char *mode);
  * unix, but is important on windows.
  */
  
-extern void fio_close(int fp);
+extern void gmx_fio_close(int fp);
 /* Close the file corresponding to fp (if not stdio)
  * The routine will exit when an invalid fio is handled.
  */
 
-extern void fio_select(int fp);
+extern void gmx_fio_select(int fp);
 /* This routine sets the global variables do_read and do_write
  * to point to the correct routines for fp.
  */
@@ -92,47 +92,47 @@ extern void fio_select(int fp);
  * Change properties of the open file
  ********************************************************/
 
-extern void fio_setprecision(int fio,bool bDouble);
+extern void gmx_fio_setprecision(int fio,bool bDouble);
 /* Select the floating point precision for reading and writing files */
 
-extern char *fio_getname(int fio);
+extern char *gmx_fio_getname(int fio);
 /* Return the filename corresponding to the fio index */
 
-extern int fio_getftp(int fio);
+extern int gmx_fio_getftp(int fio);
 /* Return the filetype corresponding to the fio index */
 
-extern void fio_setftp_fio(int fio,int ftp);
+extern void gmx_fio_setftp_fio(int fio,int ftp);
 /* And set it */
 
-extern void fio_setdebug(int fio,bool bDebug);
+extern void gmx_fio_setdebug(int fio,bool bDebug);
 /* Set the debug mode */
 
-extern bool fio_getdebug(int fio);
+extern bool gmx_fio_getdebug(int fio);
 /* Return  whether debug mode is on in fio  */
 
-extern bool fio_getread(int fio);
+extern bool gmx_fio_getread(int fio);
 /* Return  whether read mode is on in fio  */
 
 /***************************************************
  * FILE Operations
  ***************************************************/
 
-extern void fio_rewind(int fio);
+extern void gmx_fio_rewind(int fio);
 /* Rewind the tpa file in fio */
 
-extern void fio_flush(int fio);
+extern void gmx_fio_flush(int fio);
 /* Flush the fio */
 
-extern off_t fio_ftell(int fio);
+extern off_t gmx_fio_ftell(int fio);
 /* Return file position if possible */
 
-extern void fio_seek(int fio,off_t fpos);
+extern void gmx_fio_seek(int fio,off_t fpos);
 /* Set file position if possible, quit otherwise */
 
-extern FILE *fio_getfp(int fio);
+extern FILE *gmx_fio_getfp(int fio);
 /* Return the file pointer itself */
 
-extern XDR *fio_getxdr(int fio);
+extern XDR *gmx_fio_getxdr(int fio);
 /* Return the file pointer itself */
 
 extern void set_comment(char *comment);
index 4a38cbc3f6a963fb7e29949772c4cd9a46e59394..fc6154cb34f3c661435d8e5e630e801a76e08750 100644 (file)
@@ -89,4 +89,10 @@ extern int search_neighbours(FILE *log,t_forcerec *fr,
                             bool bFillGrid,bool bDoForces);
  
 
+/* Debugging routines from wnblist.c */
+extern void dump_nblist(FILE *out,t_commrec *cr,t_forcerec *fr,int nDNL);
+
+extern int read_nblist(FILE *in,FILE *out,int **mat,int natoms,bool bSymm);
+/* Returns total number of neighbors. If bSymm the matrix is symmetrized. */
+
 #endif /* _ns_h */
index bfd6a4867c3e94441c34a15158e634708ffca6c8..2a1a7b7197776bade40201682e4bb9a2c53cc9d7 100644 (file)
@@ -72,7 +72,7 @@ static void list_trn(char *fn)
   printf("Going to open %s\n",fn);
   fpread  = open_trn(fn,"r"); 
   fpwrite = open_tpx(NULL,"w");
-  fio_setdebug(fpwrite,TRUE);
+  gmx_fio_setdebug(fpwrite,TRUE);
   
   mmm=mass[0]+2*mass[1];
   for(i=0; (i<5); i++) 
index 88103cf3e1707cf44ab4268f71fcbce86a2f45d0..735704ef211c307ddf4350a2095ba95f91dbf063 100644 (file)
@@ -92,11 +92,11 @@ static void rd_ener_nms(FILE *in,int *nre,char ***nm)
 static void edr_nms(int fp,int *nre,char ***nms)
 {
   XDR  *xdr;
-  bool bRead = fio_getread(fp);
+  bool bRead = gmx_fio_getread(fp);
   int  i;
   char **NM;
 
-  xdr = fio_getxdr(fp);
+  xdr = gmx_fio_getxdr(fp);
 
   NM=*nms;
   
@@ -120,7 +120,7 @@ static void edr_nms(int fp,int *nre,char ***nms)
 static bool do_eheader(int fp,t_enxframe *fr,bool *bOK)
 {
   int  block,i,dum=0;
-  bool bRead = fio_getread(fp);
+  bool bRead = gmx_fio_getread(fp);
   int  tempfix_nr=0;
 
   *bOK=TRUE;
@@ -163,20 +163,20 @@ void do_enxnms(int fp,int *nre,char ***nms)
 {
   bool bRead;
   
-  bRead = fio_getread(fp);
-  if (fio_getftp(fp) == efEDR) {
-    fio_select(fp);
+  bRead = gmx_fio_getread(fp);
+  if (gmx_fio_getftp(fp) == efEDR) {
+    gmx_fio_select(fp);
     edr_nms(fp,nre,nms);
   }
   else if (bRead)
-    rd_ener_nms(fio_getfp(fp),nre,nms);
+    rd_ener_nms(gmx_fio_getfp(fp),nre,nms);
   else
-    wr_ener_nms(fio_getfp(fp),*nre,*nms);
+    wr_ener_nms(gmx_fio_getfp(fp),*nre,*nms);
 }
 
 void close_enx(int fp)
 {
-  fio_close(fp);
+  gmx_fio_close(fp);
 }
 
 static bool empty_file(char *fn)
@@ -204,9 +204,9 @@ int open_enx(char *fn,char *mode)
   bool       bDum=TRUE;
 
   if (mode[0]=='r') {
-    fp=fio_open(fn,mode);
-    fio_select(fp);
-    fio_setprecision(fp,FALSE);
+    fp=gmx_fio_open(fn,mode);
+    gmx_fio_select(fp);
+    gmx_fio_setprecision(fp,FALSE);
     do_enxnms(fp,&nre,&nm);
     snew(fr,1);
     do_eheader(fp,fr,&bDum);
@@ -222,9 +222,9 @@ int open_enx(char *fn,char *mode)
       sfree(nm);
     }
     else {
-      fio_rewind(fp);
-      fio_select(fp);
-      fio_setprecision(fp,TRUE);
+      gmx_fio_rewind(fp);
+      gmx_fio_select(fp);
+      gmx_fio_setprecision(fp,TRUE);
       do_enxnms(fp,&nre,&nm);
       do_eheader(fp,fr,&bDum);
       if (((fr->e_size && (fr->nre == nre) && 
@@ -245,10 +245,10 @@ int open_enx(char *fn,char *mode)
     }
     free_enxframe(fr);
     sfree(fr);
-    fio_rewind(fp);
+    gmx_fio_rewind(fp);
   }
   else 
-    fp = fio_open(fn,mode);
+    fp = gmx_fio_open(fn,mode);
     
   framenr=0;
   frametime=0;
@@ -263,13 +263,13 @@ bool do_enx(int fp,t_enxframe *fr)
   real      tmp1,tmp2;
 
   bOK = TRUE;
-  bRead = fio_getread(fp);
+  bRead = gmx_fio_getread(fp);
   if (!bRead) {  
     fr->e_size = fr->nre*sizeof(fr->ener[0].e)*4;
     fr->d_size = fr->ndisre*(sizeof(fr->rav[0]) + 
                           sizeof(fr->rt[0]));
   }
-  fio_select(fp);
+  gmx_fio_select(fp);
 
   if (!do_eheader(fp,fr,&bOK)) {
     if (bRead) {
@@ -295,7 +295,7 @@ bool do_enx(int fp,t_enxframe *fr)
     bSane = bSane || (fr->nr[block] > 0);
   if (!((fr->step >= 0) && bSane)) {
     fprintf(stderr,"\nWARNING: there may be something wrong with energy file %s\n",
-           fio_getname(fp));
+           gmx_fio_getname(fp));
     fprintf(stderr,"Found: step=%d, nre=%d, ndisre=%d, nblock=%d, time=%g.\n"
            "Trying to skip frame expect a crash though\n",
            fr->step,fr->nre,fr->ndisre,fr->nblock,fr->t);
index 5a3c9101fbe1fbaf880a9571b60768293dd117e4..8dd92f40226cc0792550c2dabb5950d3f4449f8f 100644 (file)
@@ -85,7 +85,7 @@ bool in_ftpset(int ftp,int nset,const int set[])
 static bool do_dummy(void *item,int nitem,int eio,
                     char *desc,char *srcfile,int line)
 {
-  gmx_fatal(FARGS,"fio_select not called!");
+  gmx_fatal(FARGS,"gmx_fio_select not called!");
   
   return FALSE;
 }
@@ -628,14 +628,14 @@ static bool do_xdr(void *item,int nitem,int eio,
 }
 #endif
 
-#define fio_check(fio) range_check(fio,0,nFIO)
+#define gmx_fio_check(fio) range_check(fio,0,nFIO)
 
 /*****************************************************************
  *
  *                     EXPORTED SECTION
  *
  *****************************************************************/
-int fio_open(char *fn,char *mode)
+int gmx_fio_open(char *fn,char *mode)
 {
   t_fileio *fio=NULL;
   int      i,nfio=0;
@@ -653,7 +653,7 @@ int fio_open(char *fn,char *mode)
     else if (mode[0]=='a')
       strcpy(newmode,"a");
     else
-      gmx_fatal(FARGS,"DEATH HORROR in fio_open, mode is '%s'",mode);
+      gmx_fatal(FARGS,"DEATH HORROR in gmx_fio_open, mode is '%s'",mode);
   }
 
   /* Check if it should be opened as a binary file */
@@ -730,9 +730,9 @@ int fio_open(char *fn,char *mode)
 }
 
 
-void fio_close(int fio)
+void gmx_fio_close(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   
   if (in_ftpset(FIO[fio].iFTP,asize(ftpXDR),ftpXDR)) {
     xdrclose(FIO[fio].xdr);
@@ -750,9 +750,9 @@ void fio_close(int fio)
   do_write = do_dummy;
 }
 
-void fio_select(int fio)
+void gmx_fio_select(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
 #ifdef DEBUG
   fprintf(stderr,"Select fio called with type %d for file %s\n",
          FIO[fio].iFTP,FIO[fio].fn);
@@ -787,45 +787,45 @@ void fio_select(int fio)
   curfio = &(FIO[fio]);
 }
 
-void fio_setprecision(int fio,bool bDouble)
+void gmx_fio_setprecision(int fio,bool bDouble)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   FIO[fio].bDouble = bDouble;
 }
 
-bool fio_getdebug(int fio)
+bool gmx_fio_getdebug(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   return FIO[fio].bDebug;
 }
 
-void fio_setdebug(int fio,bool bDebug)
+void gmx_fio_setdebug(int fio,bool bDebug)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   FIO[fio].bDebug = bDebug;
 }
 
-char *fio_getname(int fio)
+char *gmx_fio_getname(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   return curfio->fn;
 }
 
-void fio_setftp(int fio,int ftp)
+void gmx_fio_setftp(int fio,int ftp)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   FIO[fio].iFTP = ftp;
 }
 
-int fio_getftp(int fio)
+int gmx_fio_getftp(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   return FIO[fio].iFTP;
 }
  
-void fio_rewind(int fio)
+void gmx_fio_rewind(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   if (FIO[fio].xdr) {
     xdrclose(FIO[fio].xdr);
     /* File is always opened as binary by xdropen */
@@ -835,27 +835,27 @@ void fio_rewind(int fio)
     frewind(FIO[fio].fp);
 }
 
-void fio_flush(int fio)
+void gmx_fio_flush(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   if (FIO[fio].fp)
     fflush(FIO[fio].fp);
  if (FIO[fio].xdr)
       (void) fflush ((FILE *) FIO[fio].xdr->x_private);
 }
   
-off_t fio_ftell(int fio)
+off_t gmx_fio_ftell(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   if (FIO[fio].fp)
     return ftell(FIO[fio].fp);
   else
     return 0;
 }
 
-void fio_seek(int fio, off_t fpos)
+void gmx_fio_seek(int fio, off_t fpos)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   if (FIO[fio].fp)
 #ifdef HAVE_FSEEKO
     fseeko(FIO[fio].fp,fpos,SEEK_SET);
@@ -866,27 +866,27 @@ void fio_seek(int fio, off_t fpos)
     gmx_file(FIO[fio].fn);
 }
 
-FILE *fio_getfp(int fio)
+FILE *gmx_fio_getfp(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   if (FIO[fio].fp)
     return FIO[fio].fp;
   else
     return NULL;
 }
 
-XDR *fio_getxdr(int fio)
+XDR *gmx_fio_getxdr(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   if (FIO[fio].xdr) 
     return FIO[fio].xdr;
   else
     return NULL;
 }
 
-bool fio_getread(int fio)
+bool gmx_fio_getread(int fio)
 {
-  fio_check(fio);
+  gmx_fio_check(fio);
   
   return FIO[fio].bRead;
 }
index da6ef082ac83025cb503ea186ab27379f797f936..b813de47facae692e59e068d1d32a96dfd01335d 100644 (file)
@@ -70,7 +70,7 @@ static void add_gbond(t_graph *g,atom_id a0,atom_id a1)
   inda0 = a0 - g->start;
   inda1 = a1 - g->start;
   bFound = FALSE;
-  /* Search for a direct edga between a0 and a1.
+  /* Search for a direct edge between a0 and a1.
    * All egdes are bidirectional, so we only need to search one way.
    */
   for(i=0; (i<g->nedge[inda0] && !bFound); i++)
index 7cd7626740ff3adbc064405f239191e0b71f1190..b40f667b7ccfd4e69f797d09db5b49920053e974 100644 (file)
@@ -98,9 +98,9 @@ gmx_mtxio_write(char *                   filename,
         gmx_fatal(FARGS,"Both full AND sparse matrix specified to gmx_mtxio_write().\n");
     }
     
-    fd = fio_open(filename,"w");
-    fio_select(fd);
-    xd = fio_getxdr(fd);
+    fd = gmx_fio_open(filename,"w");
+    gmx_fio_select(fd);
+    xd = gmx_fio_getxdr(fd);
     
     /* Write magic number */
     i = GMX_MTXIO_MAGIC_NUMBER;
@@ -149,7 +149,7 @@ gmx_mtxio_write(char *                   filename,
             }
         }
     }
-    fio_close(fd);
+    gmx_fio_close(fd);
 }
 
 
@@ -168,9 +168,9 @@ gmx_mtxio_read (char *                  filename,
     char    gmxver[256];
     size_t  sz;
     
-    fd = fio_open(filename,"r");
-    fio_select(fd);
-    xd = fio_getxdr(fd);
+    fd = gmx_fio_open(filename,"r");
+    gmx_fio_select(fd);
+    xd = gmx_fio_getxdr(fd);
     
     /* Read and check magic number */
     i = GMX_MTXIO_MAGIC_NUMBER;
@@ -240,7 +240,7 @@ gmx_mtxio_read (char *                  filename,
             }
         }
     }
-    fio_close(fd);
+    gmx_fio_close(fd);
 }
 
 
index 9450b84ba39189c17c8018b5ddf9b2c263e7067c..93620fc2d4dcc7f78c35a256145539a76147497c 100644 (file)
@@ -109,10 +109,20 @@ void *save_calloc(char *name,char *file,int line,
     p=NULL;
   else
     {
+#ifdef GMX_BROKEN_CALLOC
+      /* emulate calloc(3) with malloc/memset on machines with 
+         a broken calloc, e.g. in -lgmalloc on cray xt3. */
+      if ((p=malloc((size_t)nelem*(size_t)elsize))==NULL) 
+        gmx_fatal(errno,__FILE__,__LINE__,
+                 "calloc for %s (nelem=%d, elsize=%d, file %s"
+                 ", line %d)",name,nelem,elsize,file,line);
+      memset(p, 0,(size_t) (nelem * elsize));
+#else
       if ((p=calloc((size_t)nelem,(size_t)elsize))==NULL) 
         gmx_fatal(errno,__FILE__,__LINE__,
                  "calloc for %s (nelem=%d, elsize=%d, file %s"
                  ", line %d)",name,nelem,elsize,file,line);
+#endif
     }
 #ifdef DEBUG
   log_action(1,name,file,line,nelem,elsize,p);
index 42c096991e213a9a7f02d3284ac33faae51572b3..2d65fb5dbdc157e231d953a671d9b6676014bd63 100644 (file)
@@ -211,7 +211,7 @@ int write_traj(FILE *log,t_commrec *cr,
   }
   if ((xx || vv || ff) && MASTER(cr)) {
     fwrite_trn(fp,step,t,lambda,box,natoms,xx,vv,ff);
-    fio_flush(fp);
+    gmx_fio_flush(fp);
   }
   return fp;
 }
index 067917ee0a2f6a22a22d073166bd89a53ff2cc34..f7c3a4c73edff68bd51d2ac5a12ae9120d9fa3b6 100644 (file)
@@ -748,8 +748,13 @@ void parse_common_args(int *argc,char *argv[],unsigned long Flags,
       else
        sscanf(not_nicestr[0],"%d",&nicelevel);
     }
+
+#ifndef GMX_NO_NICE
+  /* The some system, e.g. the catamount kernel on cray xt3 do not have nice(2). */
   if (nicelevel != 0 && !bExit)
     nice(nicelevel);
+#endif
+
 #endif
   
   if (!(FF(PCA_QUIET) || bQuiet )) {
index fba0feeb1fbab5b37564216895be9806d336e347..311d15e07c8415e7089741c936b6096e7d66de0a 100644 (file)
 #include <config.h>
 #endif
 
+#ifdef GMX_CRAY_XT3
+#ifndef NO_PWUID
+#define NO_PWUID
+#endif
+#endif
+
 #include <stdio.h>
 #include <ctype.h>
 #include <stdlib.h>
index 2518bff2ef1fe1a3c19e7c85b0f963b9089e0c1c..c35103108a1b1b6e40dc88a3aae57b4b0e4dd5bd 100644 (file)
@@ -149,16 +149,16 @@ void _do_section(int fp,int key,bool bRead,char *src,int line)
   char buf[STRLEN];
   bool bDbg;
 
-  if (fio_getftp(fp) == efTPA) {
+  if (gmx_fio_getftp(fp) == efTPA) {
     if (!bRead) {
       do_string(itemstr[key]);
-      bDbg       = fio_getdebug(fp);
-      fio_setdebug(fp,FALSE);
+      bDbg       = gmx_fio_getdebug(fp);
+      gmx_fio_setdebug(fp,FALSE);
       do_string(comment_str[key]);
-      fio_setdebug(fp,bDbg);
+      gmx_fio_setdebug(fp,bDbg);
     }
     else {
-      if (fio_getdebug(fp))
+      if (gmx_fio_getdebug(fp))
        fprintf(stderr,"Looking for section %s (%s, %d)",
                itemstr[key],src,line);
       
@@ -168,7 +168,7 @@ void _do_section(int fp,int key,bool bRead,char *src,int line)
       
       if (strcasecmp(buf,itemstr[key]) != 0) 
        gmx_fatal(FARGS,"\nCould not find section heading %s",itemstr[key]);
-      else if (fio_getdebug(fp))
+      else if (gmx_fio_getdebug(fp))
        fprintf(stderr," and found it\n");
     }
   }
@@ -1162,8 +1162,8 @@ static void do_tpxheader(int fp,bool bRead,t_tpxheader *tpx, bool TopOnlyOK, int
   bool  bDouble;
   int   precision;
   int   fver,fgen;
-  fio_select(fp);
-  fio_setdebug(fp,bDebugMode());
+  gmx_fio_select(fp);
+  gmx_fio_setdebug(fp,bDebugMode());
   
   /* NEW! XDR tpb file */
   precision = sizeof(real);
@@ -1173,21 +1173,21 @@ static void do_tpxheader(int fp,bool bRead,t_tpxheader *tpx, bool TopOnlyOK, int
       gmx_fatal(FARGS,"Can not read file %s,\n"
                  "             this file is from a Gromacs version which is older than 2.0\n"
                  "             Make a new one with grompp or use a gro or pdb file, if possible",
-                 fio_getname(fp));
+                 gmx_fio_getname(fp));
     do_int(precision);
     bDouble = (precision == sizeof(double));
     if ((precision != sizeof(float)) && !bDouble)
       gmx_fatal(FARGS,"Unknown precision in file %s: real is %d bytes "
                  "instead of %d or %d",
-                 fio_getname(fp),precision,sizeof(float),sizeof(double));
-    fio_setprecision(fp,bDouble);
+                 gmx_fio_getname(fp),precision,sizeof(float),sizeof(double));
+    gmx_fio_setprecision(fp,bDouble);
     fprintf(stderr,"Reading file %s, %s (%s precision)\n",
-           fio_getname(fp),buf,bDouble ? "double" : "single");
+           gmx_fio_getname(fp),buf,bDouble ? "double" : "single");
   }
   else {
     do_string(GromacsVersion());
     bDouble = (precision == sizeof(double));
-    fio_setprecision(fp,bDouble);
+    gmx_fio_setprecision(fp,bDouble);
     do_int(precision);
     fver = tpx_version;
     fgen = tpx_generation;
@@ -1211,7 +1211,7 @@ static void do_tpxheader(int fp,bool bRead,t_tpxheader *tpx, bool TopOnlyOK, int
       ((fver > tpx_version) && !TopOnlyOK) ||
       (fgen > tpx_generation))
     gmx_fatal(FARGS,"reading tpx file (%s) version %d with version %d program",
-               fio_getname(fp),fver,tpx_version);
+               gmx_fio_getname(fp),fver,tpx_version);
   
   do_section(eitemHEADER,bRead);
   do_int (tpx->natoms);
@@ -1281,7 +1281,7 @@ static void do_tpx(int fp,bool bRead,int *step,real *t,
     }
   }
 
-#define do_test(b,p) if (bRead && (p!=NULL) && !b) gmx_fatal(FARGS,"No %s in %s",#p,fio_getname(fp)) 
+#define do_test(b,p) if (bRead && (p!=NULL) && !b) gmx_fatal(FARGS,"No %s in %s",#p,gmx_fio_getname(fp)) 
 
   do_test(tpx.bBox,state->box);
   do_section(eitemBOX,bRead);
@@ -1380,12 +1380,12 @@ static void do_tpx(int fp,bool bRead,int *step,real *t,
 
 int open_tpx(char *fn,char *mode)
 {
-  return fio_open(fn,mode);
+  return gmx_fio_open(fn,mode);
 }    
  
 void close_tpx(int fp)
 {
-  fio_close(fp);
+  gmx_fio_close(fp);
 }
 
 void read_tpxheader(char *fn,t_tpxheader *tpx, bool TopOnlyOK,int *file_version, int *file_generation)
index af2802124267f2df960ff82a92c037fa7d7d1502..10b0ebe4f8d359686467e06283cfbe93132e2726 100644 (file)
@@ -80,7 +80,7 @@ static bool do_trnheader(int fp,bool bRead,t_trnheader *sh, bool *bOK)
   
   *bOK=TRUE;
 
-  fio_select(fp);
+  gmx_fio_select(fp);
   if (!do_int(magic))
     return FALSE;
   
@@ -105,7 +105,7 @@ static bool do_trnheader(int fp,bool bRead,t_trnheader *sh, bool *bOK)
 
   if (!*bOK) return *bOK; 
   sh->bDouble = (nFloatSize(sh) == sizeof(double));
-  fio_setprecision(fp,sh->bDouble);
+  gmx_fio_setprecision(fp,sh->bDouble);
 
   if (bRead && bFirst) {
     fprintf(stderr,"(%s precision)\n",sh->bDouble ? "double" : "single");
@@ -264,10 +264,10 @@ bool fread_htrn(int fp,t_trnheader *trn,rvec *box,rvec *x,rvec *v,rvec *f)
 
 int open_trn(char *fn,char *mode)
 {
-  return fio_open(fn,mode);
+  return gmx_fio_open(fn,mode);
 }
 
 void close_trn(int fp)
 {
-  fio_close(fp);
+  gmx_fio_close(fp);
 }
index 4cedc1361821acfdc5654a55217636a956d87361..58f366f59b062e047352d9847f086fe8ac0bf2f7 100644 (file)
@@ -163,18 +163,18 @@ int write_trxframe_indexed(int fnum,t_trxframe *fr,int nind,atom_id *ind)
   else
     prec = 1000.0;
   
-  switch (fio_getftp(fnum)) {
+  switch (gmx_fio_getftp(fnum)) {
   case efTRJ:
   case efTRR:
     break;
   default:
     if (!fr->bX)
       gmx_fatal(FARGS,"Need coordinates to write a %s trajectory",
-                 ftp2ext(fio_getftp(fnum)));
+                 ftp2ext(gmx_fio_getftp(fnum)));
     break;
   }
 
-  switch (fio_getftp(fnum)) {
+  switch (gmx_fio_getftp(fnum)) {
   case efTRJ:
   case efTRR:
     if (fr->bV) {
@@ -199,7 +199,7 @@ int write_trxframe_indexed(int fnum,t_trxframe *fr,int nind,atom_id *ind)
     break;
   }
 
-  switch (fio_getftp(fnum)) {
+  switch (gmx_fio_getftp(fnum)) {
   case efXTC: 
     write_xtc(fnum,nind,fr->step,fr->time,fr->box,xout,prec);
     break;
@@ -214,29 +214,29 @@ int write_trxframe_indexed(int fnum,t_trxframe *fr,int nind,atom_id *ind)
   case efENT:
     if (!fr->bAtoms)
       gmx_fatal(FARGS,"Can not write a %s file without atom names",
-                 ftp2ext(fio_getftp(fnum)));
+                 ftp2ext(gmx_fio_getftp(fnum)));
     sprintf(title,"frame t= %.3f",fr->time);
-    if (fio_getftp(fnum) == efGRO)
-      write_hconf_indexed_p(fio_getfp(fnum),title,fr->atoms,nind,ind,
+    if (gmx_fio_getftp(fnum) == efGRO)
+      write_hconf_indexed_p(gmx_fio_getfp(fnum),title,fr->atoms,nind,ind,
                            prec2ndec(prec),
                            fr->x,fr->bV ? fr->v : NULL,fr->box);
     else
-      write_pdbfile_indexed(fio_getfp(fnum),title,fr->atoms,
+      write_pdbfile_indexed(gmx_fio_getfp(fnum),title,fr->atoms,
                            fr->x,fr->box,0,fr->step,nind,ind);
     break;
   case efG87:
-    write_gms(fio_getfp(fnum),nind,xout,fr->box);
+    write_gms(gmx_fio_getfp(fnum),nind,xout,fr->box);
     break;
   case efG96:
-    write_g96_conf(fio_getfp(fnum),fr,nind,ind); 
+    write_g96_conf(gmx_fio_getfp(fnum),fr,nind,ind); 
     break;
   default:
     gmx_fatal(FARGS,"Sorry, write_trxframe_indexed can not write %s",
-               ftp2ext(fio_getftp(fnum)));
+               ftp2ext(gmx_fio_getftp(fnum)));
     break;
   }
 
-  switch (fio_getftp(fnum)) {
+  switch (gmx_fio_getftp(fnum)) {
   case efTRN:
   case efTRJ:
   case efTRR:
@@ -263,18 +263,18 @@ int write_trxframe(int fnum,t_trxframe *fr)
   else
     prec = 1000.0;
 
-  switch (fio_getftp(fnum)) {
+  switch (gmx_fio_getftp(fnum)) {
   case efTRJ:
   case efTRR:
     break;
   default:
     if (!fr->bX)
       gmx_fatal(FARGS,"Need coordinates to write a %s trajectory",
-                 ftp2ext(fio_getftp(fnum)));
+                 ftp2ext(gmx_fio_getftp(fnum)));
     break;
   }
 
-  switch (fio_getftp(fnum)) {
+  switch (gmx_fio_getftp(fnum)) {
   case efXTC:
     write_xtc(fnum,fr->natoms,fr->step,fr->time,fr->box,fr->x,prec);
     break;
@@ -289,24 +289,24 @@ int write_trxframe(int fnum,t_trxframe *fr)
   case efENT:
     if (!fr->bAtoms)
       gmx_fatal(FARGS,"Can not write a %s file without atom names",
-                 ftp2ext(fio_getftp(fnum)));
+                 ftp2ext(gmx_fio_getftp(fnum)));
     sprintf(title,"frame t= %.3f",fr->time);
-    if (fio_getftp(fnum) == efGRO)
-      write_hconf_p(fio_getfp(fnum),title,fr->atoms,
+    if (gmx_fio_getftp(fnum) == efGRO)
+      write_hconf_p(gmx_fio_getfp(fnum),title,fr->atoms,
                    prec2ndec(prec),fr->x,fr->bV ? fr->v : NULL,fr->box);
     else
-      write_pdbfile(fio_getfp(fnum),title,
+      write_pdbfile(gmx_fio_getfp(fnum),title,
                    fr->atoms,fr->x,fr->box,0,fr->step);
     break;
   case efG87:
-    write_gms(fio_getfp(fnum),fr->natoms,fr->x,fr->box);
+    write_gms(gmx_fio_getfp(fnum),fr->natoms,fr->x,fr->box);
     break;
   case efG96:
-    write_g96_conf(fio_getfp(fnum),fr,-1,NULL); 
+    write_g96_conf(gmx_fio_getfp(fnum),fr,-1,NULL); 
     break;
   default:
     gmx_fatal(FARGS,"Sorry, write_trxframe can not write %s",
-               ftp2ext(fio_getftp(fnum)));
+               ftp2ext(gmx_fio_getftp(fnum)));
     break;
   }
 
@@ -337,7 +337,7 @@ int write_trx(int fnum,int nind,atom_id *ind,t_atoms *atoms,
 
 void close_trx(int status)
 {
-  fio_close(status);
+  gmx_fio_close(status);
 }
 
 int open_trx(char *outfile,char *filemode)
@@ -345,7 +345,7 @@ int open_trx(char *outfile,char *filemode)
   if (filemode[0]!='w' && filemode[0]!='a')
     gmx_fatal(FARGS,"Sorry, write_trx can only write");
 
-  return fio_open(outfile,filemode);
+  return gmx_fio_open(outfile,filemode);
 }
 
 static bool gmx_next_frame(int status,t_trxframe *fr)
@@ -607,17 +607,17 @@ bool read_next_frame(int status,t_trxframe *fr)
     fr->tppf = fr->tpf;
     fr->tpf  = fr->time;
     
-    switch (fio_getftp(status)) {
+    switch (gmx_fio_getftp(status)) {
     case efTRJ:
     case efTRR:
         bRet = gmx_next_frame(status,fr);
         break;
     case efG96:
-      read_g96_conf(fio_getfp(status),NULL,fr);
+      read_g96_conf(gmx_fio_getfp(status),NULL,fr);
       bRet = (fr->natoms > 0);
       break;
     case efG87:
-      bRet = xyz_next_x(fio_getfp(status),&fr->time,fr->natoms,fr->x,fr->box);
+      bRet = xyz_next_x(gmx_fio_getfp(status),&fr->time,fr->natoms,fr->x,fr->box);
       fr->bTime = bRet;
       fr->bX    = bRet;
       fr->bBox  = bRet;
@@ -650,14 +650,14 @@ bool read_next_frame(int status,t_trxframe *fr)
       }
       break;
     case efPDB:
-      bRet = pdb_next_x(fio_getfp(status),fr);
+      bRet = pdb_next_x(gmx_fio_getfp(status),fr);
       break;
     case efGRO:
-      bRet = gro_next_x_or_v(fio_getfp(status),fr);
+      bRet = gro_next_x_or_v(gmx_fio_getfp(status),fr);
       break;
     default:
       gmx_fatal(FARGS,"DEATH HORROR in read_next_frame ftp=%s,status=%d",
-                 ftp2ext(fio_getftp(status)),status);
+                 ftp2ext(gmx_fio_getftp(status)),status);
     }
     
     if (bRet) {
@@ -700,25 +700,25 @@ int read_first_frame(int *status,char *fn,t_trxframe *fr,int flags)
   bFirst = TRUE;
   INITCOUNT;
   
-  fp = *status =fio_open(fn,"r");
-  switch (fio_getftp(fp)) 
+  fp = *status =gmx_fio_open(fn,"r");
+  switch (gmx_fio_getftp(fp)) 
   {
   case efTRJ:
   case efTRR:
     break;
   case efG96:
     /* Can not rewind a compressed file, so open it twice */
-    read_g96_conf(fio_getfp(fp),fn,fr);
-    fio_close(fp);
+    read_g96_conf(gmx_fio_getfp(fp),fn,fr);
+    gmx_fio_close(fp);
     clear_trxframe(fr,FALSE);
     if (flags & (TRX_READ_X | TRX_NEED_X))
       snew(fr->x,fr->natoms);
     if (flags & (TRX_READ_V | TRX_NEED_V))
       snew(fr->v,fr->natoms);
-    fp = *status =fio_open(fn,"r");
+    fp = *status =gmx_fio_open(fn,"r");
     break;
   case efG87:
-    fr->natoms=xyz_first_x(fio_getfp(fp),&fr->time,&fr->x,fr->box);
+    fr->natoms=xyz_first_x(gmx_fio_getfp(fp),&fr->time,&fr->x,fr->box);
     if (fr->natoms) {
       fr->bTime = TRUE;
       fr->bX    = TRUE;
@@ -750,13 +750,13 @@ int read_first_frame(int *status,char *fn,t_trxframe *fr,int flags)
     bFirst = FALSE;
     break;
   case efPDB:
-    pdb_first_x(fio_getfp(fp),fr);
+    pdb_first_x(gmx_fio_getfp(fp),fr);
     if (fr->natoms)
       printcount(fr->time,FALSE);
     bFirst = FALSE;
     break;
   case efGRO:
-    if (gro_first_x_or_v(fio_getfp(fp),fr))
+    if (gro_first_x_or_v(gmx_fio_getfp(fp),fr))
       printcount(fr->time,FALSE);
     bFirst = FALSE;
     break;
@@ -809,14 +809,14 @@ bool read_next_x(int status,real *t, int natoms, rvec x[], matrix box)
 
 void close_trj(int status)
 {
-  fio_close(status);
+  gmx_fio_close(status);
 }
 
 void rewind_trj(int status)
 {
   INITCOUNT;
   
-  fio_rewind(status);
+  gmx_fio_rewind(status);
 }
 
 /***** V E L O C I T Y   S T U F F *****/
index 55e40c4c7e4735c3443d09fb09e12e06aa4076c8..9ebd11d2122e21ac65447eb1c861918b45486130 100644 (file)
@@ -98,7 +98,12 @@ void do_view(char *fn, char *opts)
       if ( strlen(cmd) ) {
        sprintf(buf,"%s %s %s &",cmd,opts ? opts : "",fn);
        fprintf(stderr,"Executing '%s'\n",buf);
+#ifdef GMX_NO_SYSTEM
+        printf("Warning-- No calls to system(3) supported on this platform.");
+        printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
+#else
        system(buf);
+#endif
       }
     }
   }
index 5e95e22f8da7d1e9908240b14596dc40070f148a..6d3ca8bc52a981679e9af39055f77c9335df9135 100644 (file)
@@ -69,12 +69,12 @@ int xdr_real(XDR *xdrs,real *r)
 
 int open_xtc(char *fn,char *mode)
 {
-  return fio_open(fn,mode);
+  return gmx_fio_open(fn,mode);
 }
 
 void close_xtc(int fp)
 {
-  fio_close(fp);
+  gmx_fio_close(fp);
 }
 
 static void check_xtc_magic(int magic)
@@ -183,7 +183,7 @@ int write_xtc(int fp,
   XDR *xd;
   bool bDum;
 
-  xd = fio_getxdr(fp);
+  xd = gmx_fio_getxdr(fp);
   /* write magic number and xtc identidier */
   if (!xtc_header(xd,&magic_number,&natoms,&step,&time,&bDum))
     return 0;
@@ -199,7 +199,7 @@ int read_first_xtc(int fp,int *natoms,int *step,real *time,
   XDR *xd;
   
   *bOK=TRUE;
-  xd = fio_getxdr(fp);
+  xd = gmx_fio_getxdr(fp);
   
   /* read header and malloc x */
   if ( !xtc_header(xd,&magic,natoms,step,time,bOK))
@@ -224,7 +224,7 @@ int read_next_xtc(int fp,
   XDR *xd;
 
   *bOK=TRUE;
-  xd = fio_getxdr(fp);
+  xd = gmx_fio_getxdr(fp);
   
   /* read header */
   if (!xtc_header(xd,&magic,&n,step,time,bOK))
index ecfed263847011f5a8febebf075230db90a9bfe0..44131aea4f93609d0f61c781159fe7f59763f38f 100644 (file)
@@ -276,7 +276,7 @@ void chk_trj(char *fn,char *tpr,real tol)
     INC(fr,count,first,last,bF);
     INC(fr,count,first,last,bBox);
 #undef INC
-    fpos = fio_ftell(status);
+    fpos = gmx_fio_ftell(status);
   } while (read_next_frame(status,&fr));
   
   fprintf(stderr,"\n");
index 44c93da853250e01004c123c814813b1bc5b0b46..2ae574aa955339f91e901b6239ec8d6cb0cae828 100644 (file)
@@ -124,7 +124,7 @@ static void list_trn(char *fn)
 
   fpread  = open_trn(fn,"r"); 
   fpwrite = open_tpx(NULL,"w");
-  fio_setdebug(fpwrite,TRUE);
+  gmx_fio_setdebug(fpwrite,TRUE);
   
   nframe = 0;
   while (fread_trnheader(fpread,&trn,&bOK)) {
index 2cbfb4c75925caebe60cfb367a616188977a679c..3a6f460a12b39c016dd435de776ff404035d73f9 100644 (file)
@@ -65,5 +65,7 @@ int main(int argc,char *argv[])
   }
     
   thanx(stdout);
+  
+  return 0;
 }
  
index 24f384ec14affcf59a63d1ca5bba6d65df1b3331..1a49b7098dd4ed3cf6c96a321f1b1d4510512033 100644 (file)
@@ -138,24 +138,24 @@ void mdrunner(t_commrec *cr,int nfile,t_filenm fnm[],
 {
   double     nodetime=0,realtime;
   t_inputrec *inputrec;
-  t_state    *state;
-  rvec       *buf,*f,*vold,*vt;
+  t_state    *state=NULL;
+  rvec       *buf=NULL,*f=NULL,*vold=NULL,*vt=NULL;
   real       tmpr1,tmpr2;
-  real       *ener;
+  real       *ener=NULL;
   t_nrnb     *nrnb;
   t_nsborder *nsb=NULL;
-  t_topology *top;
-  t_groups   *grps;
-  t_graph    *graph;
-  t_mdatoms  *mdatoms;
-  t_forcerec *fr;
-  t_fcdata   *fcd;
-  real       ewaldcoeff;
-  gmx_pme_t  *pmedata;
+  t_topology *top=NULL;
+  t_groups   *grps=NULL;
+  t_graph    *graph=NULL;
+  t_mdatoms  *mdatoms=NULL;
+  t_forcerec *fr=NULL;
+  t_fcdata   *fcd=NULL;
+  real       ewaldcoeff=0;
+  gmx_pme_t  *pmedata=NULL;
   time_t     start_t=0;
-  bool       bVsites,bParVsites;
+  bool       bVsites=FALSE,bParVsites=FALSE;
   t_comm_vsites vsitecomm;
-  int        i,m,nChargePerturbed,status;
+  int        i,m,nChargePerturbed=0,status;
   char       *gro;
   
   if ((ddxyz[XX]!=1 || ddxyz[YY]!=1 || ddxyz[ZZ]!=1)) {
index 6487cfd3062ec2e64e4da1aa33d4c897e00e711d..2e0a830ba3d9f5b937c4d272bdfea4612110241c 100644 (file)
@@ -462,7 +462,7 @@ bool replica_exchange(FILE *fplog,const t_commrec *cr,gmx_repl_ex_t *re,
 {
   gmx_multisim_t *ms;
   int  exchange=-1,shift;
-  bool bExchanged;
+  bool bExchanged=FALSE;
 
   ms = cr->ms;
 
index 0cce99e6c26cb1d90ff374018b069608059a8f7d..529f0330572b5e10c8e52808480138745e484d31 100644 (file)
@@ -226,7 +226,13 @@ void preprocess(char *infile,char *outfile,
     fprintf(debug,"Command line for cpp:\n\t%s\n",command);
   
   /* execute preprocessor */
+#ifdef GMX_NO_SYSTEM
+  error = 0;
+  printf("Warning-- No calls to system(3) supported on this platform.");
+  printf("Warning-- Skipping execution of 'system(\"%s\")'.",command);
+#else
   error=system(command);
+#endif
   if (error) {
     if (error>0)
       printf("cpp exit code: %d\n",error);
index 5f581d969e11d0528eaef7a35029a616e05dbc1a..60db48c07d3ec1a64a1b4793d415f1e9221f5a50 100644 (file)
@@ -510,7 +510,8 @@ static void distribute_cg(FILE *fplog,matrix box,t_block *cgs,rvec pos[],
 static void get_cg_distribution(FILE *fplog,gmx_domdec_t *dd,
                                t_block *cgs,matrix box,rvec pos[])
 {
-  int i,buf2[2],cg_gl;
+  int i,cg_gl;
+  int buf2[2] = { 0, 0 };
 
   clear_dd_indices(dd,0);
 
@@ -1339,7 +1340,7 @@ int gmx_ddindex2pmeslab(t_commrec *cr,int ddindex)
 int gmx_ddindex2nodeid(t_commrec *cr,int ddindex)
 {
   ivec coords;
-  int  nodeid;
+  int  nodeid=-1;
 
   if (cr->dd->bCartesian) {
     gmx_ddindex2xyz(cr->dd->nc,ddindex,coords);
@@ -1361,10 +1362,11 @@ static int dd_node2pmenode(t_commrec *cr,int nodeid)
   ivec coords,coords_pme;
   int  i;
   int  pmenode;
-  
   dd = cr->dd;
 
   pmenode = -1;
+  if (dd == NULL) return pmenode; /* no domain decomposition? */
   /* This assumes a uniform x domain decomposition grid cell size */
   if (dd->bCartesian) {
 #ifdef GMX_MPI
index b2e71e93bfe5b0f0e4e50aad5e0715fb5367fa2a..3735e4b3b2bb66c6382786a1545aa0c6fb82811a 100644 (file)
@@ -52,7 +52,6 @@
 #include "nsb.h"
 #include "names.h"
 #include "network.h"
-#include "wnblist.h"
 #include "pbc.h"
 #include "ns.h"
 #include "nrnb.h"
index 7c357a9a74841439db69c88ddf22341d2a55b6d3..25b745e55936538a42c6a023065f45ce825f490d 100644 (file)
@@ -44,6 +44,8 @@
 #include "vec.h"
 #include "physics.h"
 #include "coulomb.h"
+#include "pppm.h"
+#include "xvgr.h"
 #include "fftgrid.h"
 
 static void calc_k(rvec lll,int ix,int iy,int iz,int nx,int ny,int nz,rvec k)
index e681a364d18ee95a51c9fede3907be2d3e30a896..75cf71951f2d624f7b44b315adbdcad0ee55b931 100644 (file)
@@ -2170,7 +2170,7 @@ time_t do_tpi(FILE *fplog,int nfile,t_filenm fnm[],
       sfree(leg[i]);
     sfree(leg);
   }
-
+  clear_rvec(x_init);
   V_all = 0;
   VembU_all = 0;
 
index ee45de9d5382debbbb1b6fcdcda5066a007c47ad..72c1e23f630c6b896b5137de5db1b076a7623682 100644 (file)
@@ -1442,6 +1442,8 @@ static void receive_virial_energy(t_commrec *cr,
 #ifdef GMX_MPI
     MPI_Recv(&cve,sizeof(cve),MPI_BYTE,cr->dd->pme_nodeid,1,cr->mpi_comm_mysim,
             MPI_STATUS_IGNORE);
+#else
+    memset(&cve,0,sizeof(cve));
 #endif
        
     m_add(vir,cve.vir,vir);
index 98f6f38c3d564d9423e8a067c2e817d48b3b0ce1..5df8a925a0d49158833c5482d11206709c85d5a6 100644 (file)
@@ -53,7 +53,6 @@
 #include "nsb.h"
 #include "names.h"
 #include "network.h"
-#include "wnblist.h"
 #include "pbc.h"
 #include "ns.h"
 #include "nrnb.h"
index 4bc57c77ff12f40916f099a24b95daa1565a415b..43db66a600d6d67c9dca5884623888d7e392e0a1 100644 (file)
@@ -52,7 +52,6 @@
 #include "nsb.h"
 #include "names.h"
 #include "network.h"
-#include "wnblist.h"
 #include "pbc.h"
 #include "ns.h"
 #include "nrnb.h"
@@ -866,8 +865,13 @@ void do_gaussian(int step,char *exe)
             "input.com",
            "input.log");
   fprintf(stderr,"Calling '%s'\n",buf);
+#ifdef GMX_NO_SYSTEM
+  printf("Warning-- No calls to system(3) supported on this platform.");
+  gmx_fatal(FARGS,"Call to '%s' failed\n",buf);
+#else
   if ( system(buf) != 0 )
     gmx_fatal(FARGS,"Call to '%s' failed\n",buf);
+#endif
 }
 
 real call_gaussian(t_commrec *cr,  t_forcerec *fr, 
index 5a2460a67660050814539de26e84c6fd26b9d979..c34e59cdb0fb36ac8b8d8b60fd01f3cad5e724d5 100644 (file)
@@ -52,7 +52,6 @@
 #include "nsb.h"
 #include "names.h"
 #include "network.h"
-#include "wnblist.h"
 #include "pbc.h"
 #include "ns.h"
 #include "nrnb.h"
index ba0a06cb11a870b8c8aef9ce231b0511b1458d13..692460095a46d83aeb9c622847208c4c92e5a71b 100644 (file)
@@ -52,7 +52,6 @@
 #include "nsb.h"
 #include "names.h"
 #include "network.h"
-#include "wnblist.h"
 #include "pbc.h"
 #include "ns.h"
 #include "nrnb.h"
index f27af6a96722083e7342600ec43c35d35205677d..551f8af110683cee188c82d38dddd6844569e362 100644 (file)
 #include <config.h>
 #endif
 
+#ifdef GMX_CRAY_XT3
+#include<catamount/dclock.h>
+#endif
+
+
 #include <stdio.h>
 #include <time.h>
 #include <math.h>
@@ -477,6 +482,24 @@ void calc_virial(FILE *fplog,int start,int homenr,rvec x[],rvec f[],
 #define clock() -1
 #endif
 static double runtime=0;
+#ifdef GMX_CRAY_XT3
+static double cprev;
+
+void start_time(void)
+{
+  cprev   = dclock();
+  runtime = 0.0;
+}
+
+void update_time(void)
+{
+  double c;
+
+  c        = dclock();
+  runtime += (c-cprev);
+  cprev    = c;
+}
+#else
 static clock_t cprev;
 
 void start_time(void)
@@ -493,7 +516,7 @@ void update_time(void)
   runtime += (c-cprev)/(double)CLOCKS_PER_SEC;
   cprev    = c;
 }
-
+#endif
 double node_time(void)
 {
   return runtime;
index 55831a5cae5e24854bc34dbceea31f8879588a80..c415e230cb9951f545cf5e8b0b7cf6d03f51eae4 100644 (file)
@@ -45,6 +45,7 @@
 #include "gmx_fatal.h"
 #include "main.h"
 #include "vsite.h"
+#include "mdrun.h"
 
 static void split_ilist(FILE *log,t_ilist *il,t_commrec *cr)
 {
index f63d423c63caf0ec1612f18a9c3b457187225068..11c7ffc80548dd9c7ad0636ff395939092653b2d 100644 (file)
@@ -43,7 +43,7 @@
 #include "string2.h"
 #include "force.h"
 #include "smalloc.h"
-#include "wnblist.h"
+#include "ns.h"
 #include "nrnb.h"
 #include "gmx_fatal.h"
 #include "macros.h"
diff --git a/src/mdlib/wnblist.h b/src/mdlib/wnblist.h
deleted file mode 100644 (file)
index 95803ed..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * 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 must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * GROwing Monsters And Cloning Shrimps
- */
-
-#ifndef _wnblist_h
-#define _wnblist_h
-
-#include "stdio.h"
-#include "typedefs.h"
-
-extern void dump_nblist(FILE *out,t_commrec *cr,t_forcerec *fr,int nDNL);
-
-extern int read_nblist(FILE *in,FILE *out,int **mat,int natoms,bool bSymm);
-/* Returns total number of neighbors. If bSymm the matrix is symmetrized. */
-
-#endif /* _wnblist_h */
index 84d95afce4d142b75600dc8c27ee9bc14ed8e6d5..7ac969296e878f6412575afacc6c96fa799b6d46 100644 (file)
@@ -85,7 +85,14 @@ static void shell_comm(char *title,char *script,int nsleep)
 #ifdef DEBUG
   fprintf(stderr,"command: %s\n",command);
 #endif
+
+#ifdef GMX_NO_SYSTEM
+  printf("Warning-- No calls to system(3) supported on this platform.");
+  printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
+#else
   system(command);
+#endif
+
 #ifdef DEBUG
   unlink(tmp)
 #endif
index 540405999a81d2bc23f1064c6128c72a54fe3913..b2835d5544886691f59743accab2d2951d7aee05 100644 (file)
@@ -67,7 +67,13 @@ static void dump_xw(char *dispname,Window w,char *fn)
   char comm[256];
   
   sprintf(comm,"xwd -id %d -display %s > %s",(int)w,dispname,fn);
+
+#ifdef GMX_NO_SYSTEM
+  printf("Warning-- No calls to system(3) supported on this platform.");
+  printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
+#else
   system(comm);
+#endif
 }
 
 static void dump_it(t_manager *man)
index d7c46bd62600750187e85fc9399c66bbddd36324..e9b07ef18cefe7b049998dfaa99c5d94ba4c437a 100644 (file)
@@ -103,7 +103,14 @@ static void ApplCallback(t_x11 *x11,int dlg_mess,int item_id,
     }
     strcat(doit," &");
     fprintf(stderr,"Going to exec: '%s'\n",doit);
+
+#ifdef GMX_NO_SYSTEM
+    printf("Warning-- No calls to system(3) supported on this platform.");
+    printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
+#else
     system(doit);
+#endif
+
     HideDlg(data->appl);
   }
   else if (strcasecmp(set,"Cancel") == 0) {
index 3d760abdb7c1935622116fa2e00636ade10fccf1..8868d96b72ea337d7ce6e16a5c96f8ed6cfca10b 100644 (file)
@@ -50,7 +50,6 @@
 #include "mdatoms.h"
 #include "nrnb.h"
 #include "ns.h"
-#include "../mdlib/wnblist.h"
 
 static real box_margin;
 
@@ -300,7 +299,7 @@ void do_nsgrid(FILE *fp,bool bVerbose,
                    TRUE,FALSE);
 
   if (debug)
-    dump_nblist(debug,fr,0);
+    dump_nblist(debug,cr,fr,0);
 
   if (bVerbose)    
     fprintf(stderr,"Succesfully made neighbourlist\n");
index 0e7bad98415ffda768b565097e302f7b748a9d7d..bb379a59cb891effdb628b33e7a9d2698707a87d 100644 (file)
@@ -14,5 +14,7 @@ typedef struct {
 extern correl_t *init_correl(int n);
 extern void done_correl(correl_t *c);
 
+extern void correl(real data1[],real data2[],int n,real ans[]);
+extern void four1(real data[],int nn,int isign);
 
 #endif
index 7f7938d690af62c99fc54ded3bca9197c2e3dd2f..c9fd790c4bdf9538b120b98d9bc44d43dd5e8f15 100644 (file)
@@ -495,7 +495,14 @@ int main(int argc,char *argv[])
     rewind(tapeout);
 #else
     fclose(tapein);
+
+#ifdef GMX_NO_SYSTEM
+    printf("Warning-- No calls to system(3) supported on this platform.");
+    printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
+#else
     system(dssp);
+#endif
+
 #endif
     strip_dssp(tmpfile,nres,bPhbres,t,
               accr[nframe],fTArea,&mat,average_area);
index ffd6432678aace1ac52b104a53adba931e562669..0d9b9fd614ba94b707bd8b7daff456ea4693cb00 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <string.h>
 #include <math.h>
+#include <ctype.h>
 
 #include "typedefs.h"
 #include "gmx_fatal.h"
@@ -129,7 +130,7 @@ static int *select_by_name(int nre,char *nm[],int *nset)
   int  *set;
   bool bEOF,bVerbose = TRUE;
   char *ptr,buf[STRLEN];
-  char **newnm;
+  char **newnm=NULL;
   
   if ((getenv("VERBOSE")) != NULL)
     bVerbose = FALSE;
@@ -140,26 +141,27 @@ static int *select_by_name(int nre,char *nm[],int *nset)
   fprintf(stderr,"End your selection with an empty line or a zero.\n");
   fprintf(stderr,"---------------------------------------------------------\n");
   
-  if ( bVerbose ) {
-    nlen = 0;
-    snew(newnm,nre);
-    for(i=0; (i<nre); i++) {
-      newnm[i] = strdup(nm[i]);
-      nlen = max(nlen,strlen(newnm[i]));
-    }
-    kk = max(1,80/(nlen+4));
-    sprintf(buf,"%%-3d %%-%ds ",nlen);
-    for(k=0; (k<nre); ) {
-      for(j=0; (j<kk) && (k<nre); j++,k++) {
-       /* Insert dashes in all the names */
-       while ((ptr = strchr(newnm[k],' ')) != NULL)
-         *ptr='-';
+  nlen = 0;
+  snew(newnm,nre);
+  for(i=0; (i<nre); i++) {
+    newnm[i] = strdup(nm[i]);
+    nlen = max(nlen,strlen(newnm[i]));
+  }
+  kk = max(1,80/(nlen+4));
+  sprintf(buf,"%%-3d %%-%ds ",nlen);
+  for(k=0; (k<nre); ) {
+    for(j=0; (j<kk) && (k<nre); j++,k++) {
+      /* Insert dashes in all the names */
+      while ((ptr = strchr(newnm[k],' ')) != NULL)
+       *ptr='-';
+      if ( bVerbose ) 
        fprintf(stderr,buf,k+1,newnm[k]);
-      }
-      fprintf(stderr,"\n");
     }
-    fprintf(stderr,"\n");
+    if ( bVerbose ) 
+      fprintf(stderr,"\n");
   }
+  if ( bVerbose ) 
+    fprintf(stderr,"\n");
   
   snew(bE,nre);
   
index f295775bb2baa7515cf2b9fe39795e5bd86c13f1..6a6ca6373ffb24f72fbeb57e657077182f4b44d1 100644 (file)
@@ -494,7 +494,7 @@ int return_atom_type (char *name)
   };
   int i;
 
-  for(i-0; (i<asize(uh)); i++) 
+  for(i=0; (i<asize(uh)); i++) 
     if (strcmp(name,uh[i].name) == 0)
       return NCMT-1+uh[i].nh;
       
index 39624a4993b57be7872af4823bc974b425844bf6..36c50be02158dd1e8c13ad77d505bf6c46afbf8c 100644 (file)
@@ -241,7 +241,7 @@ void sas_plot(int nfile,t_filenm fnm[],real solsize,int ndots,
   real         *radius,*dgs_factor=NULL,*area=NULL,*surfacedots=NULL;
   real         at_area,*atom_area=NULL,*atom_area2=NULL;
   real         *res_a=NULL,*res_area=NULL,*res_area2=NULL;
-  real         totarea,totvolume,totmass,density,harea,tarea,fluc2;
+  real         totarea,totvolume,totmass=0,density,harea,tarea,fluc2;
   atom_id      **index,*findex;
   int          *nx,nphobic,npcheck,retval;
   char         **grpname,*fgrpname;
index 91731cafd072948f95c54b4117a53d3c8a7a4572..ce54fb953b93ea793bed6e2b6ce8e732e262b0eb 100644 (file)
@@ -379,13 +379,13 @@ void do_trunc(char *fn, real t0)
   check_trn(fn);
   
   in   = open_trn(fn,"r");
-  fp   = fio_getfp(in);
+  fp   = gmx_fio_getfp(in);
   if (fp == NULL) {
     fprintf(stderr,"Sorry, can not trunc %s, truncation of this filetype is not supported\n",fn);
     close_trn(in);
   } else {
     j    = 0;
-    fpos = fio_ftell(in);
+    fpos = gmx_fio_ftell(in);
     bStop= FALSE;
     while (!bStop && fread_trnheader(in,&sh,&bOK)) {
       fread_htrn(in,&sh,NULL,NULL,NULL,NULL);
@@ -993,7 +993,7 @@ int gmx_trjconv(int argc,char *argv[])
       }
       
       if (ftp == efG87)
-       fprintf(fio_getfp(trxout),"Generated by %s. #atoms=%d, a BOX is"
+       fprintf(gmx_fio_getfp(trxout),"Generated by %s. #atoms=%d, a BOX is"
                " stored in this file.\n",Program(),nout);
     
       /* Start the big loop over frames */
@@ -1300,7 +1300,12 @@ int gmx_trjconv(int argc,char *argv[])
              char c[255];
              sprintf(c,"%s  %d",exec_command,file_nr-1);
              /*fprintf(stderr,"Executing '%s'\n",c);*/
+#ifdef GMX_NO_SYSTEM
+              printf("Warning-- No calls to system(3) supported on this platform.");
+              printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
+#else
              system(c);
+#endif
            }
            outframe++;
          }