#ifdef PTHREADS
#include <pthread.h>
-#define MAX_THREADS 4
+#define MAX_THREADS 2
#endif
#include "../moldyn.h"
* virial calculation
*/
-#define albe_v_calc(a,f,d) a->virial.xx+=f->x*d->x; \
- a->virial.yy+=f->y*d->y; \
- a->virial.zz+=f->z*d->z; \
- a->virial.xy+=f->x*d->y; \
- a->virial.xz+=f->x*d->z; \
- a->virial.yz+=f->y*d->z
+#define albe_v_calc(a,f,d) (a)->virial.xx+=(f)->x*(d)->x; \
+ (a)->virial.yy+=(f)->y*(d)->y; \
+ (a)->virial.zz+=(f)->z*(d)->z; \
+ (a)->virial.xy+=(f)->x*(d)->y; \
+ (a)->virial.xz+=(f)->x*(d)->z; \
+ (a)->virial.yz+=(f)->y*(d)->z
#ifndef PTHREADS
v3_add(&(jtom->f),&(jtom->f),&force);
/* virial */
- virial_calc(ai,&force,&(dist_ij));
+ albe_v_calc(ai,&force,&(dist_ij));
+ //virial_calc(ai,&force,&(dist_ij));
#ifdef DEBUG
if(moldyn->time>DSTART&&moldyn->time<DEND) {
#endif
/* virial */
- virial_calc(ai,&force,&dist_ij);
+ albe_v_calc(ai,&force,&dist_ij);
+ //virial_calc(ai,&force,&dist_ij);
/* force contribution to atom i */
v3_scale(&force,&force,-1.0);
#endif
/* virial */
- virial_calc(ai,&force,&dist_ik);
+ albe_v_calc(ai,&force,&dist_ik);
+ //virial_calc(ai,&force,&dist_ik);
/* force contribution to atom i */
v3_scale(&force,&force,-1.0);
/* virial */
pthread_mutex_lock(&(amutex[ai->tag]));
- virial_calc(ai,&force,&(dist_ij));
+ albe_v_calc(ai,&force,&(dist_ij));
+ //virial_calc(ai,&force,&(dist_ij));
pthread_mutex_unlock(&(amutex[ai->tag]));
#ifdef DEBUG
/* virial */
pthread_mutex_lock(&(amutex[ai->tag]));
- virial_calc(ai,&force,&dist_ij);
+ albe_v_calc(ai,&force,&dist_ij);
+ //virial_calc(ai,&force,&dist_ij);
/* force contribution to atom i */
v3_scale(&force,&force,-1.0);
/* virial */
pthread_mutex_lock(&(amutex[ai->tag]));
- virial_calc(ai,&force,&dist_ik);
+ albe_v_calc(ai,&force,&dist_ik);
+ //virial_calc(ai,&force,&dist_ik);
/* force contribution to atom i */
v3_scale(&force,&force,-1.0);
/* prepare thread data */
pft_data[j].moldyn=moldyn;
- pft_data[j].start=j*count/MAX_THREADS;
+ pft_data[j].start=j*(count/MAX_THREADS);
if(j==MAX_THREADS-1) {
pft_data[j].end=count;
}