'walltime':j['walltime'], 'args':[], 'location':j['location'], 'outputdir':j['outputdir'], }
    for key in io_redirect:
        if io_redirect[key]:
            jobspec.update({key: io_redirect[key]})
               
    try:
        scriptm = ComponentProxy("script-manager", defer=False)
        system = ComponentProxy("system", defer=False)

        # try adding job to queue_manager
        pgid = int(scriptm.invoke_mpi_from_script(jobspec))
        
        # give the process a chance to get started before we check for it
        start = time.time()
        while True:
            r = system.get_process_groups([{'id':pgid, 'state':'*'}])
            if r:
                break
            
            # we'll give it 90 seconds to get started
            if time.time() - start > 90:
                break
            
            time.sleep(5)
        
        while True:
            r = system.get_process_groups([{'id':pgid, 'state':'*'}])
            if r and r[0]['state'] == 'running':
                time.sleep(5)
                continue
            else:
Exemple #2
0
"""Tests the pm functions"""

import optparse
import sys
import Cobalt
import Cobalt.Util
from Cobalt.Proxy import ComponentProxy
from Cobalt.Exceptions import ComponentLookupError

if __name__ == "__main__":
    p = optparse.OptionParser(usage="%prog [--wait]")
    p.add_option("--wait", action="store_true", dest="wait",
                 help="Wait on terminated processes")
    opt, args = p.parse_args()

    try:
        pm = ComponentProxy("system", defer=False)
    except ComponentLookupError:
        print >> sys.stderr, "Failed to connect to system"
        raise SystemExit(1)
    if opt.wait:
        pm.wait_process_groups([{"state":"terminated"}])
    pgroups = pm.get_process_groups([{"id":"*", "user":"******", "state":"*", "location":"*"}])
    header = [['Id', 'User', 'State', 'Location']]
    # build output list
    output = []
    for pg in pgroups:
        output.append([pg["id"], pg["user"], pg["state"], pg["location"]])
    Cobalt.Util.printTabular(header + output)
Exemple #3
0
from Cobalt.Proxy import ComponentProxy
from Cobalt.Exceptions import ComponentLookupError

if __name__ == "__main__":
    p = optparse.OptionParser(usage="%prog [--wait]")
    p.add_option("--wait",
                 action="store_true",
                 dest="wait",
                 help="Wait on terminated processes")
    opt, args = p.parse_args()

    try:
        pm = ComponentProxy("system", defer=False)
    except ComponentLookupError:
        print >> sys.stderr, "Failed to connect to system"
        raise SystemExit(1)
    if opt.wait:
        pm.wait_process_groups([{"state": "terminated"}])
    pgroups = pm.get_process_groups([{
        "id": "*",
        "user": "******",
        "state": "*",
        "location": "*"
    }])
    header = [['Id', 'User', 'State', 'Location']]
    # build output list
    output = []
    for pg in pgroups:
        output.append([pg["id"], pg["user"], pg["state"], pg["location"]])
    Cobalt.Util.printTabular(header + output)
Exemple #4
0
               'walltime':j['walltime'], 'args':[], 'location':j['location'], 'outputdir':j['outputdir'], }
    for key in io_redirect:
        if io_redirect[key]:
            jobspec.update({key: io_redirect[key]})
               
    try:
        scriptm = ComponentProxy("script-manager", defer=False)
        system = ComponentProxy("system", defer=False)

        # try adding job to queue_manager
        pgid = int(scriptm.invoke_mpi_from_script(jobspec))
        
        # give the process a chance to get started before we check for it
        start = time.time()
        while True:
            r = system.get_process_groups([{'id':pgid, 'state':'*'}])
            if r:
                break
            
            # we'll give it 90 seconds to get started
            if time.time() - start > 90:
                break
            
            time.sleep(5)
        
        while True:
            r = system.get_process_groups([{'id':pgid, 'state':'*'}])
            if r and r[0]['state'] == 'running':
                time.sleep(5)
                continue
            else: