X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fnlsop.git;a=blobdiff_plain;f=nlsop_server.c;h=4f02c1f483bafee45b4dc3d149fbb89b246d5b26;hp=1fa3135dfabd3319b2cbdfc43606ee179ed0a5c5;hb=520f56881396deed5206591ccc09f8734db8cc6b;hpb=d7dbaf20818533d5c2ed93907da01859e3a786bf diff --git a/nlsop_server.c b/nlsop_server.c index 1fa3135..4f02c1f 100644 --- a/nlsop_server.c +++ b/nlsop_server.c @@ -129,18 +129,25 @@ int save_job(t_net *net,int channel,t_job *job,unsigned char dc) { printf("receiving data from client (%d)\n",job->size); data=DATA_OK; + ret=network_receive_chan(net,channel,&d3l,sizeof(d3_lattice)); + network_send_chan(net,channel,&data,sizeof(unsigned char)); + printf("debug: got d3_lattice\n"); + + ret=network_receive_chan(net,channel,&info,sizeof(info)); + network_send_chan(net,channel,&data,sizeof(unsigned char)); + printf("debug: got info\n"); + 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"); @@ -154,16 +161,12 @@ int save_job(t_net *net,int channel,t_job *job,unsigned char dc) { return -1; } - memset(&d3l,0,sizeof(d3_lattice)); - d3l.max_x=job->x; - d3l.max_y=job->y; - d3l.max_z=job->z; if(write(fd,&d3l,sizeof(d3_lattice))info),sizeof(info))status=IDLE; + /* free job memory */ + free(j->ac); + free(j->cc); /* delete job entry */ list_del_current(job); printf("job ended, saved and removed from list.\n"); @@ -371,7 +377,7 @@ int distribute_jobs(t_event *event,void *allineed) { if(j->status==IN_QUEUE) count_j++; } while(list_next(c_list)!=L_NO_NEXT_ELEMENT) { - if(j->status==IN_QUEUE) count_j++; + c=(t_client *)c_list->current->data; if(c->status==IDLE) count_c++; }