• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.



Page history last edited by PBworks 13 years, 3 months ago


In a few days these changes should be incorporated into the main public code.



#!/usr/bin/env python # This software code is made available "AS IS" without warranties of any # kind. You may copy, display, modify and redistribute the software # code either by itself or as incorporated into your code; provided that # you do not remove any proprietary notices. Your use of this software # code is at your own risk and you waive any claim against Amazon Web # Services LLC or its affiliates with respect to your use of this software # code. (c) 2006 Amazon Web Services LLC or its affiliates. All rights # reserved. ''' ec2-start_cluster.py This script will start mpi nodes on Amazon EC2, change the configuration strings in EC2config.py to match your AWS keys and desired cluster size. Created by Peter Skomoroch on 2007-04-09. Copyright (c) 2007 DataWrangling. All rights reserved. ''' import sys import EC2 from EC2config import * conn = EC2.AWSAuthConnection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) if IMAGE_ID: print "image",IMAGE_ID if globals().has_key("MASTER_IMAGE_ID"): print "master image",MASTER_IMAGE_ID print "----- starting master -----" master_response = conn.run_instances(imageId=MASTER_IMAGE_ID, minCount=1, maxCount=1, keyName= KEYNAME ) print master_response print "----- starting workers -----" instances_response = conn.run_instances(imageId=IMAGE_ID, minCount=(DEFAULT_CLUSTER_SIZE-1)/2, maxCount=DEFAULT_CLUSTER_SIZE-1, keyName= KEYNAME ) print instances_response # if the workers failed, what should do about the master? else: print "----- starting cluster -----" cluster_size=DEFAULT_CLUSTER_SIZE instances_response = conn.run_instances(imageId=IMAGE_ID, minCount=cluster_size/2, maxCount=cluster_size, keyName= KEYNAME ) # instances_response is a list: [["RESERVATION", reservationId, ownerId, ",".join(groups)],["INSTANCE", instanceId, imageId, dnsName, instanceState], [ "INSTANCE"etc]) # same as "describe instance" print instances_response

Comments (0)

You don't have permission to comment on this page.