LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::fj Namespace Reference

Classes

struct  FJAmvaResult
 [R, Q, X, U] of fj_amva. More...
struct  FJBoundsResult
 [Rmax, Rmin] of fj_bounds: pessimistic and optimistic response-time bounds. More...
struct  FJCharMaxBlomResult
 [mK, lo, hi] of fj_char_max_blom; lo and hi are NaN below K = 5. More...
struct  FJCharMaxDiscreteResult
 [MK, mK, exact] of fj_char_max_discrete. More...
struct  FJCharMaxResult
 [MK, mK] of fj_char_max: characteristic maximum and its threshold. More...
struct  FjCodesGenService
 generateService.m: the service process seen by a tagged job. More...
struct  FjCodesPercentiles
 One line of mainFJ's output cell: the percentiles of a K-node queue. More...
struct  FjCodesPi
 What computePi.m returns. More...
struct  FjCodesRT2
 What returnRT2.m produces, plus the waiting-time law it discards. More...
struct  FjCodesSA
 build_SA.m: the level-constant generator and the head-of-line jump. More...
struct  FjCodesServiceH
 build_Service_h.m: the two-subtask phase process of one fork-join job. More...
struct  FjCodesSRK
 constructSRK.m: the extended generator and the busy/idle projectors. More...
struct  FjCodesT
 What computeT.m returns. More...
struct  FjCodesWait
 What returnWait.m returns: the waiting time as a phase-type law. More...
struct  FJCoxFitResult
 [mu1, mu2, q, kmin, kmax] of fj_cox_fit. More...
struct  FJDagMakespanResult
 [C, I, Cend, E] of fj_dag_makespan. More...
struct  FJDelayOptResult
 [d, Edisp, Emax] of fj_delay_opt. More...
struct  FJDispersionResult
 [Edisp, Emax, Emin] of fj_dispersion. More...
struct  FjDist
 Descriptor of an arrival or a service process. More...
struct  FJGKBoundResult
 All four G(K) factors of fj_gk_bound in its 'all' mode. More...
struct  FJIsmGreenResult
 Everything Green's cycle decomposition produces. More...
struct  FJOrderStatResult
 [F_Yk, E_Yk] of fj_order_stat. More...
struct  FJQgbResult
 [Q, y] of fj_qgb: the bounded queue lengths and the geometric ratios. More...
struct  FJQuorumMomentsResult
 [m, v] of fj_quorum_moments: mean and variance of the k-of-n join time. More...
struct  FJResptBulkResult
 [Rreq, Rtask, Q, p] of fj_respt_bulk. More...
struct  FJResptClosedResult
 [R, exact] of fj_respt_closed. More...
struct  FJResptNosplitResult
 [R, rho] of fj_respt_nosplit. More...
struct  FJSerializationResult
 [P, delay, Rtot] of fj_serialization. More...
struct  FJTsmCapacityResult
 [Lmax, Llp, Lfcfs, states, prob] of fj_tsm_capacity. More...
struct  FJXmaxApproxResult
 [Xmax, GK] of fj_xmax_approx. More...
struct  FJXmaxCoxianResult
 [Xmax, m1, c2] of fj_xmax_coxian. More...
struct  FJXmaxHzResult
 [Xmax, resid] of fj_xmax_hz. More...
struct  FJXmaxNormalResult
 [Xmax, Vmax] of fj_xmax_normal. More...
struct  FJXmaxParetoResult
 [Xmax, MK] of fj_xmax_pareto. More...
struct  ForkTailResult
 Mirrors MATLAB's [xp, alpha, beta] return list. More...
struct  LqnBranchView
 The four LayeredNetworkStruct fields fj_branch_members reads. More...
struct  Mg1ResptMoments
 Mirrors MATLAB's [ET, VT] return list. More...

Enumerations

enum  ActivityPrecedenceCode {
  APC_PRE_SEQ = 1 , APC_PRE_AND = 2 , APC_PRE_OR = 3 , APC_POST_SEQ = 11 ,
  APC_POST_AND = 12 , APC_POST_OR = 13 , APC_POST_LOOP = 14 , APC_POST_CACHE = 15
}
 MATLAB's ActivityPrecedenceType codes, as stored in lqn.actposttype. More...
enum class  FJDiscreteDist { Geometric , Poisson }
 The lattice laws for which the characteristic maximum is closed. More...
enum class  FjTMode { Nare , Sylvester }
 Which route computeT.m takes to the T matrix. More...
enum class  FjProcType { Exp = 0 , Erlang = 1 , HyperExp = 2 , Map = 5 }
 The subset of ProcessType that the fork-join algorithm accepts. More...
enum class  FjDistKind { Arrival , Service }
 Which of the two descriptors to build. More...
enum class  FJDistType { Exp , Uniform , Evd , Bound }
 Distribution families for which a G(K) standardized-maximum factor exists. More...
enum class  FJNormalMethod { Johnson , Arnold , Corrected }
 Bracketing methods for the normal-maximum approximation. More...

Functions

template<class T>
FJAmvaResult< T > fj_amva (const std::vector< T > &D, const std::vector< unsigned > &P, unsigned M, const T &Z)
 Mean value analysis of a closed network of fork-join subnetworks.
template<class T>
FJBoundsResult< T > fj_bounds (unsigned K, const T &lambda, const T &mu)
 Upper and lower bounds on the mean response time of a K-way fork-join system of M/M/1 branches.
template<class T>
std::vector< std::vector< std::size_t > > fj_branch_members (const LqnBranchView< T > &lqn, std::size_t joinaidx)
 Branch membership of an AND-join.
template<class T>
FJCharMaxResult< T > fj_char_max (unsigned K, const T &mu)
 Exponential branch.
template<class T>
FJCharMaxResult< T > fj_char_max (unsigned K, unsigned k, const T &mu)
 Erlang-k branch.
template<class T>
FJCharMaxBlomResult< T > fj_char_max_blom (unsigned K, const std::function< T(const T &)> &Finv=std::function< T(const T &)>(), const T &alpha=num_traits< T >::from_double(0.4886), const T &beta=num_traits< T >::from_double(0.3140))
 Blom-corrected plotting position for the characteristic maximum.
template<class T>
FJCharMaxDiscreteResult< T > fj_char_max_discrete (unsigned K, FJDiscreteDist dist, const T &par)
 Characteristic maximum of a lattice random variable.
FjTMode fj_parse_tmode (const std::string &s)
 Parse the reference's T_Mode string, whose default is 'NARE'.
Matrix< double > fj_compute_t_nare (const Matrix< double > &D0, const Matrix< double > &D1, const Matrix< double > &S, const Matrix< double > &A_jump, double *residual)
 Port of computeT_NARE.m: the T matrix as the stable invariant subspace of.
FjCodesT fj_compute_t (const FjDist< double > &arrival, const FjDist< double > &service, const FjCodesServiceH &h, std::size_t C, FjTMode mode)
 Port of computeT.m.
std::vector< double > fj_boundary_solve (const Matrix< double > &pi0mat, const Matrix< double > &T)
 The boundary solve both branches of computePi.m end with:
FjCodesPi fj_compute_pi (const Matrix< double > &T, const FjDist< double > &arrival, const FjDist< double > &service, const FjCodesServiceH &h, std::size_t C, const Matrix< double > &S, const Matrix< double > &A_jump)
 Port of computePi.m: the all-busy boundary vector and E[n1].
FjCodesWait fj_return_wait (double En1, const std::vector< double > &pi0, const Matrix< double > &T, const std::vector< double > &phi, const std::vector< double > &sum_Ajump)
 Port of returnWait.m: the stationary waiting time as a phase-type law.
std::vector< double > fj_return_per (const std::vector< double > &vec, const Matrix< double > &A, const std::vector< double > &pers)
 Port of returnPer.m: the percentiles of a (possibly defective) phase-type law, by uniformization.
std::vector< double > fj_return_rt1 (const FjDist< double > &arrival, const FjDist< double > &service, const std::vector< double > &pers)
 Port of returnRT1.m: the response-time percentiles of the ONE-node queue, which are exact.
FjCodesRT2 fj_return_rt2 (const FjDist< double > &arrival, const FjDist< double > &service, const std::vector< double > &pers, std::size_t C, FjTMode mode)
 Port of returnRT2.m: the response-time percentiles of the TWO-node fork-join queue, under the Section 4 approximation.
std::vector< FjCodesPercentilesfj_main (const FjDist< double > &arrival, const FjDist< double > &service, const std::vector< double > &pers, const std::vector< std::size_t > &K, const std::vector< std::size_t > &Cs, FjTMode mode)
 Port of mainFJ.m: the response-time percentiles of a K-node fork-join queue, interpolated between the exact one-node and the approximate two-node results in log K.
Matrix< double > fj_build_index (std::size_t m, std::size_t cr)
 Port of build_index.m: the compositions of cr into m non-negative parts, one per row, in the reference's own order.
std::size_t fj_vectmatch (const std::vector< double > &row, const Matrix< double > &matrix)
 Port of vectmatch.m: the row of matrix equal to row.
Matrix< double > fj_restart_matrix (const FjDist< double > &service)
 The reference's A = -sum(ST, 2) * tau_st: complete, then restart.
FjCodesServiceH fj_build_service_h (const FjDist< double > &service)
 Port of build_Service_h.m.
FjCodesSA fj_build_sa (const FjDist< double > &service, const FjCodesServiceH &h, std::size_t C)
 Port of build_SA.m.
