void BridgedMultiColvarFunction::performTask(){ atoms_with_derivatives.deactivateAll(); if( !myBridgeVessel->prerequisitsCalculated() ){ mycolv->setTaskIndexToCompute( getCurrentPositionInTaskList() ); mycolv->performTask(); } else { } completeTask(); atoms_with_derivatives.updateActiveMembers(); }
void BridgedMultiColvarFunction::performTask(){ atoms_with_derivatives.deactivateAll(); if( !myBridgeVessel->prerequisitsCalculated() ){ mycolv->setTaskIndexToCompute( getCurrentPositionInTaskList() ); mycolv->performTask(); } else { } completeTask(); atoms_with_derivatives.emptyActiveMembers(); if( mycolv->isDensity() ){ for(unsigned j=0;j<mycolv->atomsWithCatomDer.getNumberActive();++j) atoms_with_derivatives.updateIndex( mycolv->atomsWithCatomDer[j] ); } else { for(unsigned j=0;j<mycolv->atoms_with_derivatives.getNumberActive();++j) atoms_with_derivatives.updateIndex( mycolv->atoms_with_derivatives[j] ); } atoms_with_derivatives.sortActiveList(); }
static void reviewLoop (const std::vector <std::string>& uuids, unsigned int limit, bool autoClear) { auto width = getWidth (); unsigned int reviewed = 0; // If a limit was specified ('review 10'), then it should override the data // set size, if it is smaller. unsigned int total = uuids.size (); if (limit) total = std::min (total, limit); if (total == 0) { std::cout << reviewNothing (); return; } std::cout << reviewStart (width); unsigned int current = 0; while (current < total && (limit == 0 || reviewed < limit)) { // Run 'info' report for task. auto uuid = uuids[current]; // Display banner for this task. std::string dummy; std::string description; execute ("task", {"_get", uuid + ".description"}, dummy, description); std::string response; bool repeat; do { repeat = false; std::cout << banner (current + 1, total, width, Lexer::trimRight (description, "\n")); // Use 'system' to run the command and show the output. std::string command = "task " + uuid + " information"; system (command.c_str ()); // Display prompt, get input. response = getResponse (menu ()); if (response == "e") { editTask (uuid); } else if (response == "m") { modifyTask (uuid); repeat = true; } else if (response == "s") { std::cout << "Skipped\n\n"; ++current; } else if (response == "c") { completeTask (uuid); ++current; ++reviewed; } else if (response == "d") { deleteTask (uuid); ++current; ++reviewed; } else if (response == "") { reviewTask (uuid); ++current; ++reviewed; } else if (response == "r") { reviewTask (uuid); ++current; ++reviewed; } else if (response == "q") { break; } else { std::cout << format ("Command '{1}' is not recognized.", response) << "\n"; } // Note that just hitting <Enter> yields an empty command, which does // nothing but advance to the next task. if (autoClear) std::cout << "\033[2J\033[0;0H"; } while (repeat); if (response == "q") break; } std::cout << "\n" << format ("End of review. {1} out of {2} tasks reviewed.", reviewed, total) << "\n\n"; }