static void printaffinity(void) { cpuset_t mask; if (cpuset_getaffinity(level, which, id, sizeof(mask), &mask) != 0) err(EXIT_FAILURE, "getaffinity"); printf("%s %jd%s mask: ", whichnames[which], (intmax_t)id, levelnames[level]); printset(&mask); exit(EXIT_SUCCESS); }
void logAPM( const AncestryPropertyMap& apm) { DBGLOG_SCOPE(DBG,"apm",false); DBGLOG(DBG,"logging AncestryPropertyMap:"); std::vector<Ancestry>::const_iterator it; unsigned u = 0; for(it = apm.storage_begin(); it != apm.storage_end(); ++it, ++u) { const Ancestry& anc = *it; DBGLOG(DBG,"unit " << u << ": " << printset(anc)); } }
void operator()( QueryParserModuleSemantics& mgr, const boost::fusion::vector2< boost::optional<std::vector<ID> >, std::vector<ID> >& source, ID&) { // the target is not used if( !mgr.ctxdata.query.empty() ) { LOG(WARNING,"got more than one query, ignoring all but the first one!"); return; } // remember the number of existentially quantified variables in the query // (for correct query answering, the computation of the possibly infinite universal model must not stop before its depth is greater or equal to this number) if (!!boost::fusion::at_c<0>(source)) { // count number of distinct variables std::set<ID> distinct; BOOST_FOREACH (ID v, boost::fusion::at_c<0>(source).get()) distinct.insert(v); mgr.ctx.config.setOption("LiberalSafetyNullFreezeCount", distinct.size()); } // set query mgr.ctxdata.query = boost::fusion::at_c<1>(source); // get variables/check groundness std::set<ID> vars; mgr.ctx.registry()->getVariablesInTuple(mgr.ctxdata.query, vars); mgr.ctxdata.ground = vars.empty(); DBGLOG(DBG,"found variables " << printset(vars) << " in query"); LOG(INFO,"got " << (mgr.ctxdata.ground?"ground":"nonground") << " query!"); if( mgr.ctxdata.allWitnesses && !mgr.ctxdata.ground ) { LOG(WARNING,"--query-all is only useful for ground queries!"); } // safety of the query is implicitly checked by checking safety // of the transformed rules WARNING("we should check query safety explicitly to get better error messages") }
int main() { ColoredGraph<GraphVertex,TriColor> gr; set<GraphVertex,less<GraphVertex> > groupsall, filesall,functionsall; set<GraphVertex,less<GraphVertex> > groupssome, filessome,functionssome,S; set<GraphVertex,less<GraphVertex> > groupsnot, filesnot,functionsnot; ifstream ifs1("groups.txt"); ifstream ifs2("files.txt"); ifstream ifs3("files.txt"); ifstream ifs4("choices.txt"); cerr << "reading groups"; readDoubleColumnGraph(ifs1,groupsall,gr,true); cerr << ", files"; readDoubleColumnGraph(ifs2,filesall,gr,true); cerr << ", functions\n"; readDoubleColumnGraph(ifs3,functionsall,gr,false); readSingleColumn(ifs4,gr); #if 1 ifstream ifs5("depends.txt"); list<list<string> > dbllist; readMultiColumns(ifs5,dbllist); #endif bool todo = true; while(todo) { todo = false; gr.ColorChildComponents(TriColor::s_one,TriColor::s_two); list<GraphVertex> L(gr.getColored(TriColor::s_two)); copy(L.begin(),L.end(),inserter(S,S.begin())); #if 1 todo = addElements(gr,TriColor::s_one,S,dbllist); cerr << "addelements give " << todo << '\n'; #endif }; cerr << "Here is the set after the loop:\n"; printset(cerr,S,","); set_intersection(S.begin(),S.end(),groupsall.begin(),groupsall.end(), inserter(groupssome,groupssome.begin())); set_intersection(S.begin(),S.end(),filesall.begin(),filesall.end(), inserter(filessome,filessome.begin())); set_intersection(functionsall.begin(),functionsall.end(),S.begin(),S.end(), inserter(functionssome,functionssome.begin())); set_difference(groupsall.begin(),groupsall.end(),S.begin(),S.end(), inserter(groupsnot,groupsnot.begin())); set_difference(filesall.begin(),filesall.end(),S.begin(),S.end(), inserter(filesnot,filesnot.begin())); set_difference(functionsall.begin(),functionsall.end(),S.begin(),S.end(), inserter(functionsnot,functionsnot.begin())); cerr << "all groups:\n"; printset(cerr,groupsall,", "); cerr << "\nall files:\n"; printset(cerr,filesall,", "); cerr << "\nall functions:\n"; printset(cerr,functionsall,", "); cerr << "\n\n\n"; cerr << "groups (not):\n"; printset(cerr,groupsnot,", "); cerr << "\nfiles (not):\n"; printset(cerr,filesnot,", "); cerr << "\nfunctions(not):\n"; printset(cerr,functionsnot,", "); cerr << "\n\n\n"; cerr << "groups:\n"; printset(cerr,groupssome,", "); cerr << "\nfiles:\n"; printset(cerr,filessome,", "); cerr << "\nfunctions:\n"; printset(cerr,functionssome,", "); cerr << "Staring creation of the file Makefile.mark\n"; ofstream ofs("Makefile.mark"); ofs << "p9clist = "; printset(ofs,filessome,".o \\\n",".o \n"); ofs.close(); cerr << "Ended creation of the file Makefile.mark\n"; cerr << "Staring creation of the file Makefile.cp\n"; ofstream ofs2("Makefile.cp"); ofs2 << "cp "; printset(ofs2,filessome,".[hc]pp copyplace/ \n cp ",".[hc]pp copyplace/ \n"); ofs2.close(); cerr << "Ended creation of the file Makefile.cp\n"; };
plugins.push_back(LoadedPluginPtr(new LoadedPlugin(dlHandle, nopDeletingPluginPtr))); } while(false); } } void selectLoadedPlugins( LoadedPluginVector& plugins, LoadedPluginVector& candidates) { // remove those with duplicate names std::set<std::string> names; BOOST_FOREACH(LoadedPluginPtr lplugin, plugins) { names.insert(lplugin->plugin->getPluginName()); } DBGLOG(DBG,"selectLoadedPlugins: already loaded: " << printset(names)); LoadedPluginVector::iterator it = candidates.begin(); while(it != candidates.end()) { const std::string& pname = (*it)->plugin->getPluginName(); if( names.find(pname) != names.end() ) { // warn, unload, remove, restart loop // warn LOG(WARNING,"already loaded a plugin with name " << pname << " (skipping)"); WARNING("TODO check if any pointer is used?") DBGLOG(DBG,"usage count on interface ptr is " << (*it)->plugin.use_count() << " (should be 1)"); // unload lib if( 0 != lt_dlclose((*it)->handle) ) {