void fj_busy_to_idle (const FjDist< double > &service, const FjCodesServiceH &h, const Matrix< double > &idle_phases, Matrix< double > &S_long, Matrix< double > &S_last)
 The busy-to-not-busy blocks S_long and S_last, shared verbatim by generateService.m and constructSRK.m.
FjCodesGenService fj_generate_service (const FjDist< double > &service, const FjCodesServiceH &h, std::size_t C, const Matrix< double > &S)
 Port of generateService.m.
Matrix< double > fj_construct_not_all_busy (std::size_t C, const FjDist< double > &service, const FjCodesServiceH &h)
 Port of constructNotAllBusy.m.
FjCodesSRK fj_construct_srk (std::size_t C, const FjDist< double > &service, const FjCodesServiceH &h, const Matrix< double > &S)
 Port of constructSRK.m.
template<class T>
FJCoxFitResult< T > fj_cox_fit (const T &m1, const T &c2)
 Two-stage Coxian fit of a mean and a squared coefficient of variation.
template<class T>
FJDagMakespanResult< T > fj_dag_makespan (const Matrix< T > &pred, const Matrix< T > &rate)
 Makespan of a task system with precedence constraints.
template<class T>
FJDelayOptResult< T > fj_delay_opt (const std::vector< unsigned > &shape, const std::vector< T > &rate, unsigned maxsweeps=40, const T &dtol=num_traits< T >::from_double(1e-8), unsigned npanels=2000)
 Deterministic subtask delays that minimise mean dispersion.
template<class T>
FJDispersionResult< T > fj_dispersion (const std::vector< unsigned > &shape, const std::vector< T > &rate, const std::vector< T > &d, const T &tol=num_traits< T >::from_double(1e-10), unsigned npanels=4000)
 Mean subtask dispersion of a split-merge system with Erlang branches.
template<class T>
FJDispersionResult< T > fj_dispersion (const std::vector< unsigned > &shape, const std::vector< T > &rate)
 The undelayed system, d = 0.
template<class T>
FjDist< T > fj_dist2fj (const mam::Map< T > &m, FjDistKind kind, FjProcType procType)
 Build the fork-join descriptor of a MAP.
template<class T>
FJGKBoundResult< T > fj_gk_bound (unsigned K)
 G(K) factors for the standardized-maximum approximation X_K^max ~ mu.
template<class T>
fj_gk_bound (unsigned K, FJDistType type)
 Single-family accessor, matching MATLAB's 'exp'/'uniform'/'evd'/'bound' modes.
template<class T>
fj_harmonic (unsigned K)
 Harmonic number H_K = sum_{k=1..K} 1/k.
template<class T>
FJIsmGreenResult< T > fj_ism_green (const T &lambda, const T &mu, unsigned s, const std::vector< T > &c)
 Green's independent server model of simultaneous server requests.
template<class T>
fj_lst_max_het (const std::vector< T > &lambda, const T &s)
 Laplace-Stieltjes transform of the maximum of heterogeneous exponentials.
template<class T>
Mg1ResptMoments< T > fj_mg1_respt_moments (const T &lambda, const T &ES, const T &ES2, const T &ES3)
 Mean and variance of the M/G/1 response time, as ForkTail inputs.
template<class T>
FJOrderStatResult< T > fj_order_stat (const T &y, unsigned k, unsigned K, const std::function< T(const T &)> &F_X)
 CDF and expected value of the k-th order statistic of K i.i.d.
template<class T>
fj_ordstat_exp (const std::vector< T > &ri, std::size_t k)
 Mean of the k-th smallest of n independent EXPONENTIAL branch completion times, i.e.
template<class T>
FJQgbResult< T > fj_qgb (const std::vector< T > &D, const std::vector< unsigned > &P, unsigned M, const T &Z)
 Geometric bound on the queue length of a fork-join subnetwork.
template<class T>
fj_quantile (unsigned K, const T &q)
 Gumbel approximation.
template<class T>
fj_quantile (unsigned K, const T &q, const std::function< T(const T &)> &Finv)
 Exact quantile through the supplied inverse CDF.
template<class T>
FJQuorumMomentsResult< T > fj_quorum_moments (const std::vector< T > &branchMeans, const std::vector< T > &branchVars, std::size_t k)
 Mean and variance of a k-of-n (quorum) join completion time, from the mean and variance of each branch.
template<class T>
fj_respt_2way (const T &lambda, const T &mu)
 Exact mean response time of a 2-way fork-join system of M/M/1 branches.
template<class T>
FJResptBulkResult< T > fj_respt_bulk (unsigned K, const T &lambda, const T &mu, unsigned c, std::size_t nmax=0)
 Centralized splitting analysed as an M[K]/M/c bulk arrival system.
template<class T>
FJResptClosedResult< T > fj_respt_closed (unsigned K, const T &x, unsigned M, const T &A)
 Varki bound on the residence time of a closed fork-join subnetwork.
template<class T>
FJResptClosedResult< T > fj_respt_closed (unsigned K, const T &x, unsigned M)
 The isolated parallel subsystem of Theorem 4.1, where A = M-1.
template<class T>
FJResptNosplitResult< T > fj_respt_nosplit (unsigned K, const T &lambda, const T &mu)
 Mean response time of the distributed no-splitting parallel system.
template<class T>
fj_respt_nt (unsigned K, const T &lambda, const T &mu)
 Nelson-Tantawi approximation to the mean response time of a K-way fork-join system of M/M/1 branches.
template<class T>
fj_respt_varki (unsigned K, const T &lambda, const T &mu)
 Varki approximation to the mean response time of a K-way fork-join system of M/M/1 branches.
template<class T>
fj_respt_vm (unsigned K, const T &lambda, const T &mu)
 Varma-Makowski light-traffic interpolation for the mean response time of a K-way fork-join system of M/M/1 branches.
template<class T>
fj_rmax (unsigned K, const T &lambda, const T &mu)
 Pessimistic (independence) fork-join response time: the expected maximum of K independent M/M/1 response times, each exponential with rate mu - lambda.
template<class T>
fj_rmax_erlang (unsigned K, unsigned k, const T &lambda, const T &mu)
 Expected maximum of K M/E_k/1 branch response times.
template<class T>
fj_rmax_evd (unsigned K, const T &R, const T &sigma_R, bool calibrated=false)
 Extreme-value approximation to the maximum of K branch response times, from their mean and standard deviation.
template<class T>
FJSerializationResult< T > fj_serialization (const std::vector< T > &Rs, const T &R0, unsigned M, const T &alpha=num_traits< T >::from_double(0.5))
 Blocking probability and pseudoserver delay of serialization phases.
template<class T>
fj_sm_tput (unsigned K, const T &mu)
 Saturated (single-message) maximum throughput of a K-way fork-join system with exponential branch service.
template<class T>
fj_synch_delay (const T &lambda, const T &mu)
 Mean synchronization delay of a 2-way fork-join system of M/M/1 branches, i.e.
template<class T>
ForkTailResult< T > fj_tail_forktail (const std::vector< T > &ET, const std::vector< T > &VT, const std::vector< T > &K=std::vector< T >(), const T &p_in=num_traits< T >::from_int(99), const std::vector< T > &P=std::vector< T >())
 ForkTail black-box tail-latency approximation for fork-join requests.
template<class T>
ForkTailResult< T > fj_tail_forktail (const T &ET, const T &VT, const T &K, const T &p=num_traits< T >::from_int(99))
 Homogeneous convenience overload with a scalar mean, variance and fanout.
template<class T>
ForkTailResult< T > fj_tail_ordstat (const std::vector< T > &ET, const std::vector< T > &VT, std::size_t K=1, const T &p_in=num_traits< T >::from_int(99), std::size_t kreq=0)
 Tail latency of a k-of-n (QUORUM) fork-join request.
template<class T>
FJTsmCapacityResult< T > fj_tsm_capacity (unsigned s, const std::vector< T > &f, const std::vector< unsigned > &r, const std::vector< T > &x)
 Saturation throughput of the team service model.
template<class T>
fj_xmax_2 (const T &lambda1, const T &lambda2)
 Expected maximum of two independent, possibly unequal-rate exponentials.
template<class T>
fj_xmax_2 (const T &lambda)
 Equal-rate overload, matching MATLAB's single-argument call.
template<class T>
FJXmaxApproxResult< T > fj_xmax_approx (unsigned K, const T &mu_X, const T &sigma_X, FJDistType type=FJDistType::Exp)
 Two-moment approximation to the expected maximum of K i.i.d.
template<class T>
FJXmaxCoxianResult< T > fj_xmax_coxian (unsigned K, const T &mu1, const T &mu2, const T &q)
 Expected maximum of K i.i.d.
template<class T>
fj_xmax_emma (unsigned K, const T &mu)
 Exponential branch.
template<class T>
fj_xmax_emma (unsigned K, const std::function< T(const T &)> &Finv)
 General branch: the caller supplies the quantile function F^{-1}.
template<class T>
fj_xmax_erlang (unsigned K, unsigned k, const T &mu)
 Expected maximum of K i.i.d.
template<class T>
fj_xmax_exp (unsigned K, const T &mu)
 Expected maximum of K i.i.d.
template<class T>
fj_xmax_het (const std::vector< T > &lambda, unsigned n=1)
 Exact moments of the maximum of heterogeneous exponentials.
