Changeset 2856044a for libcfa/src


Ignore:
Timestamp:
Mar 4, 2023, 1:59:47 PM (22 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
858350a
Parents:
046ba23
Message:

fixed div by zero bug in actor stats, cleaned up includes, changed to work steal mode for tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/actor.hfa

    r046ba23 r2856044a  
    44#include <limits.hfa>
    55#include <kernel.hfa>
    6 #include <time_t.hfa>
    7 #include <time.hfa>
    86#include <iofwd.hfa>
    97
     
    2927#define __DEFAULT_EXECUTOR_BUFSIZE__ 10
    3028
    31 // #define __STEAL 0 // workstealing toggle. Disjoint from toggles above
     29#define __STEAL 0 // workstealing toggle. Disjoint from toggles above
    3230
    3331// workstealing heuristic selection (only set one to be 1)
    3432// #define RAND 0
    35 // #define SEARCH 0
     33#define SEARCH 1
    3634
    3735// show stats
     
    367365    printf("    Actor System Stats:\n");
    368366    printf("\tActors Created:\t\t\t\t%lu\n\tMessages Sent:\t\t\t\t%lu\n", __num_actors_stats, all_processed);
    369     printf("\tGulps:\t\t\t\t\t%lu\n\tAverage Gulp Size:\t\t\t%lu\n\tMissed gulps:\t\t\t\t%lu\n", all_gulps, all_processed / all_gulps, misses);
     367    size_t avg_gulps = all_gulps == 0 ? 0 : all_processed / all_gulps;
     368    printf("\tGulps:\t\t\t\t\t%lu\n\tAverage Gulp Size:\t\t\t%lu\n\tMissed gulps:\t\t\t\t%lu\n", all_gulps, avg_gulps, misses);
    370369    printf("\tSteal attempts:\t\t\t\t%lu\n\tSteals:\t\t\t\t\t%lu\n\tSteal failures (no candidates):\t\t%lu\n\tSteal failures (failed swaps):\t\t%lu\n",
    371370        total_tries, total_stolen, total_tries - total_stolen - total_failed_swaps, total_failed_swaps);
    372     printf("\tMessages stolen:\t\t\t%lu\n\tAverage steal size:\t\t\t%lu\n", all_msgs_stolen, all_msgs_stolen/total_stolen);
     371    size_t avg_steal = total_stolen == 0 ? 0 : all_msgs_stolen / total_stolen;
     372    printf("\tMessages stolen:\t\t\t%lu\n\tAverage steal size:\t\t\t%lu\n", all_msgs_stolen, avg_steal);
    373373    #endif
    374374       
Note: See TracChangeset for help on using the changeset viewer.