Esempio n. 1
0
def main():
    """Driver"""
    comm = MPI.COMM_WORLD
    rank = comm.Get_rank()

    nw.kokkos_initialize()
    sim = OversetSimulation(comm)

    sim.printer.echo("Initializing AMR-Wind")
    pamrex = amrex.PyAMReX(comm, "sphere-amr.inp")
    awind = AMRWind(pamrex, sim.tioga)
    sim.register_solver(awind)

    num_nalu_ranks = 8

    sim.printer.echo("Initializing Nalu-Wind on %d MPI ranks" % num_nalu_ranks)
    nalu_comm = create_nalu_comm(comm, num_nalu_ranks)
    if nalu_comm != MPI.COMM_NULL:
        nalu = nw.NaluWind(nalu_comm, "sphere-nalu.yaml", sim.tioga)
        sim.register_solver(nalu)

    num_timesteps = 20

    sim.printer.echo("Initializing overset simulation")
    sim.initialize()
    sim.printer.echo("Initialization successful")
    sim.run_timesteps(num_timesteps)
    sim.summarize_timings()
Esempio n. 2
0
def main():
    """Driver"""
    comm = MPI.COMM_WORLD
    rank = comm.Get_rank()
    mpi_size = comm.Get_size()
    num_nalu_ranks = 8
    if mpi_size < 2 * num_nalu_ranks:
        raise ValueError("Must run on at least %d MPI ranks" %
                         (2 * num_nalu_ranks))
    num_amr_ranks = mpi_size - num_nalu_ranks

    nw.kokkos_initialize()
    sim = OversetSimulation(comm)

    sim.printer.echo("Initializing AMR-Wind on %d MPI ranks" % num_amr_ranks)
    amr_comm = create_subcomm(comm, num_amr_ranks, 0)
    if amr_comm != MPI.COMM_NULL:
        pamrex = amrex.PyAMReX(amr_comm, "sphere-amr.inp")
        awind = AMRWind(pamrex, sim.tioga)
        sim.register_solver(awind)

    sim.printer.echo("Initializing Nalu-Wind on %d MPI ranks" % num_nalu_ranks)
    nalu_comm = create_subcomm(comm, num_nalu_ranks, start_rank=num_amr_ranks)
    if nalu_comm != MPI.COMM_NULL:
        nalu = nw.NaluWind(nalu_comm, "sphere-nalu.yaml", sim.tioga)
        sim.register_solver(nalu)

    num_timesteps = 20

    sim.printer.echo("Initializing overset simulation")
    sim.initialize()
    sim.printer.echo("Initialization successful")
    sim.run_timesteps(num_timesteps)
    sim.summarize_timings()
Esempio n. 3
0
def main():
    """Run overset simulation"""
    num_timesteps = 2
    num_non_lin_iters = 4
    tg = tioga.get_instance()
    tg.set_communicator(MPI.COMM_WORLD)

    comm = MPI.COMM_WORLD
    rank = comm.Get_rank()
    size = comm.Get_size()
    split = 2 if size > 2 else 1
    color = rank // split
    scomm = comm.Split(color, rank)

    inpfile = "rotcyl-cyl.yaml" if color == 1 else "rotcyl-back.yaml"
    if scomm.Get_rank() == 0:
        print("Initializing Nalu-Wind with %s on %d ranks"%(
            inpfile, scomm.Get_size()),
              flush=True)
    nalu = nw.NaluWind(scomm, inpfile, tg)
    nalu.init_prolog(multi_solver_mode=True)
    nalu.pre_overset_conn_work()
    tg.profile()
    tg.perform_connectivity()
    nalu.post_overset_conn_work()
    nalu.init_epilog()
    nalu.prepare_for_time_integration()

    comm.Barrier()
    for nt in range(num_timesteps):
        tinit = time.perf_counter()
        nalu.pre_advance_stage1()
        nalu.pre_overset_conn_work()
        tg.profile()
        tg.perform_connectivity()
        nalu.post_overset_conn_work()
        nalu.pre_advance_stage2()
        comm.Barrier()
        tprep = time.perf_counter()

        for nli in range(num_non_lin_iters):
            ncomp = nalu.register_solution()
            tg.data_update(ncomp)
            nalu.update_solution()
            nalu.advance_timestep()
        comm.Barrier()
        tsolve = time.perf_counter()
        nalu.post_advance()
        tpost = time.perf_counter()
        comm.Barrier()
        if rank == 0:
            print(f"WallClockTime: {nt} Pre: {tprep-tinit:.6f} NLI: {tsolve-tprep:.6f} Post: {tpost-tsolve:.6f} Total: {tpost-tinit:.6f}", flush=True)
Esempio n. 4
0
from exwsim import tioga
from exwsim.amr_wind.amr_wind_py import AMRWind
import exwsim.nalu_wind as nw

comm = MPI.COMM_WORLD
nw.kokkos_initialize()
tg = tioga.get_instance()
tg.set_communicator(comm)

print("Initializing AMR-Wind", flush=True)
pamrex = amrex.PyAMReX(comm, "sphere-amr.inp")
awind = AMRWind(pamrex, tg)
awind.init_prolog()

print("Initializing Nalu-Wind", flush=True)
nalu = nw.NaluWind(comm, "sphere-nalu.yaml", tg)
nalu.init_prolog(multi_solver_mode=True)
nalu.pre_overset_conn_work()
awind.pre_overset_conn_work()
tg.profile()
tg.perform_connectivity()
tg.perform_connectivity_amr()
nalu.post_overset_conn_work()
awind.post_overset_conn_work()
nalu.init_epilog()

nalu.prepare_solver_prolog()
awind.prepare_solver_prolog()

ncomp = nalu.register_solution()
awind.register_solution()
Esempio n. 5
0
from exwsim import tioga
from exwsim.amr_wind.amr_wind_py import AMRWind
import exwsim.nalu_wind as nw

comm = MPI.COMM_WORLD
nw.kokkos_initialize()
tg = tioga.get_instance()
tg.set_communicator(comm)

print("Initializing AMR-Wind", flush=True)
pamrex = amrex.PyAMReX(comm, "ctv-amr.inp")
awind = AMRWind(pamrex, tg)
awind.init_prolog()

print("Initializing Nalu-Wind", flush=True)
nalu = nw.NaluWind(comm, "ctv-nalu.yaml", tg)
nalu.init_prolog(multi_solver_mode=True)
nalu.pre_overset_conn_work()
awind.pre_overset_conn_work()
tg.profile()
tg.perform_connectivity()
tg.perform_connectivity_amr()
nalu.post_overset_conn_work()
awind.post_overset_conn_work()
nalu.init_epilog()
nalu.prepare_solver_prolog()
awind.prepare_solver_prolog()

ncomp = nalu.register_solution()
awind.register_solution()
tg.data_update_amr()