![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Namespaces | |
| namespace | nlp_detail |
| namespace | srvn_detail |
| namespace | srvn_out |
Classes | |
| struct | BoolGraph |
| A boolean sparse relation over element indices, e.g. More... | |
| struct | Distrib |
| struct | LqnBalanceEquations |
| The relation set of one layered model. More... | |
| struct | LqnBoxBounds |
| What lqn_boxbounds returns, in the layout of the reference's out struct. More... | |
| class | LqnBuilder |
| struct | LqnCallGroup |
| One routed call group: an activity, the strategy that picks among its targets, and the target ENTRIES in declaration order. More... | |
| struct | LqnModel |
| The intermediate model, and the second stage that flattens it. More... | |
| struct | LqnMolInfo |
| Everything lqn_mol reports beyond the four measure vectors. More... | |
| struct | LqnMolOptions |
| Tuning of the outer fixed point. More... | |
| struct | LqnMolResult |
| The four (nidx+1) vectors in the column convention SolverLN and LQNS report, so they line up with LN(model).getAvgTable cell for cell. More... | |
| struct | LqnPrecedence |
| One activity precedence of a task, with its activities resolved to indices. More... | |
| struct | LqnRefCall |
| One row of calls: the reference's [cidx, fromPos, toPos, aidx, vCall]. More... | |
| struct | LqnRefGroup |
| One group, the reference's R(g): the DAG below one REF task. More... | |
| struct | LqnRefRoutes |
| What lqn_ref_routes returns: the groups, or a non-empty why and no groups. More... | |
| struct | LqnRelation |
| One conservation law, as an aggregation over a node's structural neighbours. More... | |
| struct | LqnSolution |
| The iterates of a solved layered model, indexed by ABSOLUTE element index. More... | |
| struct | LqnStruct |
| struct | LqnWriteReport |
| What the schema could not carry, one human-readable line per loss. More... | |
| struct | NlpLld |
| A declared queue-dependent rate multiplier of one station: an expression in n, or a tabulated lldscaling row, which is refused because its interpolant has a corner at every knot. More... | |
| struct | NlpOptions |
| Options of the program: python export_nlp(lld=, alpha=, fork=). More... | |
| class | NlpProgram |
| The program of one layered model. More... | |
| struct | NlpRate |
| The queue-dependent rate of one station, r(n) = softmin(n, m) [* lld(n)], or n at a delay. More... | |
| struct | NlpSolveResult |
| What NlpProgram::solve returns: python's Result. More... | |
| struct | ServerPools |
| Heterogeneous server pools declared on a layer server, the twin of the nservertypes / servertypenames / serverspertype / servercompat / heterorates block a Network carries in sn.nodeparam{i}. More... | |
| struct | SparseGraph |
| A sparse square matrix over element indices, held as a dense vector of rows with an explicit nonzero list per row. More... | |
Typedefs | |
| template<class T> | |
| using | CdScaling |
| A class-dependent scaling map, sn.cdscaling. | |
Enumerations | |
| enum class | CallType |
| Call kinds, with the values of MATLAB CallType. More... | |
| enum class | LqnElement |
| LQN element kinds, with the values of MATLAB LayeredNetworkElement. More... | |
| enum class | PrecedenceType |
| Activity precedence kinds, with the values of MATLAB ActivityPrecedenceType. More... | |
| enum class | ReplacementStrategy |
| Cache replacement policies, with the values of MATLAB ReplacementStrategy. More... | |
| enum class | SchedStrategy |
| Scheduling disciplines, with the values of MATLAB SchedStrategy. More... | |
Functions | |
| template<class T> | |
| LqnBalanceEquations< T > | lqn_balance_equations (const LqnStruct< T > &lqn, const LqnSolution< T > *sol=nullptr) |
| Enumerate the conservation laws of the layered model lqn. | |
| template<class T> | |
| LqnBoxBounds< T > | lqn_boxbounds (const LqnStruct< T > &lqn) |
| Evaluate the box bounds of lqn. | |
| template<class S> | |
| S | fj_max_exp (const std::vector< S > &m) |
| E[max] of K independent EXPONENTIAL branch completion times of means m, with the reciprocals cleared so a branch of zero mean contributes zero: sum over nonempty S of (-1)^(|S|+1) prod_{i in S} m_i / sum_{i in S} prod_{j in S, j != i} m_j. | |
| std::vector< double > | fj_max_exp_grad (const std::vector< double > &u) |
| Gradient of fj_max_exp by complex step, one coordinate at a time. | |
| template<class T> | |
| NlpProgram | lqn_nlp_program (const LqnStruct< T > &lqn, const NlpOptions &opt=NlpOptions(), const std::string &name="") |
| Build the nonlinear program of a layered model: python export_nlp without the emission, i.e. | |
| template<class T> | |
| LqnMolResult< T > | lqn_mol (const LqnStruct< T > &lsn, const LqnMolOptions &options=LqnMolOptions()) |
| Method of Layers on the SRVN decomposition of a layered queueing network whose entries carry no activity graph. | |
| template<class T> | |
| LqnRefRoutes< T > | lqn_ref_routes (const LqnStruct< T > &lqn, const std::vector< std::size_t > &callers, double maxpaths=32.0, const std::vector< std::size_t > &server_set={}) |
| Resolve the reference routes into the layer whose callers are CALLERS. | |
| template<class T> | |
| std::vector< double > | lqn_sustainable_mult (const LqnStruct< T > &l, const std::vector< double > &mult) |
| Sustainable multiplicity (lsn_max_multiplicity) of every host and task of l under the declared multiplicities mult (tshift+ntasks+1). | |
| template<class T> | |
| LqnStruct< T > | lqn_finalize (const LqnModel< T > &m) |
| Port of @LayeredNetwork/getStruct.m: flatten the model into its struct. | |
| template<class T> | |
| LqnModel< T > | read_lqnx_model_doc (std::unique_ptr< xml::Element > doc) |
| template<class T> | |
| LqnModel< T > | read_lqnx_model (const std::string &path) |
| read_lqnx_model on a .lqnx file. | |
| template<class T> | |
| LqnModel< T > | read_lqnx_model_text (const std::string &text) |
| read_lqnx_model on a .lqnx document held in a string (the SRVN reader's translation, for one). | |
| template<class T> | |
| LqnStruct< T > | read_lqnx (const std::string &path) |
| Read a .lqnx model. | |
| template<class T> | |
| LqnWriteReport | write_lqnx (const LqnModel< T > &m, const std::string &path, const std::string &model_name=std::string("LQN"), bool use_abstract_names=false, std::string *out_text=NULL) |
| Write a layered model as a .lqnx document. | |
| template<class T> | |
| std::string | lqnx_to_string (const LqnModel< T > &m, const std::string &model_name=std::string("LQN"), bool use_abstract_names=false) |
| The .lqnx document as a STRING, for a caller with no file to write to – the CLI's model-generation mode hands the XML back through its JSON envelope, and a test can compare documents without a temporary directory. | |
| std::string | format_number (double x) |
| Shortest C g spelling that round-trips x; the four codebases share this rule. | |
| std::string | srvn2lqnx (const std::string &src, const std::string &name=std::string("model")) |
| Translate SRVN text into an LQN XML document. | |
| bool | is_srvn_file (const std::string &path) |
| True when path holds SRVN text rather than XML: its first non-blank character is not '<'. | |
| bool | is_srvn_path (const std::string &path) |
| Whether path should be read as SRVN: a .in file, or a .lqn file that is not XML. | |
| std::string | srvn_file_to_lqnx (const std::string &path) |
| Translate the SRVN file path to .lqnx text, model name = its basename without extension. | |
| template<class T> | |
| LqnModel< T > | read_srvn_model (const std::string &path) |
| Read an SRVN file (.in, or a .lqn that is not XML) into the intermediate LqnModel, via its .lqnx translation. | |
| template<class T> | |
| LqnStruct< T > | read_srvn (const std::string &path) |
| read_srvn_model followed by lqn_finalize: the struct SolverLN consumes, as read_lqnx is. | |
| std::string | lqnx2srvn (const std::string &xml_text, const std::string &name=std::string()) |
| Translate an LQN XML document into SRVN text. | |
| template<class T> | |
| void | write_srvn (const LqnModel< T > &m, const std::string &path, bool use_abstract_names=false) |
| Write a layered model as SRVN text: write_lqnx, then lqnx2srvn, with LF line endings. | |
| using line::lang::CdScaling |
A class-dependent scaling map, sn.cdscaling.
It takes the per-class population vector at one station and returns the per-class rate multipliers, which is the signature pfqn_cdfun consumes; the alias resolves to the same std::function type as pfqn::CdScaling, so a map built here is passed straight through to the api layer.
Definition at line 736 of file lang_types.h.
|
strong |
Call kinds, with the values of MATLAB CallType.
Definition at line 474 of file lang_types.h.
|
strong |
LQN element kinds, with the values of MATLAB LayeredNetworkElement.
Definition at line 471 of file lang_types.h.
|
strong |
Activity precedence kinds, with the values of MATLAB ActivityPrecedenceType.
Definition at line 477 of file lang_types.h.
|
strong |
Cache replacement policies, with the values of MATLAB ReplacementStrategy.
Definition at line 385 of file lang_types.h.
|
strong |
Scheduling disciplines, with the values of MATLAB SchedStrategy.
Definition at line 185 of file lang_types.h.
| S line::lqn::fj_max_exp | ( | const std::vector< S > & | m | ) |
E[max] of K independent EXPONENTIAL branch completion times of means m, with the reciprocals cleared so a branch of zero mean contributes zero: sum over nonempty S of (-1)^(|S|+1) prod_{i in S} m_i / sum_{i in S} prod_{j in S, j != i} m_j.
Definition at line 621 of file lqn_export_nlp.h.
References fj_max_exp().
Referenced by fj_max_exp(), fj_max_exp_grad(), line::lqn::NlpProgram::residuals(), and line::lqn::NlpProgram::sweep().
|
inline |
Gradient of fj_max_exp by complex step, one coordinate at a time.
Definition at line 642 of file lqn_export_nlp.h.
References fj_max_exp(), and fj_max_exp_grad().
Referenced by fj_max_exp_grad(), and line::lqn::NlpProgram::jacobian().
|
inline |
Shortest C g spelling that round-trips x; the four codebases share this rule.
An integer below 1e15 in magnitude prints as d; anything else as the shortest %.{p}g, p = 1..17, that strtod reads back as x.
| InputError | (LINE:input:Format) when x is not finite (every caller checks first) |
Definition at line 375 of file srvn_reader.h.
References format_number(), and line::InputError::InputError().
Referenced by format_number(), and line::lqn::srvn_out::num().
|
inline |
True when path holds SRVN text rather than XML: its first non-blank character is not '<'.
An empty file counts as SRVN, as in the reference.
| InputError | (LINE:input:File) when the file cannot be opened |
Definition at line 1288 of file srvn_reader.h.
References line::InputError::InputError(), line::lqn::srvn_detail::is_space(), and is_srvn_file().
Referenced by is_srvn_file(), and is_srvn_path().
|
inline |
Whether path should be read as SRVN: a .in file, or a .lqn file that is not XML.
This is the line-cli and loader rule; .lqnx and .xml are never SRVN.
Definition at line 1303 of file srvn_reader.h.
References is_srvn_file(), and is_srvn_path().
Referenced by find_solver_report(), is_srvn_path(), line::io::read_layered_model(), and run_invocation().
| LqnBalanceEquations< T > line::lqn::lqn_balance_equations | ( | const LqnStruct< T > & | lqn, |
| const LqnSolution< T > * | sol = nullptr ) |
Enumerate the conservation laws of the layered model lqn.
When sol is non-null every relation is also instantiated and its residual reported. On a converged fixed point they vanish to the solver's own tolerance; a residual that does not is either a documented convention difference (see mult against maxmult) or a defect in the solution.
Definition at line 466 of file lqn_balance_equations.h.
References line::lqn::LqnBalanceEquations< T >::A_flow, line::lqn::LqnBalanceEquations< T >::A_host, line::lqn::LqnBalanceEquations< T >::A_little, line::lang::ASYNC, line::lqn::LqnRelation< T >::branch, line::lqn::LqnRelation< T >::clamped, line::lqn::LqnRelation< T >::coeff, line::lqn::LqnBalanceEquations< T >::convention, line::lqn::LqnRelation< T >::degenerate, line::lqn::LqnBalanceEquations< T >::eqs, line::lang::FWD, line::lqn::LqnBalanceEquations< T >::has_maxresidual, line::lqn::LqnRelation< T >::has_residual, line::lang::INF, line::lqn::LqnRelation< T >::kind, line::lqn::LqnRelation< T >::lhs, lqn_balance_equations(), line::Matrix< T >::Matrix(), line::lqn::LqnRelation< T >::maxmult, line::lqn::LqnBalanceEquations< T >::maxresidual, line::lqn::LqnRelation< T >::mult, line::lqn::LqnRelation< T >::perclassutil, line::lqn::LqnRelation< T >::phase2, line::lqn::LqnRelation< T >::relresidual, line::lqn::LqnRelation< T >::repl, line::lqn::LqnRelation< T >::residual, line::lqn::LqnRelation< T >::rhs, line::lqn::LqnRelation< T >::rhsconst, line::lqn::LqnRelation< T >::scaled, line::lqn::LqnRelation< T >::setup, line::lang::SYNC, line::lqn::LqnRelation< T >::target, line::lqn::LqnRelation< T >::targetname, line::lqn::LqnRelation< T >::termisentry, line::lqn::LqnRelation< T >::terms, line::lqn::LqnBalanceEquations< T >::text, line::lqn::LqnRelation< T >::text, and line::lqn::LqnBalanceEquations< T >::visits.
Referenced by lqn_balance_equations().
| LqnBoxBounds< T > line::lqn::lqn_boxbounds | ( | const LqnStruct< T > & | lqn | ) |
Evaluate the box bounds of lqn.
A reference task of infinite multiplicity is treated as one customer, as the reference does: the bound is over a closed chain and an infinite population has no lower bound to report.
Definition at line 130 of file lqn_boxbounds.h.
References line::lqn::LqnBoxBounds< T >::D, line::lqn::LqnBoxBounds< T >::defined_T, line::lqn::LqnBoxBounds< T >::defined_U, line::InputError::InputError(), lqn_boxbounds(), line::Matrix< T >::Matrix(), line::pfqn::pfqn_mwrbb(), line::lqn::LqnBoxBounds< T >::refidx, line::lqn::LqnBoxBounds< T >::TN_lo, line::lqn::LqnBoxBounds< T >::TN_up, line::lqn::LqnBoxBounds< T >::UN_lo, line::lqn::LqnBoxBounds< T >::UN_up, line::lqn::LqnBoxBounds< T >::Xlo, line::pfqn::MwrbbBounds< T >::Xlo, line::lqn::LqnBoxBounds< T >::Xup, and line::pfqn::MwrbbBounds< T >::Xup.
Referenced by line::ln::SolverLN< T >::box_bounds(), and lqn_boxbounds().
Port of @LayeredNetwork/getStruct.m: flatten the model into its struct.
Definition at line 501 of file lqn_reader.h.
References line::lqn::LqnStruct< T >::actphase, line::lqn::LqnStruct< T >::actposttype, line::lqn::LqnStruct< T >::actpretype, line::lqn::LqnStruct< T >::actquorum, line::lqn::LqnModel< T >::acts, line::lqn::LqnStruct< T >::actsof, line::lqn::LqnStruct< T >::actthink, line::lqn::LqnStruct< T >::arrival, line::lqn::LqnStruct< T >::ashift, line::lqn::LqnCallGroup::caller, line::lqn::LqnStruct< T >::callgroups, line::lqn::LqnStruct< T >::callhashnames, line::lqn::LqnStruct< T >::callnames, line::lqn::LqnStruct< T >::callpair_dst, line::lqn::LqnStruct< T >::callpair_src, line::lqn::LqnStruct< T >::callproc_mean, line::lqn::LqnStruct< T >::callsof, line::lqn::LqnStruct< T >::calltype, line::lqn::LqnStruct< T >::cdscaling, line::lqn::LqnStruct< T >::cdscalingpeak, line::Matrix< T >::cols(), line::lqn::ServerPools< T >::compat, line::lqn::LqnStruct< T >::cshift, line::lqn::LqnStruct< T >::dag, line::lqn::LqnStruct< T >::delayofftime, line::lqn::Distrib< T >::disabled_dist(), line::lqn::LqnModel< T >::entries, line::lqn::LqnStruct< T >::entriesof, line::lqn::LqnStruct< T >::eshift, line::lqn::LqnStruct< T >::fanin, line::lqn::LqnStruct< T >::fanout, line::lang::GlobalConstants::FineTol, line::lqn::LqnStruct< T >::graph, line::lqn::LqnStruct< T >::has_arrival, line::lqn::LqnStruct< T >::hashnames, line::lqn::LqnStruct< T >::hasretrieval, line::lqn::LqnStruct< T >::hassetup, line::lqn::LqnStruct< T >::hostdem, line::lqn::LqnStruct< T >::hshift, line::lqn::Distrib< T >::immediate(), line::InputError::InputError(), line::lqn::LqnStruct< T >::isasynccaller, line::lqn::LqnStruct< T >::iscache, line::lqn::LqnStruct< T >::iscaller, line::lqn::LqnStruct< T >::isref, line::lqn::LqnStruct< T >::issynccaller, line::lqn::LqnStruct< T >::itemcap, line::lqn::LqnStruct< T >::itemproc, line::lqn::LqnStruct< T >::jdscaling, line::lqn::LqnStruct< T >::jdscalingpeak, line::lqn::LqnStruct< T >::lincon_A, line::lqn::LqnStruct< T >::lincon_b, line::lqn::LqnStruct< T >::lldscaling, lqn_finalize(), lqn_sustainable_mult(), line::Matrix< T >::Matrix(), line::lqn::LqnStruct< T >::maxmult, line::lqn::LqnStruct< T >::mult, line::lqn::LqnStruct< T >::nacts, line::lqn::LqnStruct< T >::names, line::lqn::LqnStruct< T >::ncalls, line::lqn::LqnStruct< T >::nentries, line::lqn::LqnStruct< T >::nhosts, line::lqn::LqnStruct< T >::nidx, line::lqn::LqnStruct< T >::nitems, line::lqn::LqnStruct< T >::ntasks, line::lqn::LqnStruct< T >::parent, line::lqn::LqnStruct< T >::pools, line::lqn::LqnPrecedence< T >::postacts, line::lqn::LqnPrecedence< T >::postparams, line::lqn::LqnPrecedence< T >::posttype, line::lqn::LqnPrecedence< T >::preacts, line::lqn::LqnStruct< T >::precedences, line::lqn::LqnPrecedence< T >::preparams, line::lqn::LqnPrecedence< T >::pretype, line::lqn::LqnStruct< T >::prio, line::lqn::LqnModel< T >::proc_cdscaling, line::lqn::LqnModel< T >::proc_cdscalingpeak, line::lqn::LqnModel< T >::proc_jdscaling, line::lqn::LqnModel< T >::proc_jdscalingpeak, line::lqn::LqnModel< T >::proc_lincon, line::lqn::LqnModel< T >::proc_linconrows, line::lqn::LqnModel< T >::proc_lldscaling, line::lqn::LqnModel< T >::proc_pools, line::lqn::LqnModel< T >::procs, line::lqn::LqnStruct< T >::repl, line::lqn::LqnStruct< T >::replacestrat, line::lqn::BoolGraph::resize(), line::Matrix< T >::rows(), line::lqn::LqnStruct< T >::sched, line::lqn::BoolGraph::set(), line::lqn::LqnStruct< T >::setuptime, line::lqn::LqnCallGroup::strategy, line::lqn::LqnCallGroup::targets, line::lqn::LqnStruct< T >::taskgraph, line::lqn::LqnModel< T >::tasks, line::lqn::LqnStruct< T >::tasksof, line::lqn::LqnStruct< T >::think, line::lqn::LqnStruct< T >::tshift, and line::lqn::LqnStruct< T >::type.
Referenced by line::lqn::LqnBuilder< T >::build(), line::io::build_lqn_from_json(), line::opt::LineEvaluator::evaluate_layered_sensitivities(), line::io::lqn2java(), line::io::lqn2qn(), lqn_finalize(), read_lqnx(), read_srvn(), and write_lqnx().
| LqnMolResult< T > line::lqn::lqn_mol | ( | const LqnStruct< T > & | lsn, |
| const LqnMolOptions & | options = LqnMolOptions() ) |
Method of Layers on the SRVN decomposition of a layered queueing network whose entries carry no activity graph.
| lsn | LayeredNetworkStruct of an entry-only, closed, synchronous LQN |
| options | iteration cap, tolerance and under-relaxation factor |
Definition at line 209 of file lqn_mol.h.
References line::lqn::LqnMolResult< T >::info, lqn_mol(), line::pfqn::pfqn_qdamva(), line::lqn::LqnMolResult< T >::QN, line::pfqn::QdAmvaResult< T >::R, line::lqn::LqnMolResult< T >::RN, line::lqn::LqnMolResult< T >::TN, and line::lqn::LqnMolResult< T >::UN.
Referenced by lqn_mol().
| NlpProgram line::lqn::lqn_nlp_program | ( | const LqnStruct< T > & | lqn, |
| const NlpOptions & | opt = NlpOptions(), | ||
| const std::string & | name = "" ) |
Build the nonlinear program of a layered model: python export_nlp without the emission, i.e.
_collect + _attach_lld + the script's index sets, layout, build_linear and build_residuals.
| UnsupportedError | LINE:unsupported:NlpExport naming every feature the form cannot express, a bad fork mode or alpha, or an unusable lld |
Definition at line 1529 of file lqn_export_nlp.h.
References line::lqn::NlpProgram::Mnl::a, line::lqn::NlpProgram::Nlt::a, line::lqn::NlpProgram::act_demand, line::lqn::NlpProgram::act_entry, line::lqn::NlpProgram::act_task, line::lqn::NlpProgram::act_visits, line::lqn::NlpProgram::acts, line::lqn::NlpProgram::acts_of_entry, line::lqn::NlpProgram::acts_of_host, line::lqn::NlpProgram::AEQ, line::lqn::NlpProgram::alpha, line::lqn::NlpRate::alpha, line::lqn::NlpProgram::AUB, line::lqn::NlpProgram::BEQ, line::lqn::NlpProgram::bil, line::lqn::NlpProgram::blocks_of_entry, line::lqn::NlpProgram::blocksize, line::lqn::NlpProgram::BUB, line::lqn::NlpProgram::Mnl::c, line::lqn::NlpProgram::Nlt::c0, line::lqn::NlpProgram::call_act, line::lqn::NlpProgram::call_caller_task, line::lqn::NlpProgram::call_entry, line::lqn::NlpProgram::call_mean, line::lqn::NlpProgram::calls, line::lqn::NlpProgram::calls_into_entry, line::lqn::NlpProgram::calls_into_task, line::lqn::NlpProgram::calls_of_act, line::lqn::NlpProgram::col(), line::lqn::NlpRate::delay, line::lqn::NlpProgram::entries, line::lqn::NlpProgram::entries_of_task, line::lqn::NlpProgram::entry_order, line::lqn::NlpProgram::entry_task, line::lqn::NlpProgram::Nlt::f, line::lqn::NlpProgram::fork_acts, line::lqn::NlpProgram::fork_branches, line::lqn::NlpProgram::fork_entry, line::lqn::NlpProgram::fork_label, line::lqn::NlpProgram::gh_of, line::lqn::NlpProgram::gt_of, line::lqn::NlpProgram::host_delay, line::lqn::NlpProgram::host_delta, line::lqn::NlpProgram::host_inf, line::lqn::NlpProgram::host_lld, line::lqn::NlpProgram::host_maxmult, line::lqn::NlpProgram::host_mult, line::lqn::NlpProgram::host_ntot, line::lqn::NlpProgram::host_rate, line::lqn::NlpProgram::host_rate_capped, line::lqn::NlpProgram::hosts, line::lqn::NlpProgram::Mnl::k, line::lqn::NlpProgram::Nlt::k, line::lqn::NlpRate::lld, lqn_nlp_program(), line::lqn::NlpProgram::mnl, line::lqn::NlpRate::mult, line::lqn::NlpProgram::NA, line::lqn::NlpProgram::name, line::lqn::NlpProgram::NBLOCKS, line::lqn::NlpProgram::NC, line::lqn::NlpProgram::NE, line::lqn::NlpProgram::NFORK, line::lqn::NlpProgram::NGH, line::lqn::NlpProgram::NGT, line::lqn::NlpProgram::NH, line::lqn::NlpProgram::nlt, line::lqn::NlpProgram::NR, line::lqn::NlpProgram::NRES, line::lqn::NlpProgram::NT, line::lqn::NlpProgram::NVAR, line::lqn::NlpProgram::offset, line::lqn::NlpProgram::qbar_host_terms(), line::lqn::NlpProgram::qbar_task_terms(), line::lqn::NlpProgram::qd_hosts, line::lqn::NlpProgram::qd_tasks, line::lqn::NlpProgram::ref_entry, line::lqn::NlpProgram::ref_tasks, line::lqn::NlpProgram::res_const, line::lqn::NlpProgram::res_lin, line::lqn::NlpProgram::Mnl::s, line::lqn::NlpProgram::Nlt::s, line::lqn::NlpProgram::sent(), line::lqn::NlpProgram::seq_acts_of_entry, line::lqn::NlpProgram::sibling_acts, line::lqn::NlpProgram::sibling_calls, line::lqn::NlpProgram::task_delay, line::lqn::NlpProgram::task_delta, line::lqn::NlpProgram::task_host, line::lqn::NlpProgram::task_inf, line::lqn::NlpProgram::task_isref, line::lqn::NlpProgram::task_lld, line::lqn::NlpProgram::task_mult, line::lqn::NlpProgram::task_ntot, line::lqn::NlpProgram::task_pop, line::lqn::NlpProgram::task_rate, line::lqn::NlpProgram::task_think, and line::lqn::NlpProgram::tasks.
Referenced by lqn_nlp_program().
| LqnRefRoutes< T > line::lqn::lqn_ref_routes | ( | const LqnStruct< T > & | lqn, |
| const std::vector< std::size_t > & | callers, | ||
| double | maxpaths = 32.0, | ||
| const std::vector< std::size_t > & | server_set = {} ) |
Resolve the reference routes into the layer whose callers are CALLERS.
| lqn | the layered struct (after lqn_fwd_rendezvous, as SolverLN holds it) |
| callers | task indices that call the layer's server |
| maxpaths | refuse the layer above this many REF routes into it (default 32) |
| server_set | server elements of the layer; a prefix node whose task is one of them refuses |
A caller reachable from two REF tasks is two INDEPENDENT customer pools, and the whole LAYER falls back rather than that caller alone: a refused caller may lie on another group's path, which would count its threads twice.
Definition at line 384 of file lqn_ref_routes.h.
References lqn_ref_routes().
Referenced by lqn_ref_routes().
| std::vector< double > line::lqn::lqn_sustainable_mult | ( | const LqnStruct< T > & | l, |
| const std::vector< double > & | mult ) |
Sustainable multiplicity (lsn_max_multiplicity) of every host and task of l under the declared multiplicities mult (tshift+ntasks+1).
lqn_finalize passes l.mult; SolverLN passes them with the reference tasks trapped at a zero-capacity element set to 0, so the pools are sized without them.
Definition at line 451 of file lqn_reader.h.
References line::lsn::ACTIVITY, line::lqn::LqnStruct< T >::dag, line::lsn::ENTRY, line::lsn::Multiplicity< T >::finite(), line::lqn::LqnStruct< T >::has_arrival, line::lqn::LqnStruct< T >::hassetup, line::lsn::HOST, line::lsn::Multiplicity< T >::inf(), line::lqn::LqnStruct< T >::isref, lqn_sustainable_mult(), line::lsn::lsn_max_multiplicity(), line::lqn::LqnStruct< T >::nidx, line::lqn::LqnStruct< T >::ntasks, line::lqn::LqnStruct< T >::parent, line::lqn::LqnStruct< T >::repl, line::lsn::TASK, line::lqn::LqnStruct< T >::tshift, and line::lqn::LqnStruct< T >::type.
Referenced by lqn_finalize(), and lqn_sustainable_mult().
|
inline |
Translate an LQN XML document into SRVN text.
| xml_text | the LQN XML document |
| name | the model name for the header comment; empty means <lqn-model name> (or "model" when the root has none) |
| InputError | (LINE:input:Format) when the XML is malformed |
| UnsupportedError | (LINE:unsupported:Format) for content SRVN cannot express |
Definition at line 549 of file srvn_writer.h.
References line::lqn::srvn_detail::is_space(), LINE_SRVN_ACT_ATTRS, lqnx2srvn(), line::lqn::srvn_out::Element::name, line::lqn::srvn_out::name(), and line::xml::parse().
Referenced by line::io::lqnx2srvn(), lqnx2srvn(), and write_srvn().
| std::string line::lqn::lqnx_to_string | ( | const LqnModel< T > & | m, |
| const std::string & | model_name = std::string("LQN"), | ||
| bool | use_abstract_names = false ) |
The .lqnx document as a STRING, for a caller with no file to write to – the CLI's model-generation mode hands the XML back through its JSON envelope, and a test can compare documents without a temporary directory.
Definition at line 666 of file lqn_writer.h.
References lqnx_to_string(), and write_lqnx().
Referenced by lqnx_to_string(), run_generate(), and write_srvn().
| LqnStruct< T > line::lqn::read_lqnx | ( | const std::string & | path | ) |
Read a .lqnx model.
| path | file to read |
Definition at line 1752 of file lqn_reader.h.
References lqn_finalize(), read_lqnx(), and read_lqnx_model().
Referenced by line::io::read_layered_model(), and read_lqnx().
| LqnModel< T > line::lqn::read_lqnx_model | ( | const std::string & | path | ) |
read_lqnx_model on a .lqnx file.
Definition at line 1735 of file lqn_reader.h.
References line::xml::parse_file(), read_lqnx_model(), and read_lqnx_model_doc().
Referenced by read_lqnx(), line::io::read_lqnx_model(), and read_lqnx_model().
| LqnModel< T > line::lqn::read_lqnx_model_doc | ( | std::unique_ptr< xml::Element > | doc | ) |
Definition at line 1390 of file lqn_reader.h.
References line::lqn::LqnModel< T >::acts, line::xml::Element::attr(), line::xml::Element::by_tag(), line::xml::Element::child_tags(), line::dbl_from_decimal(), line::lqn::LqnModel< T >::entries, line::lqn::Distrib< T >::exp_mean(), line::lqn::Distrib< T >::exp_rate(), line::lqn::Distrib< T >::immediate(), line::InputError::InputError(), line::num_from_decimal(), line::lqn::LqnModel< T >::procs, read_lqnx_model_doc(), line::lang::sched_from_lqnx(), and line::lqn::LqnModel< T >::tasks.
Referenced by read_lqnx_model(), read_lqnx_model_doc(), and read_lqnx_model_text().
| LqnModel< T > line::lqn::read_lqnx_model_text | ( | const std::string & | text | ) |
read_lqnx_model on a .lqnx document held in a string (the SRVN reader's translation, for one).
Definition at line 1741 of file lqn_reader.h.
References line::xml::parse(), read_lqnx_model_doc(), and read_lqnx_model_text().
Referenced by read_lqnx_model_text(), and read_srvn_model().
| LqnStruct< T > line::lqn::read_srvn | ( | const std::string & | path | ) |
read_srvn_model followed by lqn_finalize: the struct SolverLN consumes, as read_lqnx is.
Definition at line 1346 of file srvn_reader.h.
References lqn_finalize(), read_srvn(), and read_srvn_model().
Referenced by line::io::read_layered_model(), and read_srvn().
| LqnModel< T > line::lqn::read_srvn_model | ( | const std::string & | path | ) |
Read an SRVN file (.in, or a .lqn that is not XML) into the intermediate LqnModel, via its .lqnx translation.
Definition at line 1340 of file srvn_reader.h.
References read_lqnx_model_text(), read_srvn_model(), and srvn_file_to_lqnx().
Referenced by read_srvn(), line::io::read_srvn_model(), and read_srvn_model().
|
inline |
Translate SRVN text into an LQN XML document.
| src | the SRVN document text |
| name | the model name written to <lqn-model name=...> |
| InputError | (LINE:input:Format) on a syntax or reference error |
| UnsupportedError | (LINE:unsupported:Format) when the model uses a SPEX sweep |
Definition at line 1239 of file srvn_reader.h.
References srvn2lqnx().
Referenced by line::io::srvn2lqnx(), srvn2lqnx(), and srvn_file_to_lqnx().
|
inline |
Translate the SRVN file path to .lqnx text, model name = its basename without extension.
Errors name the file: "SRVN <path> (line n): ...".
Definition at line 1319 of file srvn_reader.h.
References line::InputError::InputError(), line::Error::kind(), line::lqn::srvn_detail::read_text(), srvn2lqnx(), srvn_file_to_lqnx(), line::lqn::srvn_detail::stem(), and line::UnsupportedError::UnsupportedError().
Referenced by read_srvn_model(), run_invocation(), and srvn_file_to_lqnx().
| LqnWriteReport line::lqn::write_lqnx | ( | const LqnModel< T > & | m, |
| const std::string & | path, | ||
| const std::string & | model_name = std::string("LQN"), | ||
| bool | use_abstract_names = false, | ||
| std::string * | out_text = NULL ) |
Write a layered model as a .lqnx document.
| m | the intermediate model, from the builder or from read_lqnx_model |
| path | file to create |
| model_name | the name attribute of <lqn-model> |
| use_abstract_names | rename elements P1/T1/E1/A1, as writeXML's third argument does, for a document that is compared rather than read |
| out_text | when non-null, the document is SERIALIZED INTO IT and no file is written (path is then ignored). The tree cannot be returned instead: xml::Element owns its children through unique_ptr and they hold raw parent back pointers, so a moved tree dangles. |
Definition at line 220 of file lqn_writer.h.
References line::lqn::LqnModel< T >::acts, line::xml::Element::add_child(), line::lqn::LqnWriteReport::dropped, line::lqn::LqnModel< T >::entries, line::lang::GlobalConstants::FineTol, line::InputError::InputError(), lqn_finalize(), line::xml::Element::name, line::lqn::LqnModel< T >::proc_cdscaling, line::lqn::LqnModel< T >::proc_jdscaling, line::lqn::LqnModel< T >::proc_lincon, line::lqn::LqnModel< T >::proc_linconrows, line::lqn::LqnModel< T >::proc_lldscaling, line::lqn::LqnModel< T >::proc_pools, line::lqn::LqnModel< T >::procs, line::lang::sched_to_lqnx(), line::xml::serialize(), line::xml::Element::set_attr(), line::lqn::LqnModel< T >::tasks, line::UnsupportedError::UnsupportedError(), line::xml::write_file(), and write_lqnx().
Referenced by lqnx_to_string(), line::lqns::SolverLQNS< T >::run_analyzer(), line::io::write_lqnx(), and write_lqnx().
| void line::lqn::write_srvn | ( | const LqnModel< T > & | m, |
| const std::string & | path, | ||
| bool | use_abstract_names = false ) |
Write a layered model as SRVN text: write_lqnx, then lqnx2srvn, with LF line endings.
| m | the intermediate model |
| path | file to create |
| use_abstract_names | rename elements P1/T1/E1/A1 first, which also makes every name an LQNS identifier |
| UnsupportedError | (LINE:unsupported:Format) for content SRVN cannot express |
Definition at line 785 of file srvn_writer.h.
References line::InputError::InputError(), lqnx2srvn(), lqnx_to_string(), line::lqn::LqnModel< T >::name, and write_srvn().
Referenced by line::io::write_srvn(), and write_srvn().