]> hackdaworld.org Git - physik/nlsop.git/commitdiff
network related fixes + debug printfs (will get removed)
authorhackbard <hackbard>
Mon, 8 Nov 2004 23:31:46 +0000 (23:31 +0000)
committerhackbard <hackbard>
Mon, 8 Nov 2004 23:31:46 +0000 (23:31 +0000)
nlsop_server.c

index 71eabf6520d07eeac6ca48d3301faf90339aa825..1fa3135dfabd3319b2cbdfc43606ee179ed0a5c5 100644 (file)
@@ -124,15 +124,25 @@ int save_job(t_net *net,int channel,t_job *job,unsigned char dc) {
   int ret;
   d3_lattice d3l;
   info info;
+  unsigned char data;
+
+  printf("receiving data from client (%d)\n",job->size);
+  data=DATA_OK;
 
   ret=network_receive_chan(net,channel,job->ac,job->size*sizeof(unsigned char));
   if(ret==N_ERROR) printf("FATAL: getting ac status failed\n");
+  network_send_chan(net,channel,&data,sizeof(unsigned char));
+  printf("debug: got ac\n");
   ret=network_receive_chan(net,channel,(unsigned char *)job->cc,
                            job->size*sizeof(int));
   if(ret==N_ERROR) printf("FATAL: getting cc failed\n");
+  network_send_chan(net,channel,&data,sizeof(unsigned char));
+  printf("debug: got cc\n");
   ret=network_receive_chan(net,channel,(unsigned char *)&(job->step),
                            sizeof(int));
   if(ret==N_ERROR) printf("FATAL: getting step number failed\n");
+  network_send_chan(net,channel,&data,sizeof(unsigned char));
+  printf("debug: got steps\n");
 
   if(dc!=DC_QUIT) {
     snprintf(filename,128,"./data/nlsop_b%f_c%f_s%f_ds%d_dr%f_-_%d_of_%d.save",
@@ -369,7 +379,7 @@ int distribute_jobs(t_event *event,void *allineed) {
 
   if(min!=0) {
     printf("d: distributing jobs ...\n");
-    printf("%d queued jobs, %d idle clients\n",count_j,count_c);
+    printf("%d queued jobs, %d idle clients\n\n",count_j,count_c);
   }
 
   list_reset(job);
@@ -405,8 +415,12 @@ int distribute_jobs(t_event *event,void *allineed) {
 
     if(data==NLSOP_CJOB) {
       network_send_chan(net,c->channel,j->ac,j->size*sizeof(unsigned char));
+      network_receive_chan(net,c->channel,&data,sizeof(unsigned char));
       network_send_chan(net,c->channel,(unsigned char *)&(j->cc),
                         j->size*sizeof(int));
+      network_receive_chan(net,c->channel,&data,sizeof(unsigned char));
+      network_send_chan(net,c->channel,(unsigned char *)&(j->step),sizeof(int));
+      network_receive_chan(net,c->channel,&data,sizeof(unsigned char));
     }
 
     --min;