comparison VSs.c @ 20:a7ca8f45c1c4

fix coding standard to work with -std=gnu99 -Wall
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Tue, 25 Sep 2012 16:12:40 +0200
parents c9606ea7abc8
children feea343d202f
comparison
equal deleted inserted replaced
16:7b915ccda30c 17:df00a0c69d9a
279 void 279 void
280 VSs__cleanup_after_shutdown() 280 VSs__cleanup_after_shutdown()
281 { VSsSemEnv *semanticEnv; 281 { VSsSemEnv *semanticEnv;
282 282
283 semanticEnv = _VMSMasterEnv->semanticEnv; 283 semanticEnv = _VMSMasterEnv->semanticEnv;
284
285 #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC
284 FILE* output; 286 FILE* output;
285 int n; 287 int n;
286 char filename[255]; 288 char filename[255];
287 #ifdef HOLISTIC__TURN_ON_OBSERVE_UCC
288 //UCC 289 //UCC
289 for(n=0;n<255;n++) 290 for(n=0;n<255;n++)
290 { 291 {
291 sprintf(filename, "./counters/UCC.%d",n); 292 sprintf(filename, "./counters/UCC.%d",n);
292 output = fopen(filename,"r"); 293 output = fopen(filename,"r");
368 freeListOfArrays(semanticEnv->warDependenciesList); 369 freeListOfArrays(semanticEnv->warDependenciesList);
369 freeListOfArrays(semanticEnv->singletonDependenciesList); 370 freeListOfArrays(semanticEnv->singletonDependenciesList);
370 freeListOfArrays(semanticEnv->hwArcs); 371 freeListOfArrays(semanticEnv->hwArcs);
371 372
372 #endif 373 #endif
373 #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS 374 #ifdef HOLISTIC__TURN_ON_PERF_COUNTERS
374 for(n=0;n<255;n++) 375 FILE* output2;
376 int n2;
377 char filename2[255];
378 for(n2=0;n2<255;n2++)
375 { 379 {
376 sprintf(filename, "./counters/Counters.%d.csv",n); 380 sprintf(filename2, "./counters/Counters.%d.csv",n2);
377 output = fopen(filename,"r"); 381 output2 = fopen(filename2,"r");
378 if(output) 382 if(output2)
379 { 383 {
380 fclose(output); 384 fclose(output2);
381 }else{ 385 }else{
382 break; 386 break;
383 } 387 }
384 } 388 }
385 if(n<255){ 389 if(n2<255){
386 printf("Saving Counter measurements to File: %s ...\n", filename); 390 printf("Saving Counter measurements to File: %s ...\n", filename2);
387 output = fopen(filename,"w+"); 391 output2 = fopen(filename2,"w+");
388 if(output!=NULL){ 392 if(output2!=NULL){
389 set_counter_file(output); 393 set_counter_file(output2);
390 int i; 394 int i;
391 for(i=0;i<NUM_CORES;i++){ 395 for(i=0;i<NUM_CORES;i++){
392 forAllInListOfArraysDo( semanticEnv->counterList[i], &print_counter_events_to_file ); 396 forAllInListOfArraysDo( semanticEnv->counterList[i], &print_counter_events_to_file );
393 fflush(output); 397 fflush(output2);
394 } 398 }
395 399
396 } else 400 } else
397 printf("Opening UCC file failed. Please check that folder \"counters\" exists in run directory and has write permission.\n"); 401 printf("Opening UCC file failed. Please check that folder \"counters\" exists in run directory and has write permission.\n");
398 } else { 402 } else {
445 * 449 *
446 *It simply sends a dissipate request, which handles all the state cleanup. 450 *It simply sends a dissipate request, which handles all the state cleanup.
447 */ 451 */
448 void 452 void
449 VSs__end_thread( SlaveVP *thdToEnd ) 453 VSs__end_thread( SlaveVP *thdToEnd )
450 { VSsSemData *semData; 454 {
451 455
452 VMS_WL__send_dissipate_req( thdToEnd ); 456 VMS_WL__send_dissipate_req( thdToEnd );
453 } 457 }
454 458
455 459
473 reqData.taskID = NULL; 477 reqData.taskID = NULL;
474 478
475 VMS_WL__send_sem_request( &reqData, animSlv ); 479 VMS_WL__send_sem_request( &reqData, animSlv );
476 } 480 }
477 481
478 inline int32 * 482 int32 *
479 VSs__create_taskID_of_size( int32 numInts, SlaveVP *animSlv ) 483 VSs__create_taskID_of_size( int32 numInts, SlaveVP *animSlv )
480 { int32 *taskID; 484 { int32 *taskID;
481 485
482 taskID = VMS_WL__malloc( sizeof(int32) + numInts * sizeof(int32) ); 486 taskID = VMS_WL__malloc( sizeof(int32) + numInts * sizeof(int32) );
483 taskID[0] = numInts; 487 taskID[0] = numInts;
542 546
543 547
544 //========================== send and receive ============================ 548 //========================== send and receive ============================
545 // 549 //
546 550
547 inline int32 * 551 int32 *
548 VSs__give_self_taskID( SlaveVP *animSlv ) 552 VSs__give_self_taskID( SlaveVP *animSlv )
549 { 553 {
550 return ((VSsSemData*)animSlv->semanticData)->taskStub->taskID; 554 return ((VSsSemData*)animSlv->semanticData)->taskStub->taskID;
551 } 555 }
552 556
724 reqData.reqType = singleton_fn_end; 728 reqData.reqType = singleton_fn_end;
725 reqData.singletonID = singletonID; 729 reqData.singletonID = singletonID;
726 730
727 VMS_WL__send_sem_request( &reqData, animSlv ); 731 VMS_WL__send_sem_request( &reqData, animSlv );
728 732
729 EndSingletonInstrAddr: 733 //EndSingletonInstrAddr:
730 return; 734 return;
731 } 735 }
732 736
733 void 737 void
734 VSs__end_data_singleton( VSsSingleton **singletonPtrAddr, SlaveVP *animSlv ) 738 VSs__end_data_singleton( VSsSingleton **singletonPtrAddr, SlaveVP *animSlv )