Skip to content

Commit

Permalink
refs #12: Fix mistakes.
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Jul 7, 2015
1 parent 5747b12 commit d86514f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions elements/loadbalancers/LoadBalanceAdaptiveMeasure.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public:

int initialize_per_node()
{
ctx->node_local_storage->alloc("LBPPC.cpu_weight", sizeof(rte_atomic64_t));
ctx->node_local_storage->alloc("LBMeasure.cpu_weight", sizeof(rte_atomic64_t));
rte_atomic64_t *node_cpu_ratio = (rte_atomic64_t *)
ctx->node_local_storage->get_alloc("LBPPC.cpu_weight");
ctx->node_local_storage->get_alloc("LBMeasure.cpu_weight");
assert(node_cpu_ratio != nullptr);
rte_atomic64_set(node_cpu_ratio, 0);
return 0;
Expand Down Expand Up @@ -97,8 +97,7 @@ public:
int64_t temp_cpu_ratio = rte_atomic64_read(cpu_ratio);
local_cpu_ratio = temp_cpu_ratio;

//if (ctx->io_ctx->loc.local_thread_idx == 0) {
if (ctx->io_ctx->loc.core_id == 0) {
if (ctx->io_ctx->loc.local_thread_idx == 0) {
const float ppc_cpu = ctx->inspector->pkt_proc_cycles[0];
const float ppc_gpu = ctx->inspector->pkt_proc_cycles[1];
const float estimated_ppc = (temp_cpu_ratio * ppc_cpu
Expand Down
2 changes: 1 addition & 1 deletion elements/loadbalancers/LoadBalancePPC.hh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public:
if (temp_cpu_ratio > LB_PPC_CPU_RATIO_MULTIPLIER) temp_cpu_ratio = LB_PPC_CPU_RATIO_MULTIPLIER;
last_estimated_ppc = estimated_ppc;

printf("[MEASURE:%d] CPU %'8.0f GPU %'8.0f PPC %'8.0f CPU-Ratio %.3f\n",
printf("[PPC:%d] CPU %'8.0f GPU %'8.0f PPC %'8.0f CPU-Ratio %.3f\n",
ctx->loc.node_id,
ppc_cpu, ppc_gpu, estimated_ppc, c);
rte_atomic64_set(cpu_ratio, temp_cpu_ratio);
Expand Down

0 comments on commit d86514f

Please sign in to comment.