template<class T>
fj_xmax_hyperexp (unsigned K, const T &p1, const T &mu1, const T &mu2)
 Expected maximum of K i.i.d.
template<class T>
FJXmaxHzResult< T > fj_xmax_hz (const T &m1, const T &m2, unsigned K)
 Harrison-Zertal approximation of the maximum of i.i.d.
template<class T>
fj_xmax_hz_het (const std::vector< T > &m1, const std::vector< T > &m2, const std::vector< std::function< T(const T &)> > &cdf, const T &tol=num_traits< T >::from_double(1e-10), unsigned npanels=2000)
 Harrison-Zertal approximation of the maximum of general variables.
template<class T>
std::vector< T > fj_xmax_moments_het (const std::vector< T > &lambda, unsigned n=1)
 Moments of the maximum of heterogeneous exponentials by recurrence.
template<class T>
FJXmaxNormalResult< T > fj_xmax_normal (unsigned K, const T &mu, const T &sigma, FJNormalMethod method=FJNormalMethod::Johnson)
 Expected maximum and variance of K i.i.d.
template<class T>
FJXmaxParetoResult< T > fj_xmax_pareto (unsigned K, const T &beta, const T &k)
 Expected maximum and characteristic maximum of K i.i.d.
template<class T>
FJXmaxParetoResult< T > fj_xmax_pareto (unsigned K, const T &beta)
 MATLAB's default scale k = beta - 1, which normalizes the branch mean to 1.

Variables

static const std::size_t FJ_ORDSTAT_MAX_EXACT = 15
 Branch count above which a genuine quorum leaves the exact alternating sum.
constexpr std::size_t FJ_QUORUM_MAX_BRANCHES = 512
 Branch counts above this are refused: evaluation is cubic in n.

Enumeration Type Documentation

◆ ActivityPrecedenceCode

MATLAB's ActivityPrecedenceType codes, as stored in lqn.actposttype.

Enumerator
APC_PRE_SEQ 
APC_PRE_AND 
APC_PRE_OR 
APC_POST_SEQ 
APC_POST_AND 
APC_POST_OR 
APC_POST_LOOP 
APC_POST_CACHE 

Definition at line 50 of file fj_branch_members.h.

◆ FJDiscreteDist

enum class line::fj::FJDiscreteDist
strong

The lattice laws for which the characteristic maximum is closed.

Enumerator
Geometric 
Poisson 

Definition at line 41 of file fj_char_max_discrete.h.

◆ FjDistKind

enum class line::fj::FjDistKind
strong

Which of the two descriptors to build.

Enumerator
Arrival 
Service 

Definition at line 68 of file fj_dist2fj.h.

◆ FJDistType

enum class line::fj::FJDistType
strong

Distribution families for which a G(K) standardized-maximum factor exists.

Enumerator
Exp 
Uniform 
Evd 
Bound 

Definition at line 41 of file fj_types.h.

◆ FJNormalMethod

enum class line::fj::FJNormalMethod
strong

Bracketing methods for the normal-maximum approximation.

Enumerator
Johnson 
Arnold 
Corrected 

Definition at line 44 of file fj_types.h.

◆ FjProcType

enum class line::fj::FjProcType
strong

The subset of ProcessType that the fork-join algorithm accepts.

The values are MATLAB's ProcessType codes (EXP = 0, ERLANG = 1, HYPEREXP = 2, MAP = 5), so a caller holding sn.procid can pass it through unchanged.

Enumerator
Exp 
Erlang 
HyperExp 
Map 

Definition at line 65 of file fj_dist2fj.h.

◆ FjTMode

enum class line::fj::FjTMode
strong

Which route computeT.m takes to the T matrix.

Enumerator
Nare 
Sylvester 

Definition at line 102 of file fj_codes.h.

Function Documentation

◆ fj_amva()

template<class T>
FJAmvaResult< T > line::fj::fj_amva ( const std::vector< T > & D,
const std::vector< unsigned > & P,
unsigned M,
const T & Z )

Mean value analysis of a closed network of fork-join subnetworks.

Parameters
Dper-visit service demand of each subnetwork
Pfork degree of each subnetwork, P[n] >= 1
Mnumber of circulating jobs, M >= 1
Zthink time, Z >= 0
Returns
residence times, queue lengths, throughput and per-queue utilizations

Definition at line 55 of file fj_amva.h.

References fj_amva(), fj_harmonic(), line::InputError::InputError(), line::NumericError::NumericError(), line::fj::FJAmvaResult< T >::Q, line::fj::FJAmvaResult< T >::R, line::fj::FJAmvaResult< T >::U, and line::fj::FJAmvaResult< T >::X.

Referenced by fj_amva().

◆ fj_boundary_solve()

std::vector< double > line::fj::fj_boundary_solve ( const Matrix< double > & pi0mat,
const Matrix< double > & T )
inline

The boundary solve both branches of computePi.m end with:

pi0 [ pi0mat - I , T^-1 e ] = [ 0 ... 0 , -1 ]

an OVERDETERMINED system by one column, which MATLAB's mrdivide answers in the least-squares sense. It is consistent – the extra column is the normalization that fixes the scale of the null vector – so least squares returns the exact solution and not an approximation.

Definition at line 358 of file fj_codes.h.

References line::Matrix< T >::cols(), fj_boundary_solve(), line::InputError::InputError(), line::inverse(), line::lstsq(), line::Matrix< T >::rows(), line::Matrix< T >::transpose(), and line::LstsqResult< T >::x.

Referenced by fj_boundary_solve(), and fj_compute_pi().

◆ fj_bounds()

template<class T>
FJBoundsResult< T > line::fj::fj_bounds ( unsigned K,
const T & lambda,
const T & mu )

Upper and lower bounds on the mean response time of a K-way fork-join system of M/M/1 branches.

Parameters
Knumber of parallel branches, K >= 1
lambdaarrival rate
muper-branch service rate, mu > lambda for stability
Returns
Rmax (pessimistic) and Rmin (optimistic) bounds

Definition at line 44 of file fj_bounds.h.

References fj_bounds(), fj_harmonic(), and line::NumericError::NumericError().

Referenced by fj_bounds().

◆ fj_branch_members()

template<class T>
std::vector< std::vector< std::size_t > > line::fj::fj_branch_members ( const LqnBranchView< T > & lqn,
std::size_t joinaidx )

Branch membership of an AND-join.

Parameters
lqnthe four fields listed above
joinaidxabsolute 1-based index of the AND-join activity
Returns
one vector per branch, head last: entry 0 is the tail (the immediate predecessor of the join) and the last entry is the branch head, which is the order the reference builds the chain in

Definition at line 86 of file fj_branch_members.h.

References APC_POST_AND, fj_branch_members(), and line::InputError::InputError().

Referenced by fj_branch_members().

◆ fj_build_index()

Matrix< double > line::fj::fj_build_index ( std::size_t m,
std::size_t cr )
inline

Port of build_index.m: the compositions of cr into m non-negative parts, one per row, in the reference's own order.

FJ_codes calls this with cr = 1 only, where it is the identity matrix and the rows are the m single-subtask phases. The general case is ported because it is what the reference computes, and because the row ORDER is what vectmatch resolves against: any other enumeration of the same set would permute every block of every matrix below.

Definition at line 99 of file fj_codes_matrices.h.

References fj_build_index(), and line::InputError::InputError().

Referenced by fj_build_index(), fj_build_service_h(), fj_construct_not_all_busy(), fj_construct_srk(), and fj_generate_service().

◆ fj_build_sa()

FjCodesSA line::fj::fj_build_sa ( const FjDist< double > & service,
const FjCodesServiceH & h,
std::size_t C )
inline

Port of build_SA.m.

C is the truncation of the queue-length difference and must be at least one: the reference indexes A_jump((C-1)*dim+1 : C*dim) unconditionally, so C = 0 is an out-of-range write there rather than a degenerate model here.

Definition at line 190 of file fj_codes_matrices.h.

References line::fj::FjCodesSA::A_jump, line::fj::FjCodesServiceH::beta, fj_build_sa(), fj_restart_matrix(), fj_vectmatch(), line::InputError::InputError(), line::fj::FjCodesSA::S, line::fj::FjCodesServiceH::S, line::fj::FjCodesServiceH::service_phases, and line::fj::FjDist< T >::tau_st.

Referenced by fj_build_sa(), and fj_compute_t().

◆ fj_build_service_h()

◆ fj_busy_to_idle()

void line::fj::fj_busy_to_idle ( const FjDist< double > & service,
const FjCodesServiceH & h,
const Matrix< double > & idle_phases,
Matrix< double > & S_long,
Matrix< double > & S_last )
inline

The busy-to-not-busy blocks S_long and S_last, shared verbatim by generateService.m and constructSRK.m.

S_long: the subtask in the SHORTER queue completes while c > 0, so the remaining subtask is the one that was in the longer queue. S_last: the two queues have equal length, so either subtask may be the one that completes and the other one is what remains.

Definition at line 284 of file fj_codes_matrices.h.

References line::fj::FjCodesServiceH::beta, fj_busy_to_idle(), fj_vectmatch(), line::Matrix< T >::rows(), line::fj::FjCodesServiceH::service_phases, line::fj::FjDist< T >::St, and line::fj::FjDist< T >::tau_st.

Referenced by fj_busy_to_idle(), fj_construct_srk(), and fj_generate_service().

◆ fj_char_max() [1/2]

