Changeset 2307 for branches/blt4/packages
- Timestamp:
- Jul 10, 2011 5:55:10 PM (13 years ago)
- Location:
- branches/blt4/packages/vizservers
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/packages/vizservers/nanoscale/server.c
r2120 r2307 75 75 _x > _y ? _x : _y; }) 76 76 77 #ifdef notdef78 static int79 find_best_host(void)80 {81 int h;82 float best = load;83 int index = -1;84 //printf("My load is %f\n", best);85 for(h=0; h<sizeof(host_array)/sizeof(host_array[0]); h++) {86 if (host_array[h].in_addr.s_addr == 0)87 continue;88 //printf("%d I think load for %s is %f ", h,89 // inet_ntoa(host_array[h].in_addr), host_array[h].load);90 if (host_array[h].children <= children) {91 if (host_array[h].load < best) {92 //if ((random() % 100) < 75) {93 index = h;94 best = host_array[h].load;95 //}96 //printf(" Better\n");97 } else {98 //printf(" Worse\n");99 }100 }101 }102 103 //printf("I choose %d\n", index);104 return index;105 }106 #endif107 108 static void109 broadcast_load(void)110 {111 int msg[2];112 msg[0] = htonl(load);113 msg[1] = htonl(children);114 int status;115 status = sendto(send_fd, &msg, sizeof(msg), 0, (struct sockaddr *)&send_addr,116 sizeof(send_addr));117 if (status < 0) {118 perror("sendto");119 }120 }121 77 122 78 static void … … 140 96 children, memory_in_use, load); 141 97 142 #ifdef notdef143 broadcast_load();144 #endif145 98 } 146 99 … … 158 111 return; 159 112 } 160 }161 }162 163 static void164 update_load_average(void)165 {166 static unsigned int counter;167 168 load = load / LOAD_DROP_OFF;169 float newload = 0.0;170 int c;171 for(c=0; c < sizeof(child_array)/sizeof(child_array[0]); c++) {172 if (child_array[c].pipefd != 0) {173 newload += child_array[c].requests * child_array[c].memory;174 child_array[c].requests = 0;175 }176 }177 load = load + newload;178 179 if ((counter++ % BROADCAST_INTERVAL) == 0) {180 broadcast_load();181 113 } 182 114 } … … 291 223 server_command[0][0]=='\0') { 292 224 int i; 293 fprintf(stderr, "nservices=%d, recv_port=%d, server_command[0]=%s\n", nservices, recv_port, server_command[0]);294 225 for (i = 0; i < argc; i++) { 295 226 fprintf(stderr, "argv[%d]=(%s)\n", i, argv[i]); … … 399 330 // We're ready to go. Before going into the main loop, 400 331 // broadcast a load announcement to other machines. 401 #ifdef notdef402 broadcast_load();403 #endif404 332 int maxfd = send_fd; 405 333 FD_ZERO(&saved_rfds); … … 428 356 if (status <= 0) { 429 357 if (sigalarm_set) { 430 update_load_average();431 358 sigalarm_set = 0; 432 359 } 433 360 continue; 434 361 } 435 436 362 437 363 int accepted = 0; … … 537 463 int newmemory = ntohl(msg); 538 464 539 #ifdef notdef540 // Find the best host to create a new child on.541 int index = find_best_host();542 543 // Only redirect if another host's load is significantly less544 // than our own...545 if (index != -1 &&546 (host_array[index].load < (LOAD_REDIRECT_FACTOR * load))) {547 548 // If we're redirecting to another machine, give that549 // machine an extra boost in our copy of the load550 // statistics. This will keep us from sending the very551 // next job to it. Eventually, the other machine will552 // broadcast its real load and we can make an informed553 // decision as to who redirect to again.554 host_array[index].load += newmemory * INITIAL_LOAD;555 556 // Redirect to another machine.557 printf("Redirecting to %s\n",558 inet_ntoa(host_array[index].in_addr));559 write(i, &host_array[index].in_addr.s_addr, 4);560 FD_CLR(i, &saved_rfds);561 clear_service_fd(i);562 close(i);563 continue;564 }565 #endif566 465 memory_in_use += newmemory; 567 466 load += 2*INITIAL_LOAD; 568 #ifdef notdef569 broadcast_load();570 #endif571 467 printf("Accepted new job with memory %d\n", newmemory); 572 468 //printf("My load is now %f\n", load); … … 654 550 655 551 children++; 656 broadcast_load();657 552 } 658 553 -
branches/blt4/packages/vizservers/nanovis/Command.cpp
r1982 r2307 785 785 786 786 static Rappture::CmdSpec cutplaneOps[] = { 787 {"position", 1, CutplanePositionOp, 4, 0, " bool axis ?indices?",},788 {"state", 1, CutplaneStateOp, 4, 0, " relval axis ?indices?",},787 {"position", 1, CutplanePositionOp, 4, 0, "relval axis ?indices?",}, 788 {"state", 1, CutplaneStateOp, 4, 0, "bool axis ?indices?",}, 789 789 }; 790 790 static int nCutplaneOps = NumCmdSpecs(cutplaneOps); -
branches/blt4/packages/vizservers/nanovis/ParticleSystem.cpp
r2120 r2307 13 13 #include <GL/glaux.h> 14 14 #else 15 #ifdef notdef 15 16 #include <opencv/cv.h> 16 17 #include <opencv/highgui.h> 18 #endif 17 19 #endif 18 20 -
branches/blt4/packages/vizservers/nanovis/Volume.h
r1510 r2307 117 117 float size, int n_component, float* data, double vmin, double vmax, 118 118 double nonzero_min); 119 ~Volume();119 virtual ~Volume(); 120 120 121 121 public : -
branches/blt4/packages/vizservers/start_viz.sh.in
r2120 r2307 12 12 broadcast=`hostname -i | sed 's/\.[0-9]*$/.255/'` 13 13 14 render_dir="@prefix@" 15 vtk_lib_dir="@VTK_LIB_DIR@" 14 exec_prefix="@exec_prefix@" 15 bindir="@bindir@" 16 libdir="@libdir@" 17 . ${bindir}/rappture.env 18 16 19 nanoscale_port=2000 17 20 nanovis_port=2000 … … 19 22 pymol_port=2020 20 23 21 # Build the name of the run directory. This is where nanoscale and the 22 # visualization programs will reside. The directory name is the same as the 23 # render directory. 24 dir="/tmp/`basename $render_dir`" 25 26 # Get the versioned VTK library directory (e.g. "vtk-5.6") 27 vtkdir="`basename $vtk_lib_dir`" 28 29 PATH=${dir}/bin:$PATH 30 LD_LIBRARY_PATH=${dir}/lib:${dir}/lib/${vtkdir}:$LD_LIBRARY_PATH 31 PYMOL_PATH=${dir}/lib/pymol 24 PYMOL_PATH=${libdir}/pymol 25 # lspci is either in /sbin or /usr/sbin 26 PATH=/sbin:/usr/sbin:${PATH} 32 27 33 28 export PATH LD_LIBRARY_PATH PYMOL_PATH … … 39 34 nvideo=`lspci | fgrep VGA | fgrep nVidia | wc -l` 40 35 41 nanoscale="${ dir}/bin/nanoscale -x ${nvideo} -b $nanoscale_port -s $broadcast"42 nanovis="${ dir}/bin/nanovis -p ${dir}/lib/shaders:${dir}/lib/resources"43 vtkvis="${ dir}/bin/vtkvis"44 pymolproxy="${ dir}/bin/pymolproxy ${dir}/bin/pymol -p -q -i -x -X 0 -Y 0"36 nanoscale="${bindir}/nanoscale -x ${nvideo} -b $nanoscale_port -s $broadcast" 37 nanovis="${bindir}/nanovis -p ${libdir}/shaders:${libdir}/resources" 38 vtkvis="${bindir}/vtkvis" 39 pymolproxy="${bindir}/pymolproxy ${bindir}/pymol -p -q -i -x -X 0 -Y 0" 45 40 46 # Copy from render directory if the run copy doesn't already exist. 47 # Otherwise use what's there. This means that successive invocations 48 # of nanoscale won't create their own run directories (only the first 49 # one will). 50 51 if test -d "$dir" ; then 52 echo "Reusing previously installed version from $render_dir" 53 else 54 echo "Copying rappture from $render_dir" 55 mkdir -p $dir 56 tar -C ${render_dir} -clf - . | tar -C $dir -xpf - 57 fi 58 59 cd ${dir} 41 cd /tmp 60 42 61 43 # Don't let nanoscale and the visualization servers run away. … … 64 46 ulimit -t $(expr ${minutes} \* 60 ) 65 47 66 echo "$nanoscale -l $nanovis_port -c \"$nanovis\" -l $pymol_port -c \"$pymolproxy\"" 67 $nanoscale -l $nanovis_port -c "$nanovis" -l $vtkvis_port -c "$vtkvis" -l $pymol_port -c "$pymolproxy" 48 set -xv 49 echo `ldd $vtkvis` 50 exec $nanoscale \ 51 -l $nanovis_port -c "$nanovis" \ 52 -l $vtkvis_port -c "$vtkvis" \ 53 -l $pymol_port -c "$pymolproxy" 68 54 55
Note: See TracChangeset
for help on using the changeset viewer.