コード例 #1
0

def _usage():
    print(
        "usage: mpiexec -np {N} python -m mpi4py uc4wood.py {ScenCount} {bundles_per_rank} {PHIterLimit} {fixer|nofixer"
    )
    print("e.g., mpiexec -np 4 python -m mpi4py uc4wood.py 10 0 5 fixer")
    sys.exit(1)


if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG,
                        filename='dlw.log',
                        filemode='w',
                        format='(%(threadName)-10s) %(message)s')
    setup_logger(f'dtm{rank_global}', f'dtm{rank_global}.log')
    dtm = logging.getLogger(f'dtm{rank_global}')

    if len(sys.argv) != 5:
        _usage()

    print("Start time={} for global rank={}".\
          format(datetime.datetime.now(), rank_global))

    try:
        ScenCount = int(sys.argv[1])
        bundles_per_rank = int(sys.argv[2])
        PHIterLimit = int(sys.argv[3])
    except:
        _usage()
    if sys.argv[4] == "fixer":
コード例 #2
0
ファイル: uc3wood.py プロジェクト: sylvainczx/mpi-sppy
                     id_fix_list_fct

# mpi setup
fullcomm = mpi.COMM_WORLD
global_rank = fullcomm.Get_rank()

def _usage():
    print("usage: mpiexec -np {N} python -m mpi4py uc3wood.py {ScenCount} {bundles_per_rank} {PHIterLimit} {fixer|nofixer")
    print("e.g., mpiexec -np 3 python -m mpi4py uc3wood.py 10 0 5 fixer")
    sys.exit(1)


if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG, filename='dlw.log',
                        filemode='w', format='(%(threadName)-10s) %(message)s')
    setup_logger(f'dtm{global_rank}', f'dtm{global_rank}.log')
    dtm = logging.getLogger(f'dtm{global_rank}')

    if len(sys.argv) != 5:
        _usage()

    print("Start time={} for global rank={}".\
          format(datetime.datetime.now(), global_rank))

    try:
        ScenCount = int(sys.argv[1])
        bundles_per_rank = int(sys.argv[2])
        PHIterLimit = int(sys.argv[3])
    except:
        _usage()
    if sys.argv[4] == "fixer":