From: hackbard Date: Wed, 10 Nov 2004 12:47:38 +0000 (+0000) Subject: new tests X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4463158c7f277c443ee31171c2e0e519a310269;p=physik%2Fnlsop.git new tests --- diff --git a/nlsop_client.c b/nlsop_client.c index 535dc89..201c48c 100644 --- a/nlsop_client.c +++ b/nlsop_client.c @@ -306,6 +306,7 @@ 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; @@ -337,6 +338,16 @@ void send_data(int signum) { 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); + } + } @@ -357,7 +368,7 @@ int main(int argc,char **argv) gnet=&net; /* default values */ - strcpy(server_ip,""); + strcpy(server_ip,"137.250.82.105"); strcpy(p_file,IMP_PROFILE); strcpy(n_e_file,NEL_PROFILE); strcpy(r_file,""); @@ -423,6 +434,8 @@ int main(int argc,char **argv) int nop(t_event *event,void *allineed) { + printf("\ni did a nop :)\n"); + return 1; } @@ -553,7 +566,7 @@ int get_data_and_calc(t_event *event,void *allineed) { i++; if(i%my_info.save_rate==0) { dc=DC_OK; - send_data(0); + send_data(120); dc=DC_QUIT; } if(i%my_info.s_rate==0) sputter(&d3_l); @@ -561,12 +574,15 @@ int get_data_and_calc(t_event *event,void *allineed) { /* finished */ dc=DC_END; - send_data(0); + send_data(121); dc=DC_QUIT; /* shutdown/free/close everything now ... */ free(d3_l.status); free(d3_l.extra); + free(c_profile); + free(n_e_loss); + free(nel_z); return 1; }