lib/router.js
/*
 * builds a routing table using a given job distribution plan
 * @param plan {Object}: job plan
 * @param local_parent {Boolean}: a flag to indicate whether the parent is local or remote
 * @return {Object}: the built table
 */
builds a routing table using a given job distribution plan
@param plan {Object}: job plan
@param local_parent {Boolean}: a flag to indicate whether the parent is local or remote
@return {Object}: the built table
builds a routing table using a given job distribution plan @param plan { Object } : job plan @param local_parent { Boolean } : a flag to indicate whether the parent is local or remote @return { Object } : the built table
function buildTableFromPlan(plan, local_parent) {
    var table = {};
    for(var host in plan) {
        var hostinfo = plan[host];
        for(var i = 0; i < hostinfo.count; i++) {
            table['proc' + (hostinfo.start + i)] = host;
        }
    }
    table.parent = local_parent ? "local" : "remote";
    return table;
}
function buildTableFromPlan ( plan , local_parent ) { var table = { } ; for ( var host in plan ) { var hostinfo = plan [ host ] ; for ( var i = 0 ; i < hostinfo . count ; i ++ ) { table [ 'proc' + ( hostinfo . start + i ) ] = host ; } } table . parent = local_parent ? "local" : "remote" ; return table ; }
builds a routing table using a given job distribution plan
 @param plan {Object}: job plan
 @param local_parent {Boolean}: a flag to indicate whether the parent is local or remote
 @return {Object}: the built table
builds a routing table using a given job distribution plan @param plan { Object } : job plan @param local_parent { Boolean } : a flag to indicate whether the parent is local or remote @return { Object } : the built table