Changeset 9cfcac8 in sasmodels
- Timestamp:
- Jan 21, 2016 6:31:27 PM (9 years ago)
- 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:
- 608e31e
- Parents:
- caeb06d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rcaeb06d r9cfcac8 9 9 trig, etc., and may not be completely IEEE 754 compliant. This lets 10 10 make sure that the model calculations are stable, or if you need to 11 tag the model as double precision only. 12 13 Run using ./compare.sh (Linux, Mac) or compare.bat (Windows) in the 11 tag the model as double precision only. 12 13 Run using ./compare.sh (Linux, Mac) or compare.bat (Windows) in the 14 14 sasmodels root to see the command line options. 15 15 16 Note that there is no way within sasmodels to select between an 17 OpenCL CPU device and a GPU device, but you can do so by setting the 16 Note that there is no way within sasmodels to select between an 17 OpenCL CPU device and a GPU device, but you can do so by setting the 18 18 PYOPENCL_CTX environment variable ahead of time. Start a python 19 19 interpreter and enter:: … … 262 262 # convert model parameters from sasmodel form to sasview form 263 263 #print("old",sorted(pars.items())) 264 modelname, _ pars= revert_model(model_definition, {})264 modelname, _ = revert_model(model_definition, {}) 265 265 #print("new",sorted(_pars.items())) 266 266 sas = __import__('sas.models.'+modelname) … … 331 331 332 332 def eval_ctypes(model_definition, data, dtype='double', cutoff=0.): 333 """ 334 Return a model calculator using the DLL calculation engine. 335 """ 333 336 if dtype == 'quad': 334 337 dtype = 'longdouble' … … 404 407 parameters. 405 408 """ 406 Nbase, Ncomp = opts[' N1'], opts['N2']409 Nbase, Ncomp = opts['n1'], opts['n2'] 407 410 pars = opts['pars'] 408 411 data = opts['data'] … … 550 553 info = generate.make_info(model_definition) 551 554 # Get the default values for the parameters 552 pars = dict((p[0], p[2]) for p in info['parameters'])555 pars = dict((p[0], p[2]) for p in info['parameters']) 553 556 554 557 # Fill in default values for the polydispersity parameters … … 584 587 sys.exit(1) 585 588 if len(args) > 3: 586 print("expected parameters: model N opencl Nsasview")589 print("expected parameters: model N1 N2") 587 590 588 591 invalid = [o[1:] for o in flags … … 650 653 651 654 if len(engines) == 0: 652 engines.extend(['single', 'sasview'])655 engines.extend(['single', 'sasview']) 653 656 elif len(engines) == 1: 654 657 if engines[0][0] != 'sasview': … … 662 665 model_definition = core.load_model_definition(name) 663 666 664 N1 = int(args[1]) if len(args) > 1 else 1665 N2 = int(args[2]) if len(args) > 2 else 1667 n1 = int(args[1]) if len(args) > 1 else 1 668 n2 = int(args[2]) if len(args) > 2 else 1 666 669 667 670 # Get demo parameters from model definition, or use default parameters … … 695 698 # Create the computational engines 696 699 data, _index = make_data(opts) 697 if N1:700 if n1: 698 701 base = make_engine(model_definition, data, engines[0], opts['cutoff']) 699 702 else: 700 703 base = None 701 if N2:704 if n2: 702 705 comp = make_engine(model_definition, data, engines[1], opts['cutoff']) 703 706 else: … … 708 711 'name' : name, 709 712 'def' : model_definition, 710 ' N1' : N1,711 ' N2' : N2,713 'n1' : n1, 714 'n2' : n2, 712 715 'presets' : presets, 713 716 'pars' : pars,
Note: See TracChangeset
for help on using the changeset viewer.