Changeset 2403
- Timestamp:
- Aug 22, 2011, 9:03:55 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkviewer.tcl
r2397 r2403 140 140 # ---------------------------------------------------------------------- 141 141 itcl::body Rappture::VtkViewer::constructor {hostlist args} { 142 if {[catch {info level -1} caller]} {143 puts stderr "Enter constructor"144 } else {145 puts stderr "Enter constructor: $caller"146 }147 148 142 # Rebuild event 149 143 $_dispatcher register !rebuild … … 359 353 set _height 500 360 354 } 361 #puts stderr " screen size $_width $_height"355 #puts stderr "DoResize screen size $_width $_height" 362 356 set _start [clock clicks -milliseconds] 363 357 SendCmd "screen size $_width $_height" 358 359 # Must reset camera to have object scaling to take effect. 360 SendCmd "camera reset all" 361 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 362 $_arcball quaternion $q 363 SendCmd "camera orient $q" 364 SendCmd "camera zoom $_view(zoom)" 364 365 set _resizePending 0 365 366 } … … 371 372 $_arcball resize $w $h 372 373 if { !$_resizePending } { 373 $_dispatcher event -after 400 !resize374 374 set _resizePending 1 375 $_dispatcher event -after 100 !resize 375 376 } 376 377 } … … 726 727 if { $_start > 0 } { 727 728 set finish [clock clicks -milliseconds] 728 puts stderr "round trip time [expr $finish -$_start] milliseconds"729 #puts stderr "round trip time [expr $finish -$_start] milliseconds" 729 730 set _start 0 730 731 } … … 1325 1326 3,0 $inner.lighting -columnspan 4 -anchor w \ 1326 1327 4,0 $inner.edges -columnspan 4 -anchor w -pady 2 \ 1327 5,0 $inner.clear -anchor e -pady 2 \1328 6,0 $inner.clear -anchor e -pady 2 \ 1328 1329 6,1 $inner.opacity -columnspan 2 -pady 2 -fill x\ 1329 1330 6,3 $inner.opaque -anchor w -pady 2 -
trunk/packages/vizservers/nanoscale/server.c
r2339 r2403 1 2 1 #include <stdio.h> 3 2 #include <unistd.h> … … 77 76 78 77 79 #include <syslog.h>80 #include <stdarg.h>81 82 #define ERROR(...) LogMessage(LOG_ERR, __FILE__, __LINE__, __VA_ARGS__)83 #ifdef WANT_TRACE84 #define TRACE(...) LogMessage(LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__)85 #else86 #define TRACE(...)87 #endif88 #define WARN(...) LogMessage(LOG_WARNING, __FILE__, __LINE__, __VA_ARGS__)89 #define INFO(...) LogMessage(LOG_INFO, __FILE__, __LINE__, __VA_ARGS__)90 91 void92 LogMessage(int priority, const char *path, int lineNum, const char* fmt, ...)93 {94 #define MSG_LEN (2047)95 char message[MSG_LEN+1];96 const char *s;97 int length;98 va_list lst;99 100 va_start(lst, fmt);101 s = strrchr(path, '/');102 if (s == NULL) {103 s = path;104 } else {105 s++;106 }107 length = snprintf(message, MSG_LEN, "line %d of \"%s\": ", lineNum, s);108 length += vsnprintf(message + length, MSG_LEN - length, fmt, lst);109 message[MSG_LEN] = '\0';110 syslog(priority, message, length);111 }112 113 78 static void 114 79 close_child(int pipe_fd) … … 128 93 } 129 94 130 INFO("processes=%d, memory=%d, load=%f\n", children, memory_in_use, load); 95 printf("processes=%d, memory=%d, load=%f\n", 96 children, memory_in_use, load); 131 97 132 98 } … … 139 105 child_array[c].requests += value; 140 106 #ifdef DEBUGGING 141 INFO("Updating requests from pipefd %d to %f\n",107 printf("Updating requests from pipefd %d to %f\n", 142 108 child_array[c].pipefd, 143 109 child_array[c].requests); … … 159 125 help(const char *argv0) 160 126 { 161 printf("Syntax: %s [-d] -b <broadcast port> -l <listen port> -s <subnet> -c 'command'\n", 127 fprintf(stderr, 128 "Syntax: %s [-d] -b <broadcast port> -l <listen port> -s <subnet> -c 'command'\n", 162 129 argv0); 163 130 exit(1); … … 216 183 maxCards = strtoul(optarg, 0, 0); 217 184 if ((maxCards < 1) || (maxCards > 10)) { 218 ERROR("bad number of max videocards specified\n");185 fprintf(stderr, "bad number of max videocards specified\n"); 219 186 return 1; 220 187 } … … 230 197 231 198 if (listen_port[nservices] == -1) { 232 ERROR("Must specify -l port before each -c command.\n");199 fprintf(stderr,"Must specify -l port before each -c command.\n"); 233 200 return 1; 234 201 } … … 243 210 send_addr.sin_addr.s_addr = htonl(inet_network(optarg)); 244 211 if (send_addr.sin_addr.s_addr == -1) { 245 ERROR("Invalid subnet broadcast address");212 fprintf(stderr,"Invalid subnet broadcast address"); 246 213 return 1; 247 214 } 248 215 break; 249 216 default: 250 ERROR("Don't know what option '%c'.\n", c);217 fprintf(stderr,"Don't know what option '%c'.\n", c); 251 218 return 1; 252 219 } … … 257 224 int i; 258 225 for (i = 0; i < argc; i++) { 259 INFO("argv[%d]=(%s)\n", i, argv[i]);226 fprintf(stderr, "argv[%d]=(%s)\n", i, argv[i]); 260 227 } 261 228 help(argv[0]); … … 406 373 } 407 374 408 INFO("New connection from %s\n", inet_ntoa(newaddr.sin_addr));375 printf("New connection from %s\n", inet_ntoa(newaddr.sin_addr)); 409 376 FD_SET(newfd, &saved_rfds); 410 377 maxfd = max(maxfd, newfd); … … 428 395 } 429 396 if (status != 8) { 430 ERROR("Bogus message from %s\n", inet_ntoa(peer_addr.sin_addr)); 397 fprintf(stderr,"Bogus message from %s\n", 398 inet_ntoa(peer_addr.sin_addr)); 431 399 continue; 432 400 } 433 401 float peer_load = ntohl(buffer[0]); 434 402 int peer_procs = ntohl(buffer[1]); 403 //printf("Load for %s is %f (%d processes).\n", 404 // inet_ntoa(peer_addr.sin_addr), peer_load, peer_procs); 435 405 int h; 436 406 int free_index=-1; … … 439 409 if (host_array[h].in_addr.s_addr == peer_addr.sin_addr.s_addr) { 440 410 if (host_array[h].children != peer_procs) { 441 INFO("Load for %s is %f (%d processes).\n", inet_ntoa(peer_addr.sin_addr), peer_load, peer_procs); 411 printf("Load for %s is %f (%d processes).\n", 412 inet_ntoa(peer_addr.sin_addr), peer_load, peer_procs); 442 413 } 443 414 host_array[h].load = peer_load; … … 482 453 status = read(i, &msg, 4); 483 454 if (status != 4) { 484 ERROR("Bad status on read (%d).", status);455 fprintf(stderr,"Bad status on read (%d).", status); 485 456 FD_CLR(i, &saved_rfds); 486 457 clear_service_fd(i); … … 494 465 memory_in_use += newmemory; 495 466 load += 2*INITIAL_LOAD; 496 INFO("Accepted new job with memory %d\n", newmemory); 467 printf("Accepted new job with memory %d\n", newmemory); 468 //printf("My load is now %f\n", load); 497 469 498 470 // accept the connection. 499 471 msg = 0; 500 472 if (write(i, &msg, 4) != 4) { 501 ERROR("short write for hostname\n");473 fprintf(stderr, "short write for hostname\n"); 502 474 } 503 475 … … 535 507 int fd; 536 508 537 dup2(i, 0); // stdin538 dup2(i, 1); // stdout539 dup2(i, 2); // stderr509 dup2(i, 0); // stdin 510 dup2(i, 1); // stdout 511 dup2(i, 2); // stderr 540 512 dup2(pair[1],3); 541 513 // read end of pipe moved, and left open to … … 549 521 displayVar[11] = dispNum + '0'; 550 522 } 551 fprintf(stderr, "command=%s\n", 552 command_argv[n][0]); 553 if (execvp(command_argv[n][0], command_argv[n]) < 1) { 554 extern int errno; 555 556 ERROR("can't execute \"%s\": %s\n", 557 command_argv[n][0], strerror(errno)); 558 } else { 559 INFO("started command \"%s\": %s\n", 560 command_argv[n][0], strerror(errno)); 561 } 523 execvp(command_argv[n][0], command_argv[n]); 562 524 } 563 525 _exit(errno); … … 565 527 } 566 528 _exit(EINVAL); 529 567 530 } else { 568 531 int c;
Note: See TracChangeset
for help on using the changeset viewer.