]> hackdaworld.org Git - physik/nlsop.git/commitdiff
last fixes + removed debug messages
authorhackbard <hackbard>
Tue, 16 Nov 2004 10:53:02 +0000 (10:53 +0000)
committerhackbard <hackbard>
Tue, 16 Nov 2004 10:53:02 +0000 (10:53 +0000)
nlsop_client.c
nlsop_server.c

index 201c48c63181c53c15d9da51022de4a1d128e054..9718270fcfa7a7a67c2e53eb5c612052faeea288 100644 (file)
@@ -305,49 +305,15 @@ u32 get_reject_graph(info *my_info,d3_lattice *d3_l,char *file,u32 *graph) {
 void send_data(int signum) {
 
   int c;
-  unsigned char data;
-  int fd;
 
   c=gd3_l->max_x*gd3_l->max_y*gd3_l->max_z;
 
-  printf("%d <-\n",c);
-
-  network_send(gnet->connection[0].fd,&dc,1);
-  network_receive(gnet->connection[0].fd,&data,sizeof(unsigned char));
-  printf("debug: sent dc\n");
-
-  network_send(gnet->connection[0].fd,(unsigned char *)gd3_l,
-               sizeof(d3_lattice));
-  network_receive(gnet->connection[0].fd,&data,sizeof(unsigned char));
-  printf("debug: sent d3_lattice\n");
-
-  network_send(gnet->connection[0].fd,(unsigned char *)gmy_info,sizeof(info));
-  network_receive(gnet->connection[0].fd,&data,sizeof(unsigned char));
-  printf("debug: sent info\n");
-
-  network_send(gnet->connection[0].fd,gd3_l->status,c*sizeof(unsigned char));
-  network_receive(gnet->connection[0].fd,&data,sizeof(unsigned char));
-  printf("debug: sent ac\n");
-
-  network_send(gnet->connection[0].fd,(unsigned char *)gd3_l->extra,
-               c*sizeof(int));
-  network_receive(gnet->connection[0].fd,&data,sizeof(unsigned char));
-  printf("debug: sent cc\n");
-
-  network_send(gnet->connection[0].fd,(unsigned char *)gi,sizeof(int));
-  network_receive(gnet->connection[0].fd,&data,sizeof(unsigned char));
-  printf("debug: sent steps\n");
-
-  if(signum==121) {
-    printf("save test file\n");
-    fd=open("./test.save",O_WRONLY|O_CREAT);
-    write(fd,gd3_l,sizeof(d3_lattice));
-    write(fd,gmy_info,sizeof(info));
-    write(fd,gd3_l->status,c*sizeof(unsigned char));
-    write(fd,gd3_l->extra,c*sizeof(int));
-    close(fd);
-  }
-
+  network_send_chan(gnet,0,&dc,1);
+  network_send_chan(gnet,0,(unsigned char *)gd3_l,sizeof(d3_lattice));
+  network_send_chan(gnet,0,(unsigned char *)gmy_info,sizeof(info));
+  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));
 }
 
 
@@ -566,7 +532,7 @@ int get_data_and_calc(t_event *event,void *allineed) {
     i++;
     if(i%my_info.save_rate==0) {
       dc=DC_OK;
-      send_data(120);
+      send_data(0);
       dc=DC_QUIT;
     }
     if(i%my_info.s_rate==0) sputter(&d3_l);
@@ -574,7 +540,7 @@ int get_data_and_calc(t_event *event,void *allineed) {
 
   /* finished */
   dc=DC_END;
-  send_data(121);
+  send_data(0);
   dc=DC_QUIT;
 
   /* shutdown/free/close everything now ... */
index 353979bc3c2b43be36747183b8bfb315e5d919d2..5a627db66a5aef274d34a71e555509fd0de995ca 100644 (file)
@@ -129,38 +129,19 @@ int save_job(unsigned char dc) {
   int ret;
   d3_lattice d3l;
   info info;
-  unsigned char data;
   t_job *j;
 
   j=(t_job *)priv.job.current->data;
 
-  printf("receiving data from client (%d)\n",j->size);
-  data=DATA_OK;
-
-  /* initial data_ok to start transmit on client */
-  network_send_chan(&(priv.net),gi,&data,sizeof(unsigned char));
+  printf("receiving data from client (#cells=%d)\n",j->size);
 
   network_receive_chan(&(priv.net),gi,(unsigned char *)&d3l,
                        sizeof(d3_lattice));
-  network_send_chan(&(priv.net),gi,&data,sizeof(unsigned char));
-  printf("debug: got d3_lattice\n");
-
   network_receive_chan(&(priv.net),gi,(unsigned char *)&info,sizeof(info));
-  network_send_chan(&(priv.net),gi,&data,sizeof(unsigned char));
-  printf("debug: got info\n");
-
   network_receive_chan(&(priv.net),gi,j->ac,j->size*sizeof(unsigned char));
-  network_send_chan(&(priv.net),gi,&data,sizeof(unsigned char));
-  printf("debug: got ac\n");
-
   network_receive_chan(&(priv.net),gi,(unsigned char *)j->cc,
                        j->size*sizeof(int));
-  network_send_chan(&(priv.net),gi,&data,sizeof(unsigned char));
-  printf("debug: got cc\n");
-
   network_receive_chan(&(priv.net),gi,(unsigned char *)&(j->step),sizeof(int));
-  network_send_chan(&(priv.net),gi,&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",