Log In
New Account
  
 
Home My Page Project Tree Code Snippets Project Openings NUTSS
 
 
Summary Tracker Lists CVS Files
 

CVS | Administration

Diff for /libnutss/examples/slinks_variable_load.c between versions 1.10 and 1.11

version 1.10, 2007/06/01 17:05:38 version 1.11, 2007/06/04 23:04:00
Line 13 Line 13
 #define snprintf   _snprintf  #define snprintf   _snprintf
 #endif  #endif
   
#define assert(p) if(!(p))exit(1)#define assert(p) if(!(p)){ printf("Assertion FAILED!\n"); exit(1); }
   
 typedef struct flow {  typedef struct flow {
     int duration;      int duration;
Line 31  void *recvthread(void *arg) { Line 31  void *recvthread(void *arg) {
     socklen_t len = sizeof(peer);      socklen_t len = sizeof(peer);
     flow_t *flows = NULL, *newflow = NULL, *ptr = NULL, *axe = NULL;      flow_t *flows = NULL, *newflow = NULL, *ptr = NULL, *axe = NULL;
     char tmp[128], buf[2048];      char tmp[128], buf[2048];
   int time = 0, load= 0, delta, expiration;    int time = 0, load= 0, busy = 0, delta, expiration;
   
     buf[0] = 0;      buf[0] = 0;
   
     while(time < limit) {      while(time < limit) {
           sleep(1);
           if(busy++ > limit*3) {
               if(s) fprintf(s,"%d HALTING RECEIVING. TOO MUCH WAITING.\n",num);
               pthread_exit(NULL);
           }
         if(swaplinks_recvfrom(swp, tmp, sizeof(tmp), 0, &peer, &len) > 0) {          if(swaplinks_recvfrom(swp, tmp, sizeof(tmp), 0, &peer, &len) > 0) {
             time++; delta = 0;              time++; delta = 0;
             if(s) fprintf(s,"\t\tTIME at node %d: %d\n",num,time);              if(s) fprintf(s,"\t\tTIME at node %d: %d\n",num,time);
Line 88  void *recvthread(void *arg) { Line 93  void *recvthread(void *arg) {
             newflow->next = flows;              newflow->next = flows;
             if(newflow->next) newflow->next->last = newflow;              if(newflow->next) newflow->next->last = newflow;
             flows = newflow;              flows = newflow;
           if(f) fprintf(f,"%d\t%d\t%d\n",time,load,delta);            if(f) fprintf(f,"%d\n",load);
         }          }
     }      }
     if(s) fprintf(s,"%d DONE RECEIVING\n",num);      if(s) fprintf(s,"%d DONE RECEIVING\n",num);

Removed from v.1.10  
changed lines
  Added in v.1.11


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
 

GForge.cis.cornell.edu is brought to you by

Cornell Computing and Information Science


Powered By GForge Collaborative Development Environment