template<class T>
FJCharMaxResult< T > line::fj::fj_char_max ( unsigned K,
const T & mu )

Exponential branch.

Parameters
Knumber of samples, K >= 1
murate, > 0
Returns
[MK, mK]

Definition at line 55 of file fj_char_max.h.

References fj_char_max(), fj_harmonic(), and line::InputError::InputError().

Referenced by fj_char_max(), and fj_char_max().

◆ fj_char_max() [2/2]

template<class T>
FJCharMaxResult< T > line::fj::fj_char_max ( unsigned K,
unsigned k,
const T & mu )

Erlang-k branch.

Parameters
Knumber of samples, K >= 1
kErlang stages, k >= 1
muper-stage rate, > 0
Returns
[MK, mK]

Definition at line 73 of file fj_char_max.h.

References fj_char_max(), line::InputError::InputError(), line::num_factorial(), and line::num_pow_int().

◆ fj_char_max_blom()

template<class T>
FJCharMaxBlomResult< T > line::fj::fj_char_max_blom ( unsigned K,
const std::function< T(const T &)> & Finv = std::function<T(const T&)>(),
const T & alpha = num_traits<T>::from_double(0.4886),
const T & beta = num_traits<T>::from_double(0.3140) )

Blom-corrected plotting position for the characteristic maximum.

Parameters
Finvquantile function; an empty target selects the standard normal
Knumber of i.i.d. copies, K >= 1
alphaBlom numerator offset
betaBlom denominator offset
Returns
the corrected position and, for the normal, its bracket

Definition at line 54 of file fj_char_max_blom.h.

References line::fj::FJCharMaxBlomResult< T >::bracket_available, fj_char_max_blom(), line::fj::FJCharMaxBlomResult< T >::hi, line::fj::FJCharMaxBlomResult< T >::lo, line::fj::FJCharMaxBlomResult< T >::mK, and line::NumericError::NumericError().

Referenced by fj_char_max_blom().

◆ fj_char_max_discrete()

template<class T>
FJCharMaxDiscreteResult< T > line::fj::fj_char_max_discrete ( unsigned K,
FJDiscreteDist dist,
const T & par )

Characteristic maximum of a lattice random variable.

Parameters
Knumber of i.i.d. copies, K >= 1
distthe lattice law
parp in (0,1) for the geometric, theta > 0 for the Poisson
Returns
characteristic maximum, its threshold, and the exact maximum

Definition at line 60 of file fj_char_max_discrete.h.

References line::fj::FJCharMaxDiscreteResult< T >::exact, fj_char_max_discrete(), Geometric, line::InputError::InputError(), line::fj::FJCharMaxDiscreteResult< T >::MK, line::fj::FJCharMaxDiscreteResult< T >::mK, and line::NumericError::NumericError().

Referenced by fj_char_max_discrete().

◆ fj_compute_pi()

FjCodesPi line::fj::fj_compute_pi ( const Matrix< double > & T,
const FjDist< double > & arrival,
const FjDist< double > & service,
const FjCodesServiceH & h,
std::size_t C,
const Matrix< double > & S,
const Matrix< double > & A_jump )
inline

Port of computePi.m: the all-busy boundary vector and E[n1].

The two branches are not two implementations of one formula. For EXPONENTIAL service the not-all-busy space has exactly as many phases as the all-busy one (m = 1 makes both (C + 1)-dimensional), so the return to the all-busy period is a square map and Q0 can be inverted directly. For phase-type service the two spaces differ and the reference goes through constructSRK, whose Ke and Kc project between them. Running the second branch on exponential service would give the same answer; running the first on anything else is a shape error, which is why the reference switches on SerChoice.

Definition at line 389 of file fj_codes.h.

References line::fj::FjDist< T >::choice, line::Matrix< T >::cols(), line::fj::FjCodesPi::En1, line::eye(), fj_boundary_solve(), fj_compute_pi(), fj_construct_not_all_busy(), fj_construct_srk(), line::inverse(), line::fj::FjCodesSRK::Kc, line::fj::FjCodesSRK::Ke, line::mam::kron(), line::mam::krons(), line::fj::FjDist< T >::lambda0, line::fj::FjDist< T >::lambda1, line::lyap_schur(), line::matmul(), line::NumericError::NumericError(), line::fj::FjCodesPi::pi0, line::fj::FjCodesSRK::R0, line::Matrix< T >::rows(), line::fj::FjCodesSRK::Se, line::fj::FjCodesSRK::Sestar, line::sylvester_schur(), and line::vecmul().

Referenced by fj_compute_pi(), and fj_return_rt2().

◆ fj_compute_t()

FjCodesT line::fj::fj_compute_t ( const FjDist< double > & arrival,
const FjDist< double > & service,
const FjCodesServiceH & h,
std::size_t C,
FjTMode mode )
inline

Port of computeT.m.

The Sylvester route is the paper's Section 5.1 and the NARE route its Section 5.2; they solve the same equation and the reference defaults to NARE. Both are offered because options.config.fj_tmode selects between them, and because they fail on different models: the iteration converges linearly and can stall, while the Schur route is direct but needs the stable subspace to be real.

Definition at line 293 of file fj_codes.h.

References line::fj::FjCodesSA::A_jump, line::fj::FjCodesT::A_jump, line::Matrix< T >::cols(), line::eye(), fj_build_sa(), fj_compute_t(), fj_compute_t_nare(), line::fj::FjCodesT::iterations, line::mam::kron(), line::fj::FjDist< T >::lambda0, line::fj::FjDist< T >::lambda1, line::lyap_schur(), line::matmul(), line::NumericError::NumericError(), line::fj::FjCodesT::residual, line::Matrix< T >::rows(), line::fj::FjCodesSA::S, line::fj::FjCodesT::S, line::fj::FjCodesT::S_Arr, line::fj::FjCodesT::sum_Ajump, Sylvester, and line::fj::FjCodesT::T.

Referenced by fj_compute_t(), and fj_return_rt2().

◆ fj_compute_t_nare()

Matrix< double > line::fj::fj_compute_t_nare ( const Matrix< double > & D0,
const Matrix< double > & D1,
const Matrix< double > & S,
const Matrix< double > & A_jump,
double * residual )
inline

Port of computeT_NARE.m: the T matrix as the stable invariant subspace of.

H = [ I (x) D0 I (x) D1 ] [ -A_jump (x) I -S ]

The m eigenvalues of SMALLEST real part are ordered to the front of the real Schur form, X is read off the resulting basis as Q1(m+1:2m, 1:m) / Q1(1:m, 1:m), and T = S + X (I (x) D1).

A complex-conjugate pair astride the m/2m boundary would ask for an invariant subspace that does not exist over the reals; LAPACK's dtrexc refuses to split such a block, and the split is detected here first so that it is named as the spectrum condition it is rather than as a reordering failure.

Definition at line 214 of file fj_codes.h.

References line::eye(), fj_compute_t_nare(), line::InputError::InputError(), line::inverse(), line::mam::kron(), line::matmul(), line::NumericError::NumericError(), line::Matrix< T >::rows(), line::schur_decomposition(), line::schur_reorder(), line::RealSchur::T, and line::RealSchur::Z.

Referenced by fj_compute_t(), and fj_compute_t_nare().

◆ fj_construct_not_all_busy()

Matrix< double > line::fj::fj_construct_not_all_busy ( std::size_t C,
const FjDist< double > & service,
const FjCodesServiceH & h )
inline

◆ fj_construct_srk()

◆ fj_cox_fit()

template<class T>
FJCoxFitResult< T > line::fj::fj_cox_fit ( const T & m1,
const T & c2 )

Two-stage Coxian fit of a mean and a squared coefficient of variation.

Parameters
m1target mean, m1 > 0
c2target squared coefficient of variation, c2 >= 0.5
Returns
the two stage rates, the branching probability and the Erlang bracket

Definition at line 52 of file fj_cox_fit.h.

References fj_cox_fit(), line::InputError::InputError(), line::fj::FJCoxFitResult< T >::kmax, line::fj::FJCoxFitResult< T >::kmin, line::fj::FJCoxFitResult< T >::mu1, line::fj::FJCoxFitResult< T >::mu2, and line::fj::FJCoxFitResult< T >::q.

Referenced by fj_cox_fit().

◆ fj_dag_makespan()

template<class T>
FJDagMakespanResult< T > line::fj::fj_dag_makespan ( const Matrix< T > & pred,
const Matrix< T > & rate )

Makespan of a task system with precedence constraints.

Parameters
predn by n precedence relation, pred(i,j) nonzero when i precedes j
raten by n table whose entry (i,k) is the rate of task i at concurrency k
Returns
the makespan with the per-task initiation, completion and execution times

Definition at line 60 of file fj_dag_makespan.h.

References line::fj::FJDagMakespanResult< T >::C, line::fj::FJDagMakespanResult< T >::Cend, line::Matrix< T >::cols(), line::fj::FJDagMakespanResult< T >::E, fj_dag_makespan(), line::fj::FJDagMakespanResult< T >::I, line::InputError::InputError(), and line::Matrix< T >::rows().

Referenced by fj_dag_makespan().

◆ fj_delay_opt()

template<class T>
FJDelayOptResult< T > line::fj::fj_delay_opt ( const std::vector< unsigned > & shape,
const std::vector< T > & rate,
unsigned maxsweeps = 40,
const T & dtol = num_traits<T>::from_double(1e-8),
unsigned npanels = 2000 )

