Example #1
0
from batchq.queues import LSFBSub
from batchq.core.batch import DescriptorQ, load_queue

q = load_queue(LSFBSub, "brutus,tronnow")
for i in range(1, 10):
    desc = DescriptorQ(q,
                       command="./sleepy %d" % i,
                       input_directory=".",
                       output_directory=".",
                       overwrite_submission_id="simu%d" % i)

    print "Handling job %d" % i
    desc.job()
Example #2
0
from batchq.queues import  LSFBSub
from batchq.core.batch import DescriptorQ, load_queue

q = load_queue(LSFBSub, "my_server_configuration,your_name") 
for i in range(1,10):
    desc = DescriptorQ(q, command="./sleepy %d" %i, input_directory=".", output_directory=".", overwrite_submission_id="simu%d" %i)

    print "Handling job %d" %i
    desc.job()
Example #3
0
def runApplicationBackground(appname, parmfile, Tmin=None, Tmax=None, writexml=False, MPI=None, mpirun='mpirun', queue=None, descriptor=None, force_resubmit = False):
    """ run an ALPS application 
    
        This function runs an ALPS application. The parameers are:
        
        appname: the name of the application
        parmfile: the name of the main XML input file
        write_xml: optional parameter, to be set to True if all results should be written to the XML files in addition to the HDF5 files
        Tmin: optional parameter specifying the minimum time between checks whether a MC simulatio is finished
        Tmax: optional parameter specifying the maximum time between checks whether a MC simulatio is finished
        MPI: optional parameter specifying the number of processes to be used in an MPI simulation. MPI is not used if this parameter is left at ots default value  None.
        mpirun: optional parameter giving the name of the executable used to laucnh MPI applications. The default is 'mpirun'
    """
    cmdline = []
    if MPI != None:
        cmdline += [mpirun,'-np',str(MPI)]
    cmdline += [appname]
    if MPI != None:
        cmdline += ['--mpi']
        if appname in ['sparsediag','fulldiag','dmrg']:
            cmdline += ['--Nmax','1']
    cmdline += [parmfile]
    if Tmin:
      cmdline += ['--Tmin',str(Tmin)]
    if Tmax:
      cmdline += ['--TMax',str(TMax)]
    if writexml:
      cmdline += ['--write-xml']


    if not queue is None or not descriptor is None:
        input_hash = hash_filelist([parmfile])
        if not descriptor is None:
            desc = copy.copy(descriptor)
            desc.update_configuration({'input_directory': ".", 'output_directory': ".", 'command': " ".join(cmdline), 'overwrite_submission_id': input_hash})
        else:
            desc = DescriptorQ(queue,  {'input_directory': ".", 'output_directory': ".", 'command': " ".join(cmdline), 'overwrite_submission_id': input_hash} )

        if not desc.wasstarted() or desc.failed() or force_resubmit:
            if desc.failed():
                print "Your last submission FAILED running: "," ".join(cmdline)
            desc.clean()
            desc.submit()
        elif desc.finished():
            desc.recv()


        return desc
    
    raise BaseException("Please provide a queue or a descriptor as arugment of runApplicationBackground.")
Example #4
0
from batchq.queues import LSFBSub
from batchq.core.batch import DescriptorQ, load_queue

q = load_queue(LSFBSub, "my_server_configuration,your_name")
desc1 = DescriptorQ(q,
                    command="./sleepy 1",
                    input_directory=".",
                    output_directory=".",
                    overwrite_submission_id="simu1")
desc2 = DescriptorQ(q,
                    command="./sleepy 2",
                    input_directory=".",
                    output_directory=".",
                    overwrite_submission_id="simu2")

print "Handling job 1"
desc1.job()
print "Handling job 2"
desc2.job()
Example #5
0
from batchq.queues import  LSFBSub
from batchq.core.batch import DescriptorQ, load_queue

q = load_queue(LSFBSub, "brutus,tronnow")  
desc1 = DescriptorQ(q, command="./sleepy 1", input_directory=".", output_directory=".", overwrite_submission_id="simu1")
desc2 = DescriptorQ(q, command="./sleepy 2", input_directory=".", output_directory=".", overwrite_submission_id="simu2")

print "Handling job 1"
desc1.job()
print "Handling job 2"
desc2.job()