From 064393d5ac0802dc79efa35c5443130708aad511 Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 16 Nov 2004 10:53:02 +0000 Subject: [PATCH] last fixes + removed debug messages --- nlsop_client.c | 50 ++++++++------------------------------------------ nlsop_server.c | 21 +-------------------- 2 files changed, 9 insertions(+), 62 deletions(-) diff --git a/nlsop_client.c b/nlsop_client.c index 201c48c..9718270 100644 --- a/nlsop_client.c +++ b/nlsop_client.c @@ -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 ... */ diff --git a/nlsop_server.c b/nlsop_server.c index 353979b..5a627db 100644 --- a/nlsop_server.c +++ b/nlsop_server.c @@ -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", -- 2.39.2