index.js
function(opt) {
        //console.log(opt)
        if (isStarted) return;
        var self = this;

        if (!opt) {
            throw "Options required to start manager : \"cacheDir\", \"tcp\", \"port\"";
        }
        cacheDir = opt.cacheDir + '/' + scheduler_id;
        TCPip = opt.tcp;
        TCPport = opt.port;
        jobProfiles = opt.jobProfiles;
        cycleLength = opt.cycleLength ? parseInt(opt.cycleLength) : 5000;
        if (opt.hasOwnProperty('forceCache')) {
            cacheDir = opt.forceCache;
        }

        if (opt.hasOwnProperty('probPreviousCacheDir')) {
            probPreviousCacheDir = opt.probPreviousCacheDir;
        }
        if(debugMode)
            console.log("Attempting to create cache for process at " + cacheDir);
        try {
            fs.mkdirSync(cacheDir);
        } catch (e) {
            if (e.code != 'EEXIST') throw e;
            console.log("Cache found already found at " + cacheDir);
        }
        if(debugMode)
            console.log('[' + TCPip + '] opening socket at port ' + TCPport);
        var s = _openSocket(TCPport);
        data = '';
        s.on('listening', function(socket) {
                isStarted = true;
                if(debugMode) {
                    console.log("Starting pulse monitoring");
                    console.log("cache Directory is " + cacheDir);
                }
                core = setInterval(function() {
                    _pulse()
                }, 500);
                warden = setInterval(function() {
                    self.jobWarden()
                }, cycleLength);

                console.log("       --->jobManager " + scheduler_id + " ready to process jobs<---\n\n");
                eventEmitter.emit("ready");
            })
            .on('data', _parseMessage);
    }
function(opt) {
        //console.log(opt)
        if (isStarted) return;
        var self = this;

        if (!opt) {
            throw "Options required to start manager : \"cacheDir\", \"tcp\", \"port\"";
        }
        cacheDir = opt.cacheDir + '/' + scheduler_id;
        TCPip = opt.tcp;
        TCPport = opt.port;
        jobProfiles = opt.jobProfiles;
        cycleLength = opt.cycleLength ? parseInt(opt.cycleLength) : 5000;
        if (opt.hasOwnProperty('forceCache')) {
            cacheDir = opt.forceCache;
        }

        if (opt.hasOwnProperty('probPreviousCacheDir')) {
            probPreviousCacheDir = opt.probPreviousCacheDir;
        }
        if(debugMode)
            console.log("Attempting to create cache for process at " + cacheDir);
        try {
            fs.mkdirSync(cacheDir);
        } catch (e) {
            if (e.code != 'EEXIST') throw e;
            console.log("Cache found already found at " + cacheDir);
        }
        if(debugMode)
            console.log('[' + TCPip + '] opening socket at port ' + TCPport);
        var s = _openSocket(TCPport);
        data = '';
        s.on('listening', function(socket) {
                isStarted = true;
                if(debugMode) {
                    console.log("Starting pulse monitoring");
                    console.log("cache Directory is " + cacheDir);
                }
                core = setInterval(function() {
                    _pulse()
                }, 500);
                warden = setInterval(function() {
                    self.jobWarden()
                }, cycleLength);

                console.log("       --->jobManager " + scheduler_id + " ready to process jobs<---\n\n");
                eventEmitter.emit("ready");
            })
            .on('data', _parseMessage);
    }
function ( opt ) { //console.log(opt) if ( isStarted ) return ; var self = this ; if ( ! opt ) { throw "Options required to start manager : \"cacheDir\", \"tcp\", \"port\"" ; } cacheDir = opt . cacheDir + '/' + scheduler_id ; TCPip = opt . tcp ; TCPport = opt . port ; jobProfiles = opt . jobProfiles ; cycleLength = opt . cycleLength ? parseInt ( opt . cycleLength ) : 5000 ; if ( opt . hasOwnProperty ( 'forceCache' ) ) { cacheDir = opt . forceCache ; } if ( opt . hasOwnProperty ( 'probPreviousCacheDir' ) ) { probPreviousCacheDir = opt . probPreviousCacheDir ; } if ( debugMode ) console . log ( "Attempting to create cache for process at " + cacheDir ) ; try { fs . mkdirSync ( cacheDir ) ; } catch ( e ) { if ( e . code != 'EEXIST' ) throw e ; console . log ( "Cache found already found at " + cacheDir ) ; } if ( debugMode ) console . log ( '[' + TCPip + '] opening socket at port ' + TCPport ) ; var s = _openSocket ( TCPport ) ; data = '' ; s . on ( 'listening' , function ( socket ) { isStarted = true ; if ( debugMode ) { console . log ( "Starting pulse monitoring" ) ; console . log ( "cache Directory is " + cacheDir ) ; } core = setInterval ( function ( ) { _pulse ( ) } , 500 ) ; warden = setInterval ( function ( ) { self . jobWarden ( ) } , cycleLength ) ; console . log ( "       --->jobManager " + scheduler_id + " ready to process jobs<---\n\n" ) ; eventEmitter . emit ( "ready" ) ; } ) . on ( 'data' , _parseMessage ) ; }
Starts the job manager

@param  {Object}ManagerSpecs
@param {ManagerSpecs} cacheDir{String} Directory used for jobs caching
@param {ManagerSpecs} tcp{String} ip adress of the master node for netSocket
@param {ManagerSpecs} port{String} port number of the netSocket
@param {ManagerSpecs} slurmBinaries{String} path to slurm executable binaries
@return {String}
Starts the job manager