From d059fe743df6a5e8a72fc1418f2c3ba1ed5ac1e6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 20 Oct 2016 00:37:24 -0700 Subject: 3524 --- html/072scheduler.cc.html | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'html/072scheduler.cc.html') diff --git a/html/072scheduler.cc.html b/html/072scheduler.cc.html index 648f22b7..720b8473 100644 --- a/html/072scheduler.cc.html +++ b/html/072scheduler.cc.html @@ -16,7 +16,6 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.CommentedCode { color: #6c6c6c; } .muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } @@ -105,7 +104,6 @@ Routines.clear(); assert(Current_routine); assert(Current_routine->state == RUNNING); trace(9990, "schedule") << current_routine_label() << end(); -//? cerr << "schedule: " << current_routine_label() << '\n'; run_current_routine(); // Scheduler State Transitions if (Current_routine->completed()) @@ -119,7 +117,7 @@ Routines.clear(); } bool all_routines_done() { - for (int i = 0; i < SIZE(Routines); ++i) { + for (int i = 0; i < SIZE(Routines); ++i) { if (Routines.at(i)->state == RUNNING) return false; } @@ -146,7 +144,7 @@ string current_routine_label() (routine* r) { ostringstream result; const call_stack& calls = r->calls; - for (call_stack::const_iterator p = calls.begin(); p != calls.end(); ++p) { + for (call_stack::const_iterator p = calls.begin(); p != calls.end(); ++p) { if (p != calls.begin()) result << '/'; result << get(Recipe, p->running_recipe).name; } @@ -154,7 +152,7 @@ string routine_label(routine* r} :(before "End Teardown") -for (int i = 0; i < SIZE(Routines); ++i) +for (int i = 0; i < SIZE(Routines); ++i) delete Routines.at(i); Routines.clear(); Current_routine = NULL; @@ -168,7 +166,7 @@ Current_routine = NULL;// pass in commandline args as ingredients to main // todo: test this Current_routine = main_routine; - for (int i = 1; i < argc; ++i) { + for (int i = 1; i < argc; ++i) { vector<double> arg; arg.push_back(new_mu_text(argv[i])); current_call().ingredient_atoms.push_back(arg); @@ -218,7 +216,7 @@ put(Recipe_ordinal,new routine(ingredients.at(0).at(0)); new_routine->parent_index = Current_routine_index; // populate ingredients - for (int i = 1; i < SIZE(current_instruction().ingredients); ++i) { + for (int i = 1; i < SIZE(current_instruction().ingredients); ++i) { new_routine->calls.front().ingredient_atoms.push_back(ingredients.at(i)); reagent/*copy*/ ingredient = current_instruction().ingredients.at(i); canonize_type(ingredient); @@ -421,7 +419,7 @@ increment_any_refcounts(ingredient-schedule: f1 :(before "End Scheduler Cleanup") -for (int i = 0; i < SIZE(Routines); ++i) { +for (int i = 0; i < SIZE(Routines); ++i) { if (Routines.at(i)->state == COMPLETED) continue; if (Routines.at(i)->parent_index < 0) continue; // root thread // structured concurrency: http://250bpm.com/blog:71 @@ -432,7 +430,7 @@ increment_any_refcounts(ingredient:(code) bool has_completed_parent(int routine_index) { - for (int j = routine_index; j >= 0; j = Routines.at(j)->parent_index) { + for (int j = routine_index; j >= 0; j = Routines.at(j)->parent_index) { if (Routines.at(j)->state == COMPLETED) return true; } @@ -476,7 +474,7 @@ put(Recipe_ordinal,case ROUTINE_STATE: { int id = ingredients.at(0).at(0); int result = -1; - for (int i = 0; i < SIZE(Routines); ++i) { + for (int i = 0; i < SIZE(Routines); ++i) { if (Routines.at(i)->id == id) { result = Routines.at(i)->state; break; @@ -508,7 +506,7 @@ put(Recipe_ordinal,:(before "End Primitive Recipe Implementations") case STOP: { int id = ingredients.at(0).at(0); - for (int i = 0; i < SIZE(Routines); ++i) { + for (int i = 0; i < SIZE(Routines); ++i) { if (Routines.at(i)->id == id) { Routines.at(i)->state = COMPLETED; break; @@ -527,7 +525,7 @@ put(Recipe_ordinal,} :(before "End Primitive Recipe Implementations") case _DUMP_ROUTINES: { - for (int i = 0; i < SIZE(Routines); ++i) { + for (int i = 0; i < SIZE(Routines); ++i) { cerr << i << ": " << Routines.at(i)->id << ' ' << Routines.at(i)->state << ' ' << Routines.at(i)->parent_index << '\n'; } break; @@ -579,7 +577,7 @@ DISCONTINUED, :(code) bool any_routines_with_error() { - for (int i = 0; i < SIZE(Routines); ++i) { + for (int i = 0; i < SIZE(Routines); ++i) { if (Routines.at(i)->state == DISCONTINUED) return true; } @@ -614,7 +612,7 @@ put(Recipe_ordinal,:(before "End Primitive Recipe Implementations") case LIMIT_TIME: { int id = ingredients.at(0).at(0); - for (int i = 0; i < SIZE(Routines); ++i) { + for (int i = 0; i < SIZE(Routines); ++i) { if (Routines.at(i)->id == id) { Routines.at(i)->limit = ingredients.at(1).at(0); break; @@ -649,7 +647,7 @@ put(Recipe_ordinal,case NUMBER_OF_INSTRUCTIONS: { int id = ingredients.at(0).at(0); int result = -1; - for (int i = 0; i < SIZE(Routines); ++i) { + for (int i = 0; i < SIZE(Routines); ++i) { if (Routines.at(i)->id == id) { result = Routines.at(i)->instructions_run; break; -- cgit 1.4.1-2-gfad0