Exemplo n.º 1
0
def main():

    size = 10000           # lengt of vector v
    ITER = 50              # number of iterations to run for each report


    comm = MPI.COMM_WORLD
    # size = comm.Get_size()

    # Configure and connect to the Kafka data backbone server.
    # This is done only once by the rank 0 MPI process.
    #
    if comm.rank == MASTER:

        # Parse the command line
        #
        try:
            options = parse_commandline()

        except Exception, ex:
            logger.error("Command line parsing error: %s", str(ex))
            comm.Abort(-1)

        # Connect to Kafka
        #
        kw_cfg = KafkaWriterConfig(Host=options.KafkaHost, Topic=options.KafkaTopic)
        try:
            kw = KafkaWriter(kw_cfg)
            kw.connect()
            logger.info('connecting to Kafka backbone via %s', kw_cfg.Host)
        except Exception, ex:
            logger.error("Error connecting to Kafka backbone via %s: %s",  kw_cfg.Host, str(ex) )
            comm.Abort(-1)
Exemplo n.º 2
0
def main():

    # Parse the command line
    try:
        options = parse_commandline()

    except Exception, ex:
        print str(ex)
        sys.exit(-1)
Exemplo n.º 3
0
def main():
    """Entry point for the application script"""

    # Parse the command line
    try:
        options = parse_commandline()

    except Exception, ex:
        print str(ex)
        sys.exit(-1)