Merge "g_wham: fixed pullx.xvg reading issue with pull_geometry=cylinder" into releas...
authorRossen Apostolov <rossen@kth.se>
Fri, 16 Sep 2011 20:24:23 +0000 (22:24 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 16 Sep 2011 20:24:23 +0000 (22:24 +0200)
src/mdlib/partdec.c

index 6509bd529d3e11cb69550c3a10b43e08ccc1b1d8..7bc23f338d495682f75aa59baea5c8ae9f07f98b 100644 (file)
@@ -552,9 +552,8 @@ init_partdec_constraint(t_commrec *cr,
         }
         pdc->nconstraints = cnt;
         
-        /* This should really be calculated, but 1000 is a _lot_ for overlapping constraints... */
-        snew(pdc->sendbuf,1000);
-        snew(pdc->recvbuf,1000);
+        snew(pdc->sendbuf,max(6*(pd->index[cr->nodeid+1]-pd->constraints->right_range_send),6*(pdc->left_range_send-pd->index[cr->nodeid])));
+        snew(pdc->recvbuf,max(6*(pd->index[cr->nodeid]-pdc->left_range_receive),6*(pdc->right_range_receive-pd->index[cr->nodeid+1])));
         
 }