]> hackdaworld.org Git - physik/nlsop.git/commitdiff
send ack after data send, clear status and concentartion buffer at start
authorhackbard <hackbard>
Mon, 7 Feb 2005 16:05:19 +0000 (16:05 +0000)
committerhackbard <hackbard>
Mon, 7 Feb 2005 16:05:19 +0000 (16:05 +0000)
nlsop_client.c

index 0d52f942d74eb2fd69fc8d5970708311e3d0ba3c..8a1c81c72f48aecf44771a577db60a463bb8adb7 100644 (file)
@@ -311,6 +311,7 @@ u32 get_reject_graph(info *my_info,d3_lattice *d3_l,char *file,u32 *graph) {
 void send_data(int signum) {
 
   int c;
+  unsigned char ack=DATA_OK;
 
   c=gd3_l->max_x*gd3_l->max_y*gd3_l->max_z;
 
@@ -320,6 +321,7 @@ void send_data(int signum) {
   network_send_chan(gnet,0,gd3_l->status,c*sizeof(unsigned char));
   network_send_chan(gnet,0,(unsigned char *)gd3_l->extra,c*sizeof(int));
   network_send_chan(gnet,0,(unsigned char *)gi,sizeof(int));
+  network_send_chan(gnet,0,&ack,sizeof(unsigned char));
 
   if(dc==DC_QUIT) shut_down=1;
 }
@@ -474,6 +476,11 @@ int get_data_and_calc(t_event *event,void *allineed) {
                       sizeof(int));
       network_send(net->connection[0].fd,&data,sizeof(unsigned char));
     }
+    if(c_step==0) {
+      printf("important: clear status/conc data!\n");
+      memset(d3_l.status,0,j*sizeof(unsigned char));
+      memset(d3_l.extra,0,j*sizeof(int));
+    }
   }
   else {
     printf("unknown instruction, restarting ...\n");