Example #1
0
            walltime=15,
            #username=None,
            project=config[resource]['project'],
            access_schema=config[resource]['schema'],
            queue=config[resource]['queue'],
            #database_url='mongodb://138.201.86.166:27017/ee_exp_4c',
        )

        # Allocate the resources.
        cluster.allocate()

        # Set the 'instances' of the pipeline to 16. This means that 16 instances
        # of each pipeline stage are executed.
        #
        # Execution of the 16 pipeline instances can happen concurrently or
        # sequentially, depending on the resources (cores) available in the
        # SingleClusterEnvironment.
        ccount = RunExchange(stages=3, instances=2)

        cluster.run(ccount)

    except EnsemblemdError, er:

        print "Ensemble MD Toolkit Error: {0}".format(str(er))
        raise  # Just raise the execption again to get the backtrace

    try:
        cluster.deallocate()
    except:
        pass
		cluster = ResourceHandle(
				resource=resource,
				cores=config[resource]["cores"],
				walltime=15,
				#username=None,

				project=config[resource]['project'],
				access_schema = config[resource]['schema'],
				queue = config[resource]['queue'],
				database_url='mongodb://*****:*****@ds015335.mlab.com:15335/rp',
			)

		# Allocate the resources. 
		cluster.allocate()

		# We set the simulation 'instances' to 16 and analysis 'instances' to 1. We set the adaptive
		# simulation to True and specify the simulation extraction script to be used.
		cur_path = os.path.dirname(os.path.abspath(__file__))
		mssa = MSSA(iterations=2, simulation_instances=16, analysis_instances=1, adaptive_simulation=True, sim_extraction_script='{0}/extract.py'.format(cur_path))

		cluster.run(mssa)

	except EnsemblemdError, er:

		print "Ensemble MD Toolkit Error: {0}".format(str(er))
		raise # Just raise the execption again to get the backtrace

	try:
		cluster.deallocate()
	except:
		pass
Example #3
0
    pipe = Test(ensemble_size=ENSEMBLE_SIZE + 1, pipeline_size=1)

    # Create an application manager
    app = AppManager(name='Adap_sampling')

    # Register kernels to be used
    app.register_kernels(rand_kernel)
    app.register_kernels(sleep_kernel)

    # Add workload to the application manager
    app.add_workload(pipe)

    # Create a resource handle for target machine
    res = ResourceHandle(
        resource="local.localhost",
        cores=4,
        # username=,
        # project =,
        # queue=,
        walltime=10,
        database_url='mongodb://ensembletk.imp.fu-berlin.de:27017/rp')

    # Submit request for resources + wait till job becomes Active
    res.allocate(wait=True)

    # Run the given workload
    res.run(app)

    # Deallocate the resource
    res.deallocate()