X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fnlsop.git;a=blobdiff_plain;f=nlsop_client.c;h=c31429908e84350b8f1be4d38d276b1a71af056d;hp=c6358924de5083ac5e82ca2872c3e44db0392de8;hb=5fab9a61a42474f7a0a2e54c5f2163e8fc241ca7;hpb=3d8104a33fb2ddca332dcb5a640885a33195b101 diff --git a/nlsop_client.c b/nlsop_client.c index c635892..c314299 100644 --- a/nlsop_client.c +++ b/nlsop_client.c @@ -72,7 +72,7 @@ int get_data_and_calc(t_event *event,void *allineed); int usage(char *prog) { puts("usage:"); - printf("%s \n",prog); + printf("%s -i ip -p port -r/P/n random/profile/neloss file\n",prog); return 1; } @@ -238,59 +238,6 @@ int distrib_c(d3_lattice *d3_l,info *my_info,int step,u32 rj_m,u32 *rj_g) return 1; } -/* save to file --> send to server :) --> T O D O <-- */ -void send_data(int signum) { - - int c; - - c=gd3_l->max_x*gd3_l->max_y*gd3_l->max_z; - - network_send(gnet->connection[0].fd,&dc,1); - network_send(gnet->connection[0].fd,(unsigned char *)gd3_l, - sizeof(d3_lattice)); - network_send(gnet->connection[0].fd,(unsigned char *)gmy_info,sizeof(info)); - network_send(gnet->connection[0].fd,gd3_l->status,c*sizeof(unsigned char)); - network_send(gnet->connection[0].fd,(unsigned char *)gd3_l->extra, - c*sizeof(int)); - network_send(gnet->connection[0].fd,(unsigned char *)gi,sizeof(int)); - -} - -int save_to_file(char *sf,d3_lattice *d3_l,info *my_inf) -{ - int sf_fd,c; - - if((sf_fd=open(sf,O_WRONLY|O_CREAT))<0) - { - puts("cannot open save file"); - return -1; - } - if(write(sf_fd,d3_l,sizeof(d3_lattice))max_x*d3_l->max_y*d3_l->max_z; - if(write(sf_fd,d3_l->status,c*sizeof(unsigned char))extra,c*sizeof(int))max_x*gd3_l->max_y*gd3_l->max_z; + + network_send(gnet->connection[0].fd,&dc,1); + /* + network_send(gnet->connection[0].fd,(unsigned char *)gd3_l, + sizeof(d3_lattice)); + network_send(gnet->connection[0].fd,(unsigned char *)gmy_info,sizeof(info)); + */ + network_send(gnet->connection[0].fd,gd3_l->status,c*sizeof(unsigned char)); + network_send(gnet->connection[0].fd,(unsigned char *)gd3_l->extra, + c*sizeof(int)); + network_send(gnet->connection[0].fd,(unsigned char *)gi,sizeof(int)); + +} /*