def __init__(self): print("Setting up distributed code") instance = DistributedAmuse() instance.initialize_code() # instance.parameters.debug = True # instance.parameters.webinterface_port = 4556 instance.commit_parameters() print("url:", instance.get_webinterface_url()) print("Resources:") print(instance.resources) #Claim nodes on the resources. In this example simply the "local" machine pilot = Pilot() pilot.resource_name = 'local' # label of the resource to be used pilot.node_count = 1 # desired number of nodes pilot.time = 99 | units.hour # wallclock that resource remains available (mainly for job queues) pilot.slots_per_node = 99 # slots is accounting measure for a job pilot.node_label = 'local' # label for subgroups of the resource instance.pilots.add_pilot(pilot) print("Reservations:") print(instance.pilots) print("Waiting for reservations") instance.wait_for_pilots() self.instance = instance
def init_das5_only(username, num_nodes, num_cores): print("Setting up distributed code") instance = DistributedAmuse() instance.parameters.debug = False instance.parameters.worker_queue_timeout=1 | units.hour instance.parameters.webinterface_port = 4556 print("url:", instance.get_webinterface_url()) instance.commit_parameters() #print "Resources:" resource = Resource() resource.name = "DAS-5" resource.location = username + "@fs0.das5.cs.vu.nl" resource.scheduler_type = "slurm" resource.amuse_dir = "/home/" + username + "/amuse/amuse" resource.tmp_dir = "/home/" + username + "/tmp" instance.resources.add_resource(resource) #print instance.resources pilot = Pilot() pilot.resource_name="DAS-5" pilot.queue_name="defq" pilot.node_count=num_nodes pilot.time= 24|units.hour pilot.slots_per_node=num_cores pilot.label="DAS-5-Pilot" instance.pilots.add_pilot(pilot) #~ print "Reservations:" #~ print instance.pilots print("Waiting for reservations") instance.wait_for_pilots() return instance
from amuse.community.distributed.interface import ( # Resource, # Resources, Pilot, # Pilots, ) # Simple script to run nosetests using the distributed code. Should work for # any existing amuse test. # This example only runs the tests on the local machine. print("Setting up distributed code") instance = DistributedAmuse(redirection='none') # instance.parameters.debug = True # instance.parameters.webinterface_port = 4556 instance.commit_parameters() # Add some resources # resource = Resource() # resource.name='DAS4-VU' # resource.location="*****@*****.**" # resource.scheduler_type="sge" # resource.amuse_dir="/home/user/amuse" # instance.resources.add_resource(resource) print("Resources:") print(instance.resources) # Claim nodes on the resources. In this example simply the "local" machine pilot = Pilot() pilot.resource_name = 'local' pilot.node_count = 1
import nose from amuse.lab import * from amuse.community.distributed.interface import DistributedAmuseInterface, DistributedAmuse from amuse.community.distributed.interface import Resource, Resources, Pilot, Pilots # Simple script to run nosetests using the distributed code. Should work for any existing amuse test. # This example only runs the tests on the local machine. print "Setting up distributed code" instance = DistributedAmuse(redirection="none") # instance.parameters.debug = True # instance.parameters.webinterface_port = 4556 instance.commit_parameters() # Add some resources # resource = Resource() # resource.name='DAS4-VU' # resource.location="*****@*****.**" # resource.scheduler_type="sge" # resource.amuse_dir="/home/user/amuse" # instance.resources.add_resource(resource) print "Resources:" print instance.resources # Claim nodes on the resources. In this example simply the "local" machine pilot = Pilot() pilot.resource_name = "local" pilot.node_count = 1