pthread imp started for orig albe (more easier in the beginning)
[physik/posic.git] / potentials / albe.c
index 08ce4fa..b00e173 100644 (file)
@@ -176,8 +176,12 @@ int albe_mult_3bp_j1(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {
 }
 
 /* albe 3 body potential function (first k loop) */
+#ifdef PTHREADS
+void *albe_mult_3bp_k1(void *ptr) {
+#else
 int albe_mult_3bp_k1(t_moldyn *moldyn,
                      t_atom *ai,t_atom *aj,t_atom *ak,u8 bc) {
+#endif
 
        t_albe_mult_params *params;
        t_albe_exchange *exchange;
@@ -188,6 +192,19 @@ int albe_mult_3bp_k1(t_moldyn *moldyn,
        double cos_theta,h_cos,d2_h_cos2,frac,g,dg,s_r,arg;
        double f_c_ik,df_c_ik;
        int kcount;
+#ifdef PTHREADS
+       t_kdata *kdata;
+       t_moldyn *moldyn;
+       t_atom *ai,*aj,*ak;
+       u8 bc;
+
+       kdata=ptr;
+       moldyn=kdata->moldyn;
+       ai=kdata->ai;
+       aj=kdata->aj;
+       ak=kdata->ak;
+       bc=kdata->bc;
+#endif
 
        params=moldyn->pot_params;
        exchange=&(params->exchange);
@@ -281,8 +298,12 @@ int albe_mult_3bp_k1(t_moldyn *moldyn,
        /* increase k counter */
        exchange->kcount++;
 
+#ifdef PTHREADS
+}
+#else
        return 0;
 }
+#endif
 
 int albe_mult_3bp_j2(t_moldyn *moldyn,t_atom *ai,t_atom *aj,u8 bc) {