Deterministic subtask delays that minimise mean dispersion.

Parameters
shapeErlang stage counts, one per branch
rateErlang stage rates, one per branch
maxsweepscoordinate-descent sweep cap
dtolrelative convergence tolerance
npanelsSimpson panel count passed to fj_dispersion
Returns
the optimal delays and the dispersion and last-completion mean there

Definition at line 56 of file fj_delay_opt.h.

References line::fj::FJDelayOptResult< T >::d, line::fj::FJDelayOptResult< T >::Edisp, line::fj::FJDispersionResult< T >::Edisp, line::fj::FJDelayOptResult< T >::Emax, line::fj::FJDispersionResult< T >::Emax, fj_delay_opt(), fj_dispersion(), and line::InputError::InputError().

Referenced by fj_delay_opt().

◆ fj_dispersion() [1/2]

template<class T>
FJDispersionResult< T > line::fj::fj_dispersion ( const std::vector< unsigned > & shape,
const std::vector< T > & rate )

The undelayed system, d = 0.

Definition at line 119 of file fj_dispersion.h.

References fj_dispersion().

◆ fj_dispersion() [2/2]

template<class T>
FJDispersionResult< T > line::fj::fj_dispersion ( const std::vector< unsigned > & shape,
const std::vector< T > & rate,
const std::vector< T > & d,
const T & tol = num_traits<T>::from_double(1e-10),
unsigned npanels = 4000 )

Mean subtask dispersion of a split-merge system with Erlang branches.

Parameters
shapeErlang stage counts, one per branch
rateErlang stage rates, one per branch
ddeterministic delays, one per branch, all non-negative
tolcompletion tolerance used to pick the quadrature horizon
npanelsSimpson panel count, forced even
Returns
the mean dispersion with the two order-statistic means

Definition at line 59 of file fj_dispersion.h.

References line::fj::FJDispersionResult< T >::Edisp, line::fj::FJDispersionResult< T >::Emax, line::fj::FJDispersionResult< T >::Emin, fj_dispersion(), and line::InputError::InputError().

Referenced by fj_delay_opt(), fj_dispersion(), and fj_dispersion().

◆ fj_dist2fj()

◆ fj_generate_service()

◆ fj_gk_bound() [1/2]

template<class T>
FJGKBoundResult< T > line::fj::fj_gk_bound ( unsigned K)

G(K) factors for the standardized-maximum approximation X_K^max ~ mu.

  • sigma G(K).
Parameters
Knumber of branches, K >= 1
Returns
all four G(K) factors, matching MATLAB's 'all' mode

Definition at line 44 of file fj_gk_bound.h.

References line::fj::FJGKBoundResult< T >::evd, line::fj::FJGKBoundResult< T >::exponential, fj_gk_bound(), fj_harmonic(), line::fj::FJGKBoundResult< T >::K, line::fj::FJGKBoundResult< T >::uniform, and line::fj::FJGKBoundResult< T >::upper_bound.

Referenced by fj_gk_bound(), fj_gk_bound(), and fj_xmax_approx().

◆ fj_gk_bound() [2/2]

template<class T>
T line::fj::fj_gk_bound ( unsigned K,
FJDistType type )

◆ fj_harmonic()

template<class T>
T line::fj::fj_harmonic ( unsigned K)

Harmonic number H_K = sum_{k=1..K} 1/k.

Parameters
Knumber of parallel branches, K >= 1
Returns
H_K = 1 + 1/2 + ... + 1/K

Definition at line 37 of file fj_harmonic.h.

References fj_harmonic().

Referenced by fj_amva(), fj_bounds(), fj_char_max(), fj_gk_bound(), fj_harmonic(), fj_ism_green(), fj_qgb(), fj_respt_closed(), fj_respt_nt(), fj_respt_varki(), fj_respt_vm(), fj_rmax(), fj_sm_tput(), fj_xmax_approx(), fj_xmax_exp(), and fj_xmax_hz().

◆ fj_ism_green()

template<class T>
FJIsmGreenResult< T > line::fj::fj_ism_green ( const T & lambda,
const T & mu,
unsigned s,
const std::vector< T > & c )

◆ fj_lst_max_het()

template<class T>
T line::fj::fj_lst_max_het ( const std::vector< T > & lambda,
const T & s )

Laplace-Stieltjes transform of the maximum of heterogeneous exponentials.

Parameters
lambdathe K positive exponential rates
stransform argument, s >= 0
Returns
L*(s) for the maximum of the K variables

Definition at line 42 of file fj_lst_max_het.h.

References fj_lst_max_het(), and line::InputError::InputError().

Referenced by fj_lst_max_het().

◆ fj_main()

std::vector< FjCodesPercentiles > line::fj::fj_main ( const FjDist< double > & arrival,
const FjDist< double > & service,
const std::vector< double > & pers,
const std::vector< std::size_t > & K,
const std::vector< std::size_t > & Cs,
FjTMode mode )
inline

Port of mainFJ.m: the response-time percentiles of a K-node fork-join queue, interpolated between the exact one-node and the approximate two-node results in log K.

Parameters
persthe target percentiles as PROBABILITIES in (0, 1)
Kone entry per fork-join width to report
Csthe truncation levels; only the LAST one reaches the answer, as in the reference

Definition at line 792 of file fj_codes.h.

References fj_main(), fj_return_rt1(), fj_return_rt2(), line::InputError::InputError(), line::fj::FjDist< T >::lambda, line::fj::FjDist< T >::mu, and line::fj::FjCodesRT2::RTp.

Referenced by fj_main(), and line::mam::solver_mam_fj().

◆ fj_mg1_respt_moments()

template<class T>
Mg1ResptMoments< T > line::fj::fj_mg1_respt_moments ( const T & lambda,
const T & ES,
const T & ES2,
const T & ES3 )

Mean and variance of the M/G/1 response time, as ForkTail inputs.

Parameters
lambdaarrival rate at the branch
ESfirst moment of the service time
ES2second moment of the service time
ES3third moment of the service time, finite

Definition at line 63 of file fj_mg1_respt_moments.h.

References line::fj::Mg1ResptMoments< T >::ET, fj_mg1_respt_moments(), line::InputError::InputError(), and line::fj::Mg1ResptMoments< T >::VT.

Referenced by fj_mg1_respt_moments().

◆ fj_order_stat()

template<class T>
FJOrderStatResult< T > line::fj::fj_order_stat ( const T & y,
unsigned k,
unsigned K,
const std::function< T(const T &)> & F_X )

CDF and expected value of the k-th order statistic of K i.i.d.

samples.

Parameters
yevaluation point of the CDF
korder of the statistic, 1 = minimum, K = maximum
Knumber of samples
F_XCDF of the branch distribution
Returns
[F_Yk, E_Yk, mean_available]

Definition at line 53 of file fj_order_stat.h.

References fj_order_stat(), line::InputError::InputError(), and line::num_pow_int().

Referenced by fj_order_stat().

◆ fj_ordstat_exp()

template<class T>
T line::fj::fj_ordstat_exp ( const std::vector< T > & ri,
std::size_t k )

Mean of the k-th smallest of n independent EXPONENTIAL branch completion times, i.e.

the instant a k-of-n (quorum) join fires.

Parameters
ribranch completion time means
kquorum, 1 <= k <= ri.size()
Returns
the mean instant the k-of-n join fires

Definition at line 96 of file fj_ordstat_exp.h.

References fj_ordstat_exp(), FJ_ORDSTAT_MAX_EXACT, and line::InputError::InputError().

Referenced by line::mva::fj_expected_ordstat(), and fj_ordstat_exp().

◆ fj_parse_tmode()

FjTMode line::fj::fj_parse_tmode ( const std::string & s)
inline

Parse the reference's T_Mode string, whose default is 'NARE'.

Definition at line 105 of file fj_codes.h.

References fj_parse_tmode(), Nare, and Sylvester.

Referenced by fj_parse_tmode(), and line::mam::solver_mam_fj().

◆ fj_qgb()

template<class T>
FJQgbResult< T > line::fj::fj_qgb ( const std::vector< T > & D,
const std::vector< unsigned > & P,
unsigned M,
const T & Z )

Geometric bound on the queue length of a fork-join subnetwork.

Parameters
Dper-visit service demand of each subnetwork
Pfork degree of each subnetwork, P[n] >= 1
Mnumber of circulating jobs, M >= 1
Zthink time, Z >= 0
Returns
the bounded queue lengths and the geometric ratios

Definition at line 52 of file fj_qgb.h.

References fj_harmonic(), fj_qgb(), line::InputError::InputError(), line::fj::FJQgbResult< T >::Q, and line::fj::FJQgbResult< T >::y.

Referenced by fj_qgb().

◆ fj_quantile() [1/2]

template<class T>
T line::fj::fj_quantile ( unsigned K,
const T & q )

Gumbel approximation.

Parameters
Knumber of samples, K >= 1
qquantile level, 0 < q < 1

Definition at line 41 of file fj_quantile.h.

References fj_quantile(), and line::InputError::InputError().

Referenced by fj_quantile(), and fj_quantile().

◆ fj_quantile() [2/2]

template<class T>
T line::fj::fj_quantile ( unsigned K,
const T & q,
const std::function< T(const T &)> & Finv )

Exact quantile through the supplied inverse CDF.

Parameters
Knumber of samples, K >= 1
qquantile level, 0 < q < 1
Finvinverse CDF of the branch distribution

