Changeset 92da231 in sasmodels

Nov 24, 2015 4:45:03 PM (7 years ago)
Paul Kienzle <pkienzle@…>
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

add notes about compiler and opencl drivers to docs

2 edited


  • sasmodels/

    r0763009 r92da231  
    2222devices, where it can be combined with other structure factors and form 
    2323factors and have instrumental resolution effects applied. 
     25In order to use OpenCL for your models, you will need OpenCL drivers for 
     26your machine.  These should be available from your graphics card vendor. 
     27Intel provides OpenCL drivers for CPUs as well as their integrated HD 
     28graphics chipsets.  AMD also provides drivers for Intel CPUs, but as of 
     29this writing the performance is lacking compared to the Intel drivers. 
     30NVidia combines drivers for CUDA and OpenCL in one package.  The result 
     31is a bit messy if you have multiple drivers installed.  You can see which 
     32drivers are available by starting python and running: 
     34    import pyopencl as cl 
     35    cl.create_some_context(interactive=True) 
     37Once you have done that, it will show the available drivers which you 
     38can select.  It will then tell you that you can use these drivers 
     39automatically by setting the PYOPENCL_CTX environment variable. 
     41Some graphics cards have multiple devices on the same card.  You cannot 
     42yet use both of them concurrently to evaluate models, but you can run 
     43the program twice using a different device for each session. 
     45OpenCL kernels are compiled when needed by the device driver.  Some 
     46drivers produce compiler output even when there is no error.  You 
     47can see the output by setting PYOPENCL_COMPILER_OUTPUT=1.  It should be 
     48harmless, albeit annoying. 
    2550import os 
  • sasmodels/

    ra30cdd5 r92da231  
    1 """ 
    22C types wrapper for sasview models. 
    55you wish to allow single precision floating point evaluation for the compiled 
    66models, otherwise it defaults to *False*. 
     8The compiler command line is stored in the attribute *COMPILE*, with string 
     9substitutions for %(source)s and %(output)s indicating what to compile and 
     10where to store it.  The actual command is system dependent. 
     12On windows systems, you have a choice of compilers.  *MinGW* is the GNU 
     13compiler toolchain, available in packages such as anaconda and PythonXY, 
     14or available stand alone. This toolchain has had difficulties on some 
     15systems, and may or may not work for you.  In order to build DLLs, *gcc* 
     16must be on your path.  If the environment variable *SAS_OPENMP* is given 
     17then -fopenmp is added to the compiler flags.  This requires a version 
     18of MinGW compiled with OpenMP support. 
     20An alternative toolchain uses the Microsoft Visual C++ compiler, available 
     21free from microsoft: 
     23    ``_ 
     25Again, this requires that the compiler is available on your path.  This is 
     26done by running vcvarsall.bat in a windows terminal.  Install locations are 
     27system dependent, such as: 
     29    C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat 
     31or maybe 
     33    C:\Users\yourname\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat 
     35And again, the environment variable *SAS_OPENMP* controls whether OpenMP is 
     36used to compile the C code.  This requires the Microsoft vcomp90.dll library, 
     37which doesn't seem to be included with the compiler, nor does there appear 
     38to be a public download location.  There may be one on your machine already 
     39in a location such as: 
     41    C:\Windows\winsxs\x86_microsoft.vc90.openmp*\vcomp90.dll 
     43If you copy this onto your path, such as the python directory or the install 
     44directory for this application, then OpenMP should be supported. 
Note: See TracChangeset for help on using the changeset viewer.