コード例 #1
0
def test_droplet():
    '''
    Run the droplet example
    '''
    pwd = os.path.dirname(__file__)
    full_path_config_file = os.path.join(pwd,
                                         'input/cortix-config-droplet.xml')
    cortix1 = Cortix('cortix-droplet', full_path_config_file)
    cortix1.run_simulations(task_name="droplet-fall")
コード例 #2
0
def main():

 pwd                   = os.path.dirname(__file__)
 full_path_config_file = os.path.join(pwd, 'input/cortix-config-droplet.xml')

 # NB: if another instantiation of Cortix occurs, the cortix wrk directory specified
 #     in the cortix configuration file must be different, else the logging facility 
 #     will have log file collision.

 cortix1 = Cortix( 'cortix-droplet', full_path_config_file ) # see cortix-config-droplet.xml
#
# cortix1.run_simulations( task_name='solo-droplet-fall' )
 cortix1.run_simulations( task_name='droplet-fall' )
コード例 #3
0
ファイル: test_solo_pyplot.py プロジェクト: seamuss1/cortix
def test_solo_pyplot():
    '''
    Run solo_pyplot and make sure the correct output is generated
    '''
    pwd = os.path.dirname(__file__)
    full_path_config_file = os.path.join(pwd, 'input/cortix-config-pyplot.xml')
    comm = MPI.COMM_WORLD
    rank = comm.Get_rank()
    os.system("cp input/state.xml /tmp")
    if rank == 0:
        cortix1 = Cortix('cortix-dev1', full_path_config_file)
        cortix1.run_simulations(task_name="solo-pyplot")
    for i in range(14):
        assert os.path.exists("pyplot_0-timeseq-dashboard-%02d.png" % i)
    os.system("rm -f *.png")
コード例 #4
0
ファイル: main.py プロジェクト: seamuss1/cortix
def main():

    pwd = os.path.dirname(__file__)
    full_path_config_file = os.path.join(pwd, 'input/cortix-config.xml')

    # NB: if another instantiation of Cortix occurs, the cortix wrk directory specified
    #     in the cortix configuration file must be different, else the logging facility
    #     will have log file collision.

    comm = MPI.COMM_WORLD
    size = comm.Get_size()
    rank = comm.Get_rank()

    if (rank == 0):
        cortix1 = Cortix('cortix1', full_path_config_file)
        cortix1.run_simulations(
            task_name='solo-pyplot')  # see cortix-config.xml
コード例 #5
0
def main():

    pwd = os.path.dirname(__file__)
    full_path_config_file = os.path.join(pwd, 'input/cortix-config.xml')

    # NB: if another instantiation of Cortix occurs, the cortix wrk directory specified
    #     in the cortix configuration file must be different, else the logging facility
    #     will have log file collision.

    # comm = MPI.COMM_WORLD
    # size = comm.Get_size()
    # rank = comm.Get_rank()
    # print('size = ',size)
    # print('rank = ',rank)

    # if (rank == 0):
    # Create a PoolExecutor (only one excutor is allowed; to avoid recursion)
    # at the moment, this precludes multiple instantiations of Cortix.
    # Todo: modify in the future if multiple instances of Cortix will be used
    # in the user code.
    #
    # MPI development (pool status: broken)
    # pool_executor = MPIPoolExecutor()
    # usage: mpiexec -n 4 python -m mpi4py.futures main.py
    # pool_executor.bootup(wait=True)

    # concurrent.futures development (pool status: working for thread, issues for process)
    pool_executor = ThreadPoolExecutor()
    # pool_executor = ProcessPoolExecutor()
    #
    cortix1 = Cortix('cortix-dev1', full_path_config_file,
                     pool_executor)  # see cortix-config.xml
    #
    # usage: uncomment only one at a time
    # cortix1.run_simulations( task_name='solo-pyplot' )
    cortix1.run_simulations(task_name='solo-fueldepot')