Changeset f4f3919 in sasmodels


Ignore:
Timestamp:
Dec 21, 2015 9:29:34 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
5258859
Parents:
e97170c
Message:

improve performance timing by suppressing startup time

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r9a66e65 rf4f3919  
    148148    models more quickly. 
    149149    """ 
     150    pars = pars.copy() 
    150151    for p in pars: 
    151152        if p.endswith("_pd"): pars[p] = 0 
     153    return pars 
    152154 
    153155def eval_sasview(model_definition, pars, data, Nevals=1): 
     
    190192                                platform="ocl", fast=fast) 
    191193    calculator = DirectModel(data, model, cutoff=cutoff) 
    192     value = None  # silence the linter 
     194    # Run the calculator once before starting the timing loop 
     195    value = calculator(**suppress_pd(pars)) 
     196    # Now run the timing loop 
    193197    toc = tic() 
    194198    for _ in range(max(Nevals, 1)):  # force at least one eval 
     
    201205    model = core.load_model(model_definition, dtype=dtype, platform="dll") 
    202206    calculator = DirectModel(data, model, cutoff=cutoff) 
    203     value = None  # silence the linter 
     207    # Run the calculator once before starting the timing loop 
     208    value = calculator(**suppress_pd(pars)) 
     209    # Now run the timing loop 
    204210    toc = tic() 
    205211    for _ in range(max(Nevals, 1)):  # force at least one eval 
     
    268274    # parameter selection 
    269275    if '-mono' in opts: 
    270         suppress_pd(pars) 
     276        pars = suppress_pd(pars) 
    271277    if '-pars' in opts: 
    272278        print("pars "+str(parlist(pars))) 
  • sasmodels/compare_many.py

    r9a66e65 rf4f3919  
    7575        constrain_pars(model_definition, pars_i) 
    7676        constrain_new_to_old(model_definition, pars_i) 
    77         if mono: suppress_pd(pars_i) 
     77        if mono: 
     78            pars_i = suppress_pd(pars_i) 
    7879 
    7980        good = [True] 
Note: See TracChangeset for help on using the changeset viewer.