*/
-/* we need this for all the data types */
+/* we need this for all the data types. We use WIN32_LEAN_AND_MEAN to avoid
+ polluting the global namespace. */
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
/*! \brief Status for one-time initialization of thread stuff.
*
#endif
} t_disresdata;
+
/* Orientation restraining stuff */
typedef struct {
real fc; /* Force constant for the restraints */
void push_ps(FILE *fp)
{
+ t_pstack *ps;
+
#ifdef GMX_THREADS
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
- t_pstack *ps;
snew(ps,1);
ps->fp = fp;
void ffclose(FILE *fp)
{
+ t_pstack *ps,*tmp;
#ifdef GMX_THREADS
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
- t_pstack *ps,*tmp;
ps=pstack;
if (ps == NULL) {
void frewind(FILE *fp)
{
+ t_pstack *ps;
#ifdef GMX_THREADS
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
- t_pstack *ps;
ps=pstack;
while (ps != NULL) {
bool is_pipe(FILE *fp)
{
+ t_pstack *ps;
#ifdef GMX_THREADS
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
- t_pstack *ps;
ps=pstack;
while (ps != NULL) {
{
char buf[10240],tmpbuf[1024];
int cqnum;
+ const char *llines = "-------------------------------------------------------";
#ifdef GMX_THREADS
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
/* protect the audience from suggestive discussions */
- const char *lines = "-------------------------------------------------------";
cool_quote(tmpbuf,1023,&cqnum);
sprintf(buf,"\n%s\nProgram %s, %s\n"
"Source code file: %s, line: %d\n\n"
"%s:\n%s\nFor more information and tips for trouble shooting please check the GROMACS Wiki at\n"
"http://wiki.gromacs.org/index.php/Errors\n%s\n\n%s\n",
- lines,ShortProgram(),GromacsVersion(),file,line,
- gmx_strerror(key),msg ? msg : warn_buf,lines,tmpbuf);
+ llines,ShortProgram(),GromacsVersion(),file,line,
+ gmx_strerror(key),msg ? msg : warn_buf,llines,tmpbuf);
#ifdef GMX_THREADS
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
{
int n;
- if(bufsize<(strlen(base)+4))
+ if((size_t)bufsize<(strlen(base)+4))
gmx_mem("Character buffer too small!");
/* Copy to buf, and strip extension */
char *pa_val(t_pargs *pa, char buf[], int sz)
{
- char buf_str[1256]; buf_str[0]='\0';
real r;
+ char buf_str[1256]; buf_str[0]='\0';
buf[0]='\0';
break;
case etSTR:
if (*(pa->u.c)) {
- if (strlen(*(pa->u.c)) >= sz)
+ if (strlen(*(pa->u.c)) >= (size_t)sz)
gmx_fatal(FARGS,"Argument too long: \"%d\"\n",*(pa->u.c));
else
strcpy(buf,*(pa->u.c));
{
int len,i;
- if(strlen(s)>maxlen-1)
+ if(strlen(s)>(size_t)(maxlen-1))
gmx_fatal(FARGS,"Character buffer size too small\n");
for (; (*s)&&((*s)==' '); s++);
#include "thread_mpi/threads.h"
+#include "thread_mpi/atomic.h"
/*! \brief System mutex for all one-time initialization
*
* independent of the thread library implementation. Anyway, it
* will only be locked a handful of times at the start of program execution.
*/
+/*
enum tMPI_Thread_once_status tMPI_Thread_system_lock_state=
TMPI_THREAD_ONCE_STATUS_NOTCALLED;
static CRITICAL_SECTION tMPI_Thread_system_lock;
-
+*/
+tMPI_Spinlock_t tMPI_Thread_system_lock=TMPI_SPINLOCK_INITIALIZER;
void tMPI_Fatal_error(const char *file, int line, const char *message, ...)
*/
/* Lock the common one-time init mutex so we can check carefully */
- EnterCriticalSection( &tMPI_Thread_system_lock );
+ /*EnterCriticalSection( &tMPI_Thread_system_lock );*/
+ tMPI_Spinlock_lock( &tMPI_Thread_system_lock );
#if 0
ret = 0;
}
- LeaveCriticalSection( &tMPI_Thread_system_lock );
+ /*LeaveCriticalSection( &tMPI_Thread_system_lock );*/
+ tMPI_Spinlock_unlock( &tMPI_Thread_system_lock );
return ret;
}
* the memory barriers right. Trust me, you don't want a deadlock here...
*/
/* Lock the common one-time init mutex so we can check carefully */
- EnterCriticalSection( &tMPI_Thread_system_lock );
+ /*EnterCriticalSection( &tMPI_Thread_system_lock );*/
+ tMPI_Spinlock_lock( &tMPI_Thread_system_lock );
/* Do the actual (locked) check - system mutex is locked if we get here */
if (cond->init_state != TMPI_THREAD_ONCE_STATUS_READY)
{
{
ret = 0;
}
- LeaveCriticalSection( &tMPI_Thread_system_lock );
-
+ /*LeaveCriticalSection( &tMPI_Thread_system_lock );*/
+ tMPI_Spinlock_lock( &tMPI_Thread_system_lock );
return ret;
}
* the memory barriers right. Trust me, you don't want a deadlock here...
*/
/* Lock the common one-time init mutex so we can check carefully */
- EnterCriticalSection( &tMPI_Thread_system_lock );
+ /*EnterCriticalSection( &tMPI_Thread_system_lock );*/
+ tMPI_Spinlock_lock( &tMPI_Thread_system_lock );
/* Do the actual (locked) check - system mutex is locked if we get here */
if (barrier->init_state != TMPI_THREAD_ONCE_STATUS_READY)
{
{
ret = 0;
}
- LeaveCriticalSection( &tMPI_Thread_system_lock );
+ /*LeaveCriticalSection( &tMPI_Thread_system_lock );*/
+ tMPI_Spinlock_lock( &tMPI_Thread_system_lock );
return ret;
}
temp=NWR(desc[i]);
else
temp=check_tty(desc[i]);
- if (strlen(buf) + strlen(temp) >= buflen-2) {
+ if (strlen(buf) + strlen(temp) >= (size_t)(buflen-2)) {
buflen += strlen(temp);
srenew(buf,buflen);
}
strcpy(atombuf,*(atoms->atomname[a]));
if (isdigit(atombuf[0])) {
c = atombuf[0];
- for (i=0; (i<strlen(atombuf)-1); i++)
+ for (i=0; ((size_t)i<strlen(atombuf)-1); i++)
atombuf[i]=atombuf[i+1];
atombuf[i]=c;
}
real change_limit = 0.1;
real relax = 0.5;
bool bPBC;
+ int range[] = { 0, 0 };
comm = dd->comm;
}
}
}
- int range[] = { 0, ncd };
+ range[1]=ncd;
root->cell_f[0] = 0;
root->cell_f[ncd] = 1;
dd_cell_sizes_dlb_root_enforce_limits(dd, d, dim, root, ddbox, bUniform, step, cellsize_limit_f, range);
}
+
void do_gkr(t_gkrbin *gb,int ncos,int *ngrp,int *molindex[],
int mindex[],rvec x[],rvec mu[],
int ePBC,matrix box,t_atom *atom,int *nAtom)
const char * __file__; /* declared versions of macros */
int __line__; /* __FILE__ and __LINE__ */
+#ifdef ERROR
+#undef ERROR
+#endif
#define ERROR UPDATE_FL,error
void error(const char *fmt, ...) {
va_list args;