Definition at line 59 of file fj_quantile.h.

References fj_quantile(), and line::InputError::InputError().

◆ fj_quorum_moments()

template<class T>
FJQuorumMomentsResult< T > line::fj::fj_quorum_moments ( const std::vector< T > & branchMeans,
const std::vector< T > & branchVars,
std::size_t k )

Mean and variance of a k-of-n (quorum) join completion time, from the mean and variance of each branch.

Parameters
branchMeansmean completion time of each branch
branchVarsvariance of each branch, same length
kquorum size, 1 <= k <= n
Returns
[m, v], the mean and variance of the k-th smallest

Definition at line 107 of file fj_quorum_moments.h.

References FJ_QUORUM_MAX_BRANCHES, fj_quorum_moments(), and line::InputError::InputError().

Referenced by fj_quorum_moments().

◆ fj_respt_2way()

template<class T>
T line::fj::fj_respt_2way ( const T & lambda,
const T & mu )

Exact mean response time of a 2-way fork-join system of M/M/1 branches.

Parameters
lambdaarrival rate
muper-branch service rate
Returns
mean 2-way fork-join response time

Definition at line 42 of file fj_respt_2way.h.

References fj_respt_2way(), line::NumericError::NumericError(), and line::qsys::qsys_mm1().

Referenced by fj_respt_2way().

◆ fj_respt_bulk()

template<class T>
FJResptBulkResult< T > line::fj::fj_respt_bulk ( unsigned K,
const T & lambda,
const T & mu,
unsigned c,
std::size_t nmax = 0 )

Centralized splitting analysed as an M[K]/M/c bulk arrival system.

Parameters
Kbatch size, that is the number of tasks per request
lambdaarrival rate of requests
muper-server task service rate
cnumber of servers
nmaxtruncation level of the task-count chain, 0 for the default
Returns
the request and task response times, the mean queue and the distribution

Definition at line 63 of file fj_respt_bulk.h.

References line::mc::ctmc_solve(), fj_respt_bulk(), line::InputError::InputError(), line::NumericError::NumericError(), line::fj::FJResptBulkResult< T >::p, line::fj::FJResptBulkResult< T >::Q, line::fj::FJResptBulkResult< T >::Rreq, and line::fj::FJResptBulkResult< T >::Rtask.

Referenced by fj_respt_bulk().

◆ fj_respt_closed() [1/2]

template<class T>
FJResptClosedResult< T > line::fj::fj_respt_closed ( unsigned K,
const T & x,
unsigned M )

The isolated parallel subsystem of Theorem 4.1, where A = M-1.

Parameters
Knumber of parallel branches, K >= 1
xmean service time of each branch
Mnumber of circulating jobs, M >= 1
Returns
the bound, flagged exact at K = 2

Definition at line 69 of file fj_respt_closed.h.

References line::fj::FJResptClosedResult< T >::exact, fj_respt_closed(), and line::InputError::InputError().

◆ fj_respt_closed() [2/2]

template<class T>
FJResptClosedResult< T > line::fj::fj_respt_closed ( unsigned K,
const T & x,
unsigned M,
const T & A )

Varki bound on the residence time of a closed fork-join subnetwork.

Parameters
Knumber of parallel branches, K >= 1
xmean service time of each branch
Mnumber of circulating jobs, M >= 1
Amean queue length seen on arrival
Returns
the bound and whether it is known to be tight

Definition at line 47 of file fj_respt_closed.h.

References line::fj::FJResptClosedResult< T >::exact, fj_harmonic(), fj_respt_closed(), line::InputError::InputError(), and line::fj::FJResptClosedResult< T >::R.

Referenced by fj_respt_closed(), and fj_respt_closed().

◆ fj_respt_nosplit()

template<class T>
FJResptNosplitResult< T > line::fj::fj_respt_nosplit ( unsigned K,
const T & lambda,
const T & mu )

Mean response time of the distributed no-splitting parallel system.

Parameters
Knumber of servers, equal to the number of tasks per job
lambdatotal job arrival rate
muper-server task service rate, mu > lambda
Returns
the mean job response time and the per-server utilization

Definition at line 49 of file fj_respt_nosplit.h.

References fj_respt_nosplit(), line::InputError::InputError(), line::NumericError::NumericError(), line::fj::FJResptNosplitResult< T >::R, and line::fj::FJResptNosplitResult< T >::rho.

Referenced by fj_respt_nosplit().

◆ fj_respt_nt()

template<class T>
T line::fj::fj_respt_nt ( unsigned K,
const T & lambda,
const T & mu )

Nelson-Tantawi approximation to the mean response time of a K-way fork-join system of M/M/1 branches.

Parameters
Knumber of parallel branches, K >= 2
lambdaarrival rate
muper-branch service rate
Returns
approximate mean fork-join response time

Definition at line 43 of file fj_respt_nt.h.

References fj_harmonic(), fj_respt_nt(), line::InputError::InputError(), and line::NumericError::NumericError().

Referenced by fj_respt_nt().

◆ fj_respt_varki()

template<class T>
T line::fj::fj_respt_varki ( unsigned K,
const T & lambda,
const T & mu )

Varki approximation to the mean response time of a K-way fork-join system of M/M/1 branches.

Parameters
Knumber of parallel branches, K >= 1
lambdaarrival rate
muper-branch service rate
Returns
approximate mean fork-join response time

Definition at line 44 of file fj_respt_varki.h.

References fj_harmonic(), fj_respt_varki(), and line::NumericError::NumericError().

Referenced by fj_respt_varki().

◆ fj_respt_vm()

template<class T>
T line::fj::fj_respt_vm ( unsigned K,
const T & lambda,
const T & mu )

Varma-Makowski light-traffic interpolation for the mean response time of a K-way fork-join system of M/M/1 branches.

Parameters
Knumber of parallel branches, K >= 1
lambdaarrival rate
muper-branch service rate
Returns
approximate mean fork-join response time

Definition at line 47 of file fj_respt_vm.h.

References fj_harmonic(), fj_respt_vm(), line::num_factorial(), line::num_pow_int(), and line::NumericError::NumericError().

Referenced by fj_respt_vm().

◆ fj_restart_matrix()

Matrix< double > line::fj::fj_restart_matrix ( const FjDist< double > & service)
inline

The reference's A = -sum(ST, 2) * tau_st: complete, then restart.

Definition at line 147 of file fj_codes_matrices.h.

References fj_restart_matrix(), line::fj::FjDist< T >::ST, and line::fj::FjDist< T >::tau_st.

Referenced by fj_build_sa(), fj_construct_not_all_busy(), fj_construct_srk(), fj_generate_service(), and fj_restart_matrix().

◆ fj_return_per()

std::vector< double > line::fj::fj_return_per ( const std::vector< double > & vec,
const Matrix< double > & A,
const std::vector< double > & pers )
inline

Port of returnPer.m: the percentiles of a (possibly defective) phase-type law, by uniformization.

The law is uniformized at c = max(-diag(A)) into P = A / c + I, the absorption probability by time t is the Poisson mixture sum_k p_k(ct) a_k with a_k = alpha P^k e, and the series is truncated where its partial sums reach the total mass alpha (I - P)^-1 e. The percentile itself is then found by scanning t downwards on a 0.001 grid from three times the mean, extending the bracket by half a mean whenever the target is not yet reached. A target below the defect 1 - sum(alpha) is answered with zero, which is the reference's convention for a percentile the law never attains.

Definition at line 507 of file fj_codes.h.

References line::Matrix< T >::cols(), fj_return_per(), line::InputError::InputError(), line::inverse(), line::mulvec(), line::NumericError::NumericError(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by fj_return_per(), fj_return_rt1(), and fj_return_rt2().

◆ fj_return_rt1()

std::vector< double > line::fj::fj_return_rt1 ( const FjDist< double > & arrival,
const FjDist< double > & service,
const std::vector< double > & pers )
inline

◆ fj_return_rt2()

FjCodesRT2 line::fj::fj_return_rt2 ( const FjDist< double > & arrival,
const FjDist< double > & service,
const std::vector< double > & pers,
std::size_t C,
FjTMode mode )
inline

Port of returnRT2.m: the response-time percentiles of the TWO-node fork-join queue, under the Section 4 approximation.

The response time is assembled as one phase-type law over three blocks: the service process of a job that arrives in a not-all-busy period, the TIME- REVERSED service process of a job that arrives in an all-busy period, and the waiting time. The reversal is what lets the job's own service be appended to the waiting time it accrued: stat_service_phase is the stationary phase occupancy, tr_ST is the reversed generator, and tildeP is the coupling that hands the reversed process over to the waiting-time block. Phases of zero stationary occupancy are dropped – they are unreachable and the reversal divides by their occupancy.

Definition at line 651 of file fj_codes.h.

References line::fj::FjCodesT::A_jump, line::fj::FjCodesWait::alfa, line::Matrix< T >::cols(), line::fj::FjCodesGenService::dim_notbusy, line::fj::FjCodesPi::En1, fj_build_service_h(), fj_compute_pi(), fj_compute_t(), fj_generate_service(), fj_return_per(), fj_return_rt2(), fj_return_wait(), line::fj::FjDist< T >::Ia, line::mam::kron(), line::fj::FjDist< T >::ma, line::fj::FjCodesGenService::newdim, line::NumericError::NumericError(), line::fj::FjCodesPi::pi0, line::fj::FjCodesRT2::prob_wait, line::fj::FjCodesWait::prob_wait, line::fj::FjCodesRT2::residual, line::fj::FjCodesT::residual, line::Matrix< T >::rows(), line::fj::FjCodesRT2::RTp, line::fj::FjCodesT::S, line::fj::FjCodesT::S_Arr, line::fj::FjCodesT::sum_Ajump, line::fj::FjCodesGenService::T, line::fj::FjCodesT::T, line::vecmul(), line::fj::FjCodesRT2::wait_alpha, line::fj::FjCodesWait::wait_alpha, line::fj::FjCodesRT2::wait_Smat, and line::fj::FjCodesWait::wait_Smat.

Referenced by fj_main(), and fj_return_rt2().

◆ fj_return_wait()

FjCodesWait line::fj::fj_return_wait ( double En1,
const std::vector< double > & pi0,
const Matrix< double > & T,
const std::vector< double > & phi,
const std::vector< double > & sum_Ajump )
inline

Port of returnWait.m: the stationary waiting time as a phase-type law.

Definition at line 464 of file fj_codes.h.

References line::fj::FjCodesWait::alfa, fj_return_wait(), line::fj::FjCodesWait::prob_wait, line::fj::FjCodesWait::wait_alpha, and line::fj::FjCodesWait::wait_Smat.

Referenced by fj_return_rt2(), and fj_return_wait().

◆ fj_rmax()

template<class T>
T line::fj::fj_rmax ( unsigned K,
const T & lambda,
const T & mu )

Pessimistic (independence) fork-join response time: the expected maximum of K independent M/M/1 response times, each exponential with rate mu - lambda.

Parameters
Knumber of parallel branches, K >= 1
lambdaarrival rate
muper-branch service rate
Returns
H_K / (mu - lambda)

Definition at line 43 of file fj_rmax.h.

References fj_harmonic(), fj_rmax(), and line::qsys::qsys_mm1().

Referenced by fj_rmax().

◆ fj_rmax_erlang()

template<class T>
T line::fj::fj_rmax_erlang ( unsigned K,
unsigned k,
const T & lambda,
const T & mu )

Expected maximum of K M/E_k/1 branch response times.

Parameters
Knumber of branches, K >= 1
kErlang stages of the branch service time, k >= 1
lambdaarrival rate
muper-stage service rate (branch mean service is k/mu)
Returns
expected maximum of the K branch response times

Definition at line 58 of file fj_rmax_erlang.h.

References fj_rmax_erlang(), line::InputError::InputError(), line::num_pow_int(), line::NumericError::NumericError(), and line::UnsupportedError::UnsupportedError().

Referenced by fj_rmax_erlang().

◆ fj_rmax_evd()

template<class T>
T line::fj::fj_rmax_evd ( unsigned K,
const T & R,
const T & sigma_R,
bool calibrated = false )

Extreme-value approximation to the maximum of K branch response times, from their mean and standard deviation.

Parameters
Knumber of branches, K >= 1
Rmean branch response time, > 0
sigma_Rstandard deviation of the branch response time, >= 0
calibratedapply the 1/1.27 calibration of Thomasian et al. (2007)

Definition at line 45 of file fj_rmax_evd.h.

References fj_rmax_evd(), and line::InputError::InputError().

Referenced by fj_rmax_evd().

◆ fj_serialization()

template<class T>
FJSerializationResult< T > line::fj::fj_serialization ( const std::vector< T > & Rs,
const T & R0,
unsigned M,
const T & alpha = num_traits<T>::from_double(0.5) )

Blocking probability and pseudoserver delay of serialization phases.

Parameters
Rsmean residence time inside each serialization phase
R0mean residence time in the nonserialized phase
Mnumber of circulating jobs, M >= 1
alphafraction of the phase charged to a blocked job, in [0,1]
Returns
the blocking probabilities, the pseudoserver delays and the cycle time

Definition at line 54 of file fj_serialization.h.

References line::fj::FJSerializationResult< T >::delay, fj_serialization(), line::InputError::InputError(), line::NumericError::NumericError(), line::fj::FJSerializationResult< T >::P, and line::fj::FJSerializationResult< T >::Rtot.

Referenced by fj_serialization().

◆ fj_sm_tput()

template<class T>
T line::fj::fj_sm_tput ( unsigned K,
const T & mu )

Saturated (single-message) maximum throughput of a K-way fork-join system with exponential branch service.

Parameters
Knumber of parallel branches, K >= 1
muper-branch service rate, mu > 0
Returns
maximum sustainable arrival rate

Definition at line 40 of file fj_sm_tput.h.

References fj_harmonic(), fj_sm_tput(), and line::InputError::InputError().

Referenced by fj_sm_tput().

◆ fj_synch_delay()

template<class T>
T line::fj::fj_synch_delay ( const T & lambda,
const T & mu )

Mean synchronization delay of a 2-way fork-join system of M/M/1 branches, i.e.

the time the first-finishing branch waits at the join.

Parameters
lambdaarrival rate
muper-branch service rate
Returns
mean synchronization delay

Definition at line 41 of file fj_synch_delay.h.

References fj_synch_delay(), line::NumericError::NumericError(), and line::qsys::qsys_mm1().

Referenced by fj_synch_delay().

◆ fj_tail_forktail() [1/2]

template<class T>
ForkTailResult< T > line::fj::fj_tail_forktail ( const std::vector< T > & ET,
const std::vector< T > & VT,
const std::vector< T > & K = std::vector<T>(),
const T & p_in = num_traits<T>::from_int(99),
const std::vector< T > & P = std::vector<T>() )

ForkTail black-box tail-latency approximation for fork-join requests.

Parameters
ETper-branch mean task response times; one entry means homogeneous
VTper-branch variances, same length as ET
Kfanout(s); a vector of distinct fanouts needs P, ignored when ET has more than one entry
Pfanout probabilities, required when K has more than one entry
p_inpercentile, a fraction in (0,1) or a percentage in (0,100)

Definition at line 189 of file fj_tail_forktail.h.

References line::fj::ForkTailResult< T >::alpha, line::fj::ForkTailResult< T >::beta, fj_tail_forktail(), line::InputError::InputError(), line::num_abs(), line::RootResult< T >::root, line::root_brent(), and line::fj::ForkTailResult< T >::xp.

Referenced by fj_tail_forktail(), fj_tail_forktail(), and fj_tail_ordstat().

◆ fj_tail_forktail() [2/2]

template<class T>
ForkTailResult< T > line::fj::fj_tail_forktail ( const T & ET,
const T & VT,
const T & K,
const T & p = num_traits<T>::from_int(99) )

Homogeneous convenience overload with a scalar mean, variance and fanout.

Definition at line 319 of file fj_tail_forktail.h.

References fj_tail_forktail().

◆ fj_tail_ordstat()

template<class T>
ForkTailResult< T > line::fj::fj_tail_ordstat ( const std::vector< T > & ET,
const std::vector< T > & VT,
std::size_t K = 1,
const T & p_in = num_traits<T>::from_int(99),
std::size_t kreq = 0 )

Tail latency of a k-of-n (QUORUM) fork-join request.

Parameters
ETper-branch mean task response times; one entry means homogeneous
VTper-branch variances, same length as ET
Kfanout, used only when ET has a single entry
p_inpercentile, a fraction in (0,1) or a percentage in (0,100)
kreqthe join fires on the kreq-th branch; 0 means every branch

Definition at line 115 of file fj_tail_ordstat.h.

References line::fj::ForkTailResult< T >::alpha, line::fj::ForkTailResult< T >::beta, fj_tail_forktail(), fj_tail_ordstat(), line::InputError::InputError(), line::RootResult< T >::root, line::root_brent(), and line::fj::ForkTailResult< T >::xp.

Referenced by fj_tail_ordstat().

◆ fj_tsm_capacity()

template<class T>
FJTsmCapacityResult< T > line::fj::fj_tsm_capacity ( unsigned s,
const std::vector< T > & f,
const std::vector< unsigned > & r,
const std::vector< T > & x )

◆ fj_vectmatch()

std::size_t line::fj::fj_vectmatch ( const std::vector< double > & row,
const Matrix< double > & matrix )
inline

Port of vectmatch.m: the row of matrix equal to row.

Returns a 0-based index. The reference leaves its output unassigned when there is no match, which MATLAB reports as an error one frame up; the same condition is a construction bug here and is named as one.

Definition at line 130 of file fj_codes_matrices.h.

References line::Matrix< T >::cols(), fj_vectmatch(), line::InputError::InputError(), line::NumericError::NumericError(), and line::Matrix< T >::rows().

Referenced by fj_build_sa(), fj_busy_to_idle(), fj_construct_srk(), and fj_vectmatch().

◆ fj_xmax_2() [1/2]

template<class T>
T line::fj::fj_xmax_2 ( const T & lambda)

Equal-rate overload, matching MATLAB's single-argument call.

Definition at line 47 of file fj_xmax_2.h.

References fj_xmax_2().

◆ fj_xmax_2() [2/2]

template<class T>
T line::fj::fj_xmax_2 ( const T & lambda1,
const T & lambda2 )

Expected maximum of two independent, possibly unequal-rate exponentials.

Parameters
lambda1rate of the first branch, > 0
lambda2rate of the second branch, > 0
Returns
expected maximum of the two exponentials

Definition at line 39 of file fj_xmax_2.h.

References fj_xmax_2(), and line::InputError::InputError().

Referenced by fj_xmax_2(), and fj_xmax_2().

◆ fj_xmax_approx()

template<class T>
FJXmaxApproxResult< T > line::fj::fj_xmax_approx ( unsigned K,
const T & mu_X,
const T & sigma_X,
FJDistType type = FJDistType::Exp )

Two-moment approximation to the expected maximum of K i.i.d.

samples, X_K^max ~ mu_X + sigma_X G(K).

Parameters
Knumber of branches, K >= 1
mu_Xmean of the branch distribution
sigma_Xstandard deviation of the branch distribution, >= 0
typewhich G(K) family to use
Returns
[Xmax, GK]

Definition at line 44 of file fj_xmax_approx.h.

References Exp, fj_gk_bound(), fj_harmonic(), fj_xmax_approx(), line::InputError::InputError(), and line::UnsupportedError::UnsupportedError().

Referenced by fj_xmax_approx().

◆ fj_xmax_coxian()

template<class T>
FJXmaxCoxianResult< T > line::fj::fj_xmax_coxian ( unsigned K,
const T & mu1,
const T & mu2,
const T & q )

Expected maximum of K i.i.d.

two-stage Coxian variables.

Parameters
Knumber of branches, K >= 1
mu1rate of the first stage
mu2rate of the second stage
qprobability that the second stage is visited, in [0,1]
Returns
the exact expected maximum with the branch mean and SCV

Definition at line 57 of file fj_xmax_coxian.h.

References line::fj::FJXmaxCoxianResult< T >::c2, fj_xmax_coxian(), line::InputError::InputError(), line::fj::FJXmaxCoxianResult< T >::m1, and line::fj::FJXmaxCoxianResult< T >::Xmax.

Referenced by fj_xmax_coxian().

◆ fj_xmax_emma() [1/2]

template<class T>
T line::fj::fj_xmax_emma ( unsigned K,
const std::function< T(const T &)> & Finv )

General branch: the caller supplies the quantile function F^{-1}.

Parameters
Knumber of samples, K >= 1
Finvinverse CDF of the branch distribution

Definition at line 61 of file fj_xmax_emma.h.

References fj_xmax_emma(), and line::InputError::InputError().

◆ fj_xmax_emma() [2/2]

template<class T>
T line::fj::fj_xmax_emma ( unsigned K,
const T & mu )

Exponential branch.

Parameters
Knumber of samples, K >= 1
murate of the exponential, > 0

Definition at line 43 of file fj_xmax_emma.h.

References fj_xmax_emma(), and line::InputError::InputError().

Referenced by fj_xmax_emma(), and fj_xmax_emma().

◆ fj_xmax_erlang()

template<class T>
T line::fj::fj_xmax_erlang ( unsigned K,
unsigned k,
const T & mu )

Expected maximum of K i.i.d.

Erlang-k service times.

Parameters
Knumber of branches, K >= 1
kErlang stages, k >= 1
muper-stage rate, > 0 (branch mean is k/mu)
Returns
expected maximum of K Erlang-k samples

Definition at line 86 of file fj_xmax_erlang.h.

References fj_xmax_erlang(), line::InputError::InputError(), line::num_factorial(), line::num_pow_int(), and line::UnsupportedError::UnsupportedError().

Referenced by fj_xmax_erlang().

◆ fj_xmax_exp()

template<class T>
T line::fj::fj_xmax_exp ( unsigned K,
const T & mu )

Expected maximum of K i.i.d.

exponential service times.

Parameters
Knumber of branches, K >= 1
mubranch service rate, mu > 0
Returns
H_K / mu

Definition at line 40 of file fj_xmax_exp.h.

References fj_harmonic(), fj_xmax_exp(), and line::InputError::InputError().

Referenced by fj_xmax_exp().

◆ fj_xmax_het()

template<class T>
T line::fj::fj_xmax_het ( const std::vector< T > & lambda,
unsigned n = 1 )

Exact moments of the maximum of heterogeneous exponentials.

Parameters
lambdathe K positive exponential rates
nmoment order, n >= 1
Returns
the n-th moment of the maximum

Definition at line 40 of file fj_xmax_het.h.

References fj_xmax_het(), and line::InputError::InputError().

Referenced by fj_xmax_het().

◆ fj_xmax_hyperexp()

template<class T>
T line::fj::fj_xmax_hyperexp ( unsigned K,
const T & p1,
const T & mu1,
const T & mu2 )

Expected maximum of K i.i.d.

two-phase hyperexponential service times.

Parameters
Knumber of branches, K >= 1
p1probability of the first phase, 0 < p1 < 1
mu1rate of the first phase, > 0
mu2rate of the second phase, > 0
Returns
expected maximum of K hyperexponential samples

Definition at line 49 of file fj_xmax_hyperexp.h.

References fj_xmax_hyperexp(), line::InputError::InputError(), and line::num_pow_int().

Referenced by fj_xmax_hyperexp().

◆ fj_xmax_hz()

template<class T>
FJXmaxHzResult< T > line::fj::fj_xmax_hz ( const T & m1,
const T & m2,
unsigned K )

Harrison-Zertal approximation of the maximum of i.i.d.

variables.

Parameters
m1mean of the branch distribution, m1 > 0
m2second moment of the branch distribution, m2 >= m1^2
Knumber of branches, K >= 1
Returns
the approximate expected maximum and the equilibrium mean used

Definition at line 47 of file fj_xmax_hz.h.

References fj_harmonic(), fj_xmax_hz(), line::InputError::InputError(), line::fj::FJXmaxHzResult< T >::resid, and line::fj::FJXmaxHzResult< T >::Xmax.

Referenced by fj_xmax_hz().

◆ fj_xmax_hz_het()

template<class T>
T line::fj::fj_xmax_hz_het ( const std::vector< T > & m1,
const std::vector< T > & m2,
const std::vector< std::function< T(const T &)> > & cdf,
const T & tol = num_traits<T>::from_double(1e-10),
unsigned npanels = 2000 )

Harrison-Zertal approximation of the maximum of general variables.

Parameters
m1the K branch means, all positive
m2the K branch second moments, m2[i] >= m1[i]^2
cdfthe K distribution functions, cdf[i](t) = P(X_i <= t)
tolcompletion tolerance used to pick the quadrature horizon
npanelsSimpson panel count, forced even
Returns
the approximate expected maximum

Definition at line 76 of file fj_xmax_hz_het.h.

References fj_xmax_hz_het(), and line::InputError::InputError().

Referenced by fj_xmax_hz_het().

◆ fj_xmax_moments_het()

template<class T>
std::vector< T > line::fj::fj_xmax_moments_het ( const std::vector< T > & lambda,
unsigned n = 1 )

Moments of the maximum of heterogeneous exponentials by recurrence.

Parameters
lambdathe K positive exponential rates
nhighest moment order, n >= 1
Returns
moments of orders 1..n of the maximum

Definition at line 46 of file fj_xmax_moments_het.h.

References fj_xmax_moments_het(), and line::InputError::InputError().

Referenced by fj_xmax_moments_het().

◆ fj_xmax_normal()

template<class T>
FJXmaxNormalResult< T > line::fj::fj_xmax_normal ( unsigned K,
const T & mu,
const T & sigma,
FJNormalMethod method = FJNormalMethod::Johnson )

Expected maximum and variance of K i.i.d.

normal samples.

Parameters
Knumber of samples, K >= 2
mumean of the normal
sigmastandard deviation, >= 0
methodwhich correction to apply
Returns
[Xmax, Vmax]

Definition at line 45 of file fj_xmax_normal.h.

References Arnold, Corrected, fj_xmax_normal(), line::InputError::InputError(), and Johnson.

Referenced by fj_xmax_normal().

◆ fj_xmax_pareto() [1/2]

template<class T>
FJXmaxParetoResult< T > line::fj::fj_xmax_pareto ( unsigned K,
const T & beta )

MATLAB's default scale k = beta - 1, which normalizes the branch mean to 1.

Definition at line 76 of file fj_xmax_pareto.h.

References fj_xmax_pareto().

◆ fj_xmax_pareto() [2/2]

template<class T>
FJXmaxParetoResult< T > line::fj::fj_xmax_pareto ( unsigned K,
const T & beta,
const T & k )

Expected maximum and characteristic maximum of K i.i.d.

shifted-Pareto samples with survival S(x) = (k/(k+x))^beta.

Parameters
Knumber of samples, K >= 1
betaPareto shape, must exceed 2 for finite moments
kPareto scale, > 0 (MATLAB defaults it to beta - 1, the value that makes the branch mean equal to 1)
Returns
[Xmax, MK]

Definition at line 50 of file fj_xmax_pareto.h.

References fj_xmax_pareto(), line::InputError::InputError(), and line::num_pow_int().

Referenced by fj_xmax_pareto(), and fj_xmax_pareto().

Variable Documentation

◆ FJ_ORDSTAT_MAX_EXACT

const std::size_t line::fj::FJ_ORDSTAT_MAX_EXACT = 15
static

Branch count above which a genuine quorum leaves the exact alternating sum.

Definition at line 56 of file fj_ordstat_exp.h.

Referenced by fj_ordstat_exp().

◆ FJ_QUORUM_MAX_BRANCHES

std::size_t line::fj::FJ_QUORUM_MAX_BRANCHES = 512
constexpr

Branch counts above this are refused: evaluation is cubic in n.

Definition at line 95 of file fj_quorum_moments.h.

Referenced by fj_quorum_moments().