This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from mpi4py import MPI | |
class MPIFileHandler(logging.FileHandler): | |
def __init__(self,filename, mode=MPI.MODE_WRONLY|MPI.MODE_CREATE|MPI.MODE_APPEND , encoding=None, delay=0, comm=MPI.COMM_WORLD ): | |
encoding = None | |
self.baseFilename = os.path.abspath(filename) | |
self.mode = mode | |
self.encoding = encoding | |
self.comm = comm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto.ec2 | |
def get_region(region_name): | |
for region in boto.ec2.regions(): | |
if region_name == region.name: | |
return region | |
conn = boto.connect_ec2(region=get_region( 'us-east-1')) |