Esempio n. 1
0
def conv_temporal():
    mpi_num_procs, omp_num_threads = utils.parse_args()
    num_steps = 8
    ############################################################################
    # TEST 1: TEMPORAL CONVERGENCE
    ############################################################################
    # prog          = 'advdiff-ss'
    # prog          = 'advdiff-ss-tv'
    prog          = 'advdiff-ss-tv-extrap'
    vtk_save_rate = 0
    mrg_type      = 3
    np            = mpi_num_procs
    num_pnts      = 8**(math.floor(math.log(np,8)+1))
    nt            = omp_num_threads

    # TREE TOLERANCE
    tl_factor = 1#0.1
    tl_init   = 1e-5
    tl_list   = [tl_init*math.pow(tl_factor,float(cnt)) for cnt in range(0,num_steps)]

    # TIME RESOLUTION
    dt_factor = 0.5
    # dt_init   = 0.1/16#0.5**5
    dt_init   = 0.5**0
    dt_list   = [dt_init*math.pow(dt_factor,float(cnt)) for cnt in range(0,num_steps)]

    # NUM TIME STEPS
    T_END     = 1.0
    tn_factor = 1.0/dt_factor
    tn_init   = T_END/dt_init
    tn_list   = [tn_init*math.pow(tn_factor,float(cnt)) for cnt in range(0,num_steps)]

    dp_list = [15            for cnt in range(0,num_steps)]
    cq_list = [14            for cnt in range(0,num_steps)]
    ci_list = [True          for cnt in range(0,num_steps)]
    uf_list = [2             for cnt in range(0,num_steps)]
    pn_list = [num_pnts      for cnt in range(0,num_steps)]
    np_list = [np            for cnt in range(0,num_steps)]
    nt_list = [nt            for cnt in range(0,num_steps)]
    mg_list = [mrg_type      for cnt in range(0,num_steps)]
    vs_list = [vtk_save_rate for cnt in range(0,num_steps)]
    tt_list = [11            for cnt in range(0,num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(
        prog,
        pn_list,
        tl_list,
        dp_list,
        cq_list,
        ci_list,
        uf_list,
        np_list,
        nt_list,
        dt_list,
        tn_list,
        vs_list,
        mg_list,
        tt_list)
    utils.execute_commands(cmd_args, 'temporal')
Esempio n. 2
0
def conv_temporal_spatial_long_time():
    ############################################################################
    # TEST 2: CONVERGENCE TEST FOR ADVECTION-DIFFUSION SOLVER
    ############################################################################
    mpi_num_procs, omp_num_threads = utils.parse_args()
    # prog          = 'advdiff-ss'
    # prog          = 'advdiff-ss-tv'
    prog = 'advdiff-ss-tv-extrap'

    dt = 0.0628
    vtk_save_rate = 0
    mrg_type = 3
    np = mpi_num_procs
    num_pnts = 8**(math.floor(math.log(np, 8) + 1))
    nt = omp_num_threads

    # UNIFORM
    # dp_list = [5    , 6    , 7    ]
    # cq_list = [3    , 3    , 3    ]
    # ci_list = [True , True , True ]
    # uf_list = [2    , 2    , 2    ]
    # dt_list = [dt   , dt/2 , dt/4 ]
    # tn_list = [100  , 200  , 400  ]
    # num_steps = len(dp_list)
    # tl_list = [1e-30         for cnt in range(0,num_steps)]

    # ADAPTIVE
    # LOW ORDER
    tl_list = [1e-02, 1e-03, 1e-04]
    dp_list = [15, 15, 15]
    cq_list = [3, 3, 3]
    ci_list = [True, True, True]
    uf_list = [2, 2, 2]
    dt_list = [dt, dt / 2, dt / 3]
    tn_list = [100, 200, 300]

    # HIGH ORDER
    # tl_list = [1e-03, 1e-04, 1e-05, 1e-6   ]
    # dp_list = [15   , 15   , 15   , 15     ]
    # cq_list = [14   , 14   , 14   , 14     ]
    # ci_list = [True , True , True , True   ]
    # uf_list = [2    , 2    , 2    , 2      ]
    # dt_list = [dt/4 , dt/8 , dt/16, dt/32 ]
    # tn_list = [400  , 800  , 1600 , 3200  ]

    num_steps = len(dp_list)
    pn_list = [num_pnts for cnt in range(0, num_steps)]
    np_list = [np for cnt in range(0, num_steps)]
    nt_list = [nt for cnt in range(0, num_steps)]
    mg_list = [mrg_type for cnt in range(0, num_steps)]
    vs_list = [vtk_save_rate for cnt in range(0, num_steps)]
    tt_list = [11 for cnt in range(0, num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(prog, pn_list, tl_list, dp_list,
                                       cq_list, ci_list, uf_list, np_list,
                                       nt_list, dt_list, tn_list, vs_list,
                                       mg_list, tt_list)
    utils.execute_commands(cmd_args, 'temporal-spatial-long-time')
Esempio n. 3
0
def conv_temporal():
    mpi_num_procs, omp_num_threads = utils.parse_args()
    num_steps = 8
    ############################################################################
    # TEST 1: TEMPORAL CONVERGENCE
    ############################################################################
    # prog          = 'advdiff-ss'
    # prog          = 'advdiff-ss-tv'
    prog = 'advdiff-ss-tv-extrap'
    vtk_save_rate = 0
    mrg_type = 3
    np = mpi_num_procs
    num_pnts = 8**(math.floor(math.log(np, 8) + 1))
    nt = omp_num_threads

    # TREE TOLERANCE
    tl_factor = 1  #0.1
    tl_init = 1e-5
    tl_list = [
        tl_init * math.pow(tl_factor, float(cnt))
        for cnt in range(0, num_steps)
    ]

    # TIME RESOLUTION
    dt_factor = 0.5
    # dt_init   = 0.1/16#0.5**5
    dt_init = 0.5**0
    dt_list = [
        dt_init * math.pow(dt_factor, float(cnt))
        for cnt in range(0, num_steps)
    ]

    # NUM TIME STEPS
    T_END = 1.0
    tn_factor = 1.0 / dt_factor
    tn_init = T_END / dt_init
    tn_list = [
        tn_init * math.pow(tn_factor, float(cnt))
        for cnt in range(0, num_steps)
    ]

    dp_list = [15 for cnt in range(0, num_steps)]
    cq_list = [14 for cnt in range(0, num_steps)]
    ci_list = [True for cnt in range(0, num_steps)]
    uf_list = [2 for cnt in range(0, num_steps)]
    pn_list = [num_pnts for cnt in range(0, num_steps)]
    np_list = [np for cnt in range(0, num_steps)]
    nt_list = [nt for cnt in range(0, num_steps)]
    mg_list = [mrg_type for cnt in range(0, num_steps)]
    vs_list = [vtk_save_rate for cnt in range(0, num_steps)]
    tt_list = [11 for cnt in range(0, num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(prog, pn_list, tl_list, dp_list,
                                       cq_list, ci_list, uf_list, np_list,
                                       nt_list, dt_list, tn_list, vs_list,
                                       mg_list, tt_list)
    utils.execute_commands(cmd_args, 'temporal')
Esempio n. 4
0
def conv_temporal_spatial_long_time():
    ############################################################################
    # TEST 2: CONVERGENCE TEST FOR ADVECTION
    ############################################################################
    mpi_num_procs, omp_num_threads = utils.parse_args()
    prog          = 'advection'
    dt            = 0.0628
    vsr           = 0
    mrg_type      = 3
    np            = mpi_num_procs
    num_pnts      = 8**(math.floor(math.log(np,8)+1))
    nt            = omp_num_threads

    # UNIFORM
    dp_list = [5    , 6    , 7    ]#, 5     , 6     , 7    ]
    cq_list = [3    , 3    , 3    ]#, 3     , 3     , 3    ]
    ci_list = [False , False , False ]#, False , False , False]
    uf_list = [2    , 2    , 2    ]#, 2     , 2     , 2    ]
    dt_list = [dt   , dt/2 , dt/4 ]#, dt    , dt/2  , dt/4 ]
    tn_list = [100  , 200  , 400  ]#, 100   , 200   , 400  ]
    num_steps = len(dp_list)
    tl_list = [1e-30         for cnt in range(0,num_steps)]

    # ADAPTIVE
    # tl_list = [1e-02, 1e-03, 1e-04, 1e-02 , 1e-03 , 1e-04]
    # dp_list = [15   , 15   , 15   , 15    , 15    , 15   ]
    # cq_list = [3    , 3    , 3    , 3     , 3     , 3    ]
    # ci_list = [True , True , True , False , False , False]
    # uf_list = [2    , 2    , 2    , 2     , 2     , 2    ]
    # dt_list = [dt   , dt/2 , dt/4 , dt    , dt/2  , dt/4 ]
    # tn_list = [100  , 200  , 400  , 100   , 200   , 400  ]

    num_steps = len(dp_list)
    pn_list = [num_pnts      for cnt in range(0,num_steps)]
    np_list = [np            for cnt in range(0,num_steps)]
    nt_list = [nt            for cnt in range(0,num_steps)]
    mg_list = [mrg_type      for cnt in range(0,num_steps)]
    vs_list = [vsr           for cnt in range(0,num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(
        prog,
        pn_list,
        tl_list,
        dp_list,
        cq_list,
        ci_list,
        uf_list,
        np_list,
        nt_list,
        dt_list,
        tn_list,
        vs_list,
        mg_list)
    utils.execute_commands(cmd_args, 'temporal-spatial-long-time')
Esempio n. 5
0
def scals():
    mpi_num_procs, omp_num_threads = utils.parse_args()
    ############################################################################
    # TEST 1: STRONG SCALING
    ############################################################################
    # prog  = 'advection'
    prog  = 'advdiff-ss'
    np_list = [
             1,
             2,
             4,
             8,
             # 16,
             # 32,
             # 64,
            ]
    mrg_type = 3;
    max_np        = max(np_list)
    num_pnts      = 8**3#(math.floor(math.log(max_np,8)+1))

    num_steps = len(np_list)
    pn_list = [num_pnts        for cnt in range(0,num_steps)]
    tl_list = [1e-0            for cnt in range(0,num_steps)]
    dp_list = [15              for cnt in range(0,num_steps)]
    cq_list = [14              for cnt in range(0,num_steps)]
    ci_list = [True            for cnt in range(0,num_steps)]
    uf_list = [4               for cnt in range(0,num_steps)]
    nt_list = [omp_num_threads for cnt in range(0,num_steps)]
    dt_list = [0.125           for cnt in range(0,num_steps)]
    tn_list = [1               for cnt in range(0,num_steps)]
    vs_list = [0               for cnt in range(0,num_steps)]
    mg_list = [mrg_type        for cnt in range(0,num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(
        prog,
        pn_list,
        tl_list,
        dp_list,
        cq_list,
        ci_list,
        uf_list,
        np_list,
        nt_list,
        dt_list,
        tn_list,
        vs_list,
        mg_list)
    utils.execute_commands(cmd_args, 'sscal'+prog)
Esempio n. 6
0
def conv_temporal_spatial_long_time():
    ############################################################################
    # TEST 2: CONVERGENCE TEST FOR ADVECTION
    ############################################################################
    mpi_num_procs, omp_num_threads = utils.parse_args()
    prog = 'advection'
    dt = 0.0628
    vsr = 0
    mrg_type = 3
    np = mpi_num_procs
    num_pnts = 8**(math.floor(math.log(np, 8) + 1))
    nt = omp_num_threads

    # UNIFORM
    dp_list = [5, 6, 7]  #, 5     , 6     , 7    ]
    cq_list = [3, 3, 3]  #, 3     , 3     , 3    ]
    ci_list = [False, False, False]  #, False , False , False]
    uf_list = [2, 2, 2]  #, 2     , 2     , 2    ]
    dt_list = [dt, dt / 2, dt / 4]  #, dt    , dt/2  , dt/4 ]
    tn_list = [100, 200, 400]  #, 100   , 200   , 400  ]
    num_steps = len(dp_list)
    tl_list = [1e-30 for cnt in range(0, num_steps)]

    # ADAPTIVE
    # tl_list = [1e-02, 1e-03, 1e-04, 1e-02 , 1e-03 , 1e-04]
    # dp_list = [15   , 15   , 15   , 15    , 15    , 15   ]
    # cq_list = [3    , 3    , 3    , 3     , 3     , 3    ]
    # ci_list = [True , True , True , False , False , False]
    # uf_list = [2    , 2    , 2    , 2     , 2     , 2    ]
    # dt_list = [dt   , dt/2 , dt/4 , dt    , dt/2  , dt/4 ]
    # tn_list = [100  , 200  , 400  , 100   , 200   , 400  ]

    num_steps = len(dp_list)
    pn_list = [num_pnts for cnt in range(0, num_steps)]
    np_list = [np for cnt in range(0, num_steps)]
    nt_list = [nt for cnt in range(0, num_steps)]
    mg_list = [mrg_type for cnt in range(0, num_steps)]
    vs_list = [vsr for cnt in range(0, num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(prog, pn_list, tl_list, dp_list,
                                       cq_list, ci_list, uf_list, np_list,
                                       nt_list, dt_list, tn_list, vs_list,
                                       mg_list)
    utils.execute_commands(cmd_args, 'temporal-spatial-long-time')
Esempio n. 7
0
def omp():
    ############################################################################
    # TEST: OMP SCALING
    ############################################################################
    mpi_num_procs, omp_num_threads = utils.parse_args()
    # prog     = 'advection'
    prog     = 'advdiff-ss'
    dt       = 0.0628
    vsr      = 0
    mrg_type = 3
    num_pnts = 8**(math.floor(math.log(mpi_num_procs,8)+1))

    num_steps = omp_num_threads
    nt_list = [cnt+1    for cnt in range(0,num_steps)]
    np_list = [mpi_num_procs for cnt in range(0,num_steps)]

    tn_list = [10       for cnt in range(0,num_steps)]
    pn_list = [num_pnts for cnt in range(0,num_steps)]
    tl_list = [1e-30    for cnt in range(0,num_steps)]
    dp_list = [4        for cnt in range(0,num_steps)]
    mg_list = [mrg_type for cnt in range(0,num_steps)]
    vs_list = [vsr      for cnt in range(0,num_steps)]
    cq_list = [14       for cnt in range(0,num_steps)]
    ci_list = [True     for cnt in range(0,num_steps)]
    uf_list = [4        for cnt in range(0,num_steps)]
    dt_list = [dt       for cnt in range(0,num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(
        prog,
        pn_list,
        tl_list,
        dp_list,
        cq_list,
        ci_list,
        uf_list,
        np_list,
        nt_list,
        dt_list,
        tn_list,
        vs_list,
        mg_list)
    utils.execute_commands(cmd_args, 'omp'+prog)
Esempio n. 8
0
def conv_spatial():
    ############################################################################
    # TEMPORAL CONVERGENCE TEST FOR ADVECTION
    ############################################################################
    mpi_num_procs, omp_num_threads = utils.parse_args()
    prog = 'advection'
    num_steps = 8

    ##############################
    # TREE TOLERANCE
    ##############################
    tl_fact = 0.1
    tl_init = 1e-1
    tl_list = [
        tl_init * math.pow(tl_fact, float(cnt)) for cnt in range(0, num_steps)
    ]

    ##############################
    # TIME RESOLUTION
    ##############################
    dt_fact = 1
    dt_init = 1e-3
    dt_list = [
        dt_init * math.pow(dt_fact, float(cnt)) for cnt in range(0, num_steps)
    ]

    T_END = 1.0
    tn_fact = 1.0 / dt_fact
    tn_init = 1  #T_END/dt_init
    tn_list = [
        tn_init * math.pow(tn_fact, float(cnt)) for cnt in range(0, num_steps)
    ]

    ##############################
    # TREE DEPTH/POINTS
    ##############################
    dp_list = [15 for cnt in range(0, num_steps)]

    num_pnts = 8**(math.floor(math.log(mpi_num_procs, 8) + 1))
    pn_list = [num_pnts for cnt in range(0, num_steps)]

    ##############################
    # PARALLEL
    ##############################
    mpi_num_procs = mpi_num_procs
    np_list = [mpi_num_procs for cnt in range(0, num_steps)]

    nt = omp_num_threads
    nt_list = [nt for cnt in range(0, num_steps)]

    mrg_type = 3
    mg_list = [mrg_type for cnt in range(0, num_steps)]

    ##############################
    # CHEBYSHEV/CUBIC INTERPOLATION
    ##############################
    cq_list = [14 for cnt in range(0, num_steps)]
    ci_list = [True for cnt in range(0, num_steps)]
    uf_list = [4 for cnt in range(0, num_steps)]

    ##############################
    # VISUALIZATION
    ##############################
    vtk_save_rate = 0
    vs_list = [vtk_save_rate for cnt in range(0, num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(prog, pn_list, tl_list, dp_list,
                                       cq_list, ci_list, uf_list, np_list,
                                       nt_list, dt_list, tn_list, vs_list,
                                       mg_list)
    utils.execute_commands(cmd_args, 'spatial')
Esempio n. 9
0
def scalws():
    ############################################################################
    # TEST 1: WEAK/STRONG SCALING FOR ADVECTION SOLVER
    ############################################################################
    prog  = 'advection'
    tl_list = [
            # 1e+0,
            1e-2,
            1e-4,
            1e-7,
            ]
    dp_list = [
            # 6,
            # 8,
            # 10,
            15,
        ]
    cq_list = [
            4,
            6,
            14,
            ]
    np_list = [
            1,
            2,
            4,
            8,
            16,
            32,
            ]
    # dt = 7.85398e-03
    # tn = 100
    dt = 0.0628
    tn = 200
    use_cubic     = True
    vsr = 0
    merge_type    = 3

    max_np        = max(np_list)
    num_pnts      = 8**(math.floor(math.log(max_np,8)+1))
    uf            = 2

    table_counter = 0
    for cq in cq_list:
        for tl in tl_list:
            if cq is 4 and tl is 1e-7:
                continue
            for dp in dp_list:
                # USE UF 4 FOR Q 14
                if cq is 14:
                    uf = 4
                cmd_args = OrderedDict()
                cmd_id = 0
                for np in np_list:
                    cmd_args[cmd_id] = utils.generate_commands(
                        prog    = prog,
                        pn_list = [num_pnts        ],
                        tl_list = [tl              ],
                        dp_list = [dp              ],
                        cq_list = [cq              ],
                        ci_list = [use_cubic       ],
                        uf_list = [uf              ],
                        np_list = [np              ],
                        nt_list = [omp_num_threads ],
                        dt_list = [dt              ],
                        tn_list = [tn              ],
                        vs_list = [vsr   ],
                        mg_list = [merge_type      ]
                        )[1]
                    cmd_id = cmd_id + 1
                utils.execute_commands(cmd_args, 'scalws'+prog+'-table-'+str(table_counter))
                table_counter = table_counter + 1
Esempio n. 10
0
def conv_temporal_spatial_long_time():
    ############################################################################
    # TEST 2: CONVERGENCE TEST FOR ADVECTION-DIFFUSION SOLVER
    ############################################################################
    mpi_num_procs, omp_num_threads = utils.parse_args()
    # prog          = 'advdiff-ss'
    # prog          = 'advdiff-ss-tv'
    prog          = 'advdiff-ss-tv-extrap'

    dt            = 0.0628
    vtk_save_rate = 0
    mrg_type      = 3
    np            = mpi_num_procs
    num_pnts      = 8**(math.floor(math.log(np,8)+1))
    nt            = omp_num_threads

    # UNIFORM
    # dp_list = [5    , 6    , 7    ]
    # cq_list = [3    , 3    , 3    ]
    # ci_list = [True , True , True ]
    # uf_list = [2    , 2    , 2    ]
    # dt_list = [dt   , dt/2 , dt/4 ]
    # tn_list = [100  , 200  , 400  ]
    # num_steps = len(dp_list)
    # tl_list = [1e-30         for cnt in range(0,num_steps)]

    # ADAPTIVE
    # LOW ORDER
    tl_list = [1e-02, 1e-03, 1e-04 ]
    dp_list = [15   , 15   , 15    ]
    cq_list = [3    , 3    , 3     ]
    ci_list = [True , True , True  ]
    uf_list = [2    , 2    , 2     ]
    dt_list = [dt   , dt/2 , dt/3  ]
    tn_list = [100  , 200  , 300   ]

    # HIGH ORDER
    # tl_list = [1e-03, 1e-04, 1e-05, 1e-6   ]
    # dp_list = [15   , 15   , 15   , 15     ]
    # cq_list = [14   , 14   , 14   , 14     ]
    # ci_list = [True , True , True , True   ]
    # uf_list = [2    , 2    , 2    , 2      ]
    # dt_list = [dt/4 , dt/8 , dt/16, dt/32 ]
    # tn_list = [400  , 800  , 1600 , 3200  ]


    num_steps = len(dp_list)
    pn_list = [num_pnts      for cnt in range(0,num_steps)]
    np_list = [np            for cnt in range(0,num_steps)]
    nt_list = [nt            for cnt in range(0,num_steps)]
    mg_list = [mrg_type      for cnt in range(0,num_steps)]
    vs_list = [vtk_save_rate for cnt in range(0,num_steps)]
    tt_list = [11            for cnt in range(0,num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(
        prog,
        pn_list,
        tl_list,
        dp_list,
        cq_list,
        ci_list,
        uf_list,
        np_list,
        nt_list,
        dt_list,
        tn_list,
        vs_list,
        mg_list,
        tt_list)
    utils.execute_commands(cmd_args, 'temporal-spatial-long-time')
Esempio n. 11
0
def conv_spatial():
    ############################################################################
    # TEMPORAL CONVERGENCE TEST FOR ADVECTION
    ############################################################################
    mpi_num_procs, omp_num_threads = utils.parse_args()
    prog = 'advection'
    num_steps = 8

    ##############################
    # TREE TOLERANCE
    ##############################
    tl_fact = 0.1
    tl_init = 1e-1
    tl_list = [tl_init*math.pow(tl_fact,float(cnt)) for cnt in range(0,num_steps)]

    ##############################
    # TIME RESOLUTION
    ##############################
    dt_fact = 1
    dt_init = 1e-3
    dt_list = [dt_init*math.pow(dt_fact,float(cnt)) for cnt in range(0,num_steps)]

    T_END   = 1.0
    tn_fact = 1.0/dt_fact
    tn_init = 1#T_END/dt_init
    tn_list = [tn_init*math.pow(tn_fact,float(cnt)) for cnt in range(0,num_steps)]

    ##############################
    # TREE DEPTH/POINTS
    ##############################
    dp_list  = [15 for cnt in range(0,num_steps)]

    num_pnts = 8**(math.floor(math.log(mpi_num_procs,8)+1))
    pn_list  = [num_pnts      for cnt in range(0,num_steps)]

    ##############################
    # PARALLEL
    ##############################
    mpi_num_procs = mpi_num_procs
    np_list = [mpi_num_procs for cnt in range(0,num_steps)]

    nt = omp_num_threads
    nt_list = [nt for cnt in range(0,num_steps)]

    mrg_type = 3
    mg_list = [mrg_type for cnt in range(0,num_steps)]

    ##############################
    # CHEBYSHEV/CUBIC INTERPOLATION
    ##############################
    cq_list = [14   for cnt in range(0, num_steps)]
    ci_list = [True for cnt in range(0, num_steps)]
    uf_list = [4    for cnt in range(0, num_steps)]

    ##############################
    # VISUALIZATION
    ##############################
    vtk_save_rate = 0
    vs_list = [vtk_save_rate for cnt in range(0,num_steps)]

    cmd_args = OrderedDict()
    cmd_args = utils.generate_commands(
        prog,
        pn_list,
        tl_list,
        dp_list,
        cq_list,
        ci_list,
        uf_list,
        np_list,
        nt_list,
        dt_list,
        tn_list,
        vs_list,
        mg_list)
    utils.execute_commands(cmd_args, 'spatial')