Changeset 62243ae in sasview
- Timestamp:
- Dec 22, 2016 8:36:12 AM (8 years ago)
- Children:
- 6c6aa83
- Parents:
- 6af411b
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/custom_config.py
r79492222 r62243ae 15 15 TOOLBAR_SHOW = True 16 16 DEFAULT_PERSPECTIVE = "Fitting" 17 SAS_OPENCL = None -
sasview/local_config.py
r49e000b r62243ae 140 140 UPDATE_TIMEOUT = 2 141 141 142 #OpenCL option 143 SAS_OPENCL = None 144 142 145 def printEVT(message): 143 146 if __EVT_DEBUG__: -
src/sas/sasgui/guiframe/gui_manager.py
r67b0a99 r62243ae 152 152 SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 153 153 SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 154 SAS_OPENCL = config.SAS_OPENCL 154 155 if not WELCOME_PANEL_ON: 155 156 WELCOME_PANEL_SHOW = False … … 176 177 else: 177 178 DEFAULT_OPEN_FOLDER = PATH_APP 179 SAS_OPENCL = custom_config.SAS_OPENCL 178 180 except: 179 181 DATALOADER_SHOW = True … … 190 192 CLEANUP_PLOT = False 191 193 DEFAULT_OPEN_FOLDER = PATH_APP 192 194 SAS_OPENCL = None 193 195 DEFAULT_STYLE = config.DEFAULT_STYLE 194 196 … … 225 227 CHILD_FRAME = wx.Frame 226 228 229 #Initiliaze enviromental variable with custom setting but only if variable not set 230 if SAS_OPENCL and not "SAS_OPENCL" in os.environ: 231 os.environ["SAS_OPENCL"] = SAS_OPENCL 227 232 228 233 class ViewerFrame(PARENT_FRAME): -
src/sas/sasgui/guiframe/startup_configuration.py
rd85c194 r62243ae 31 31 'CLEANUP_PLOT':False, 32 32 'DEFAULT_PERSPECTIVE':'Fitting', 33 'DEFAULT_OPEN_FOLDER': None} 33 'DEFAULT_OPEN_FOLDER': None, 34 'SAS_OPENCL': None} 34 35 try: 35 36 CURRENT_STRINGS = {'GUIFRAME_WIDTH':CURRENT.GUIFRAME_WIDTH, … … 45 46 'CLEANUP_PLOT':CURRENT.CLEANUP_PLOT, 46 47 'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE, 47 'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER} 48 'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER, 49 'SAS_OPENCL': None} 48 50 except: 49 51 CURRENT_STRINGS = DEFAULT_STRINGS -
src/sas/sasgui/perspectives/fitting/gpu_options.py
r6af411b r62243ae 13 13 import logging 14 14 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 15 import imp 15 16 16 17 class GpuOptions(wx.Dialog): … … 25 26 def __init__(self, *args, **kwds): 26 27 27 from sas.sasgui.guiframe.customdir import SetupCustom 28 29 c_conf_dir = SetupCustom().setup_dir(PATH_APP) 30 self.custom_config = _find_local_config('custom_config', c_conf_dir) 31 if self.custom_config is None: 32 self.custom_config = _find_local_config('custom_config', os.getcwd()) 33 if self.custom_config is None: 34 msgConfig = "Custom_config file was not imported" 35 logging.info(msgConfig) 36 else: 37 logging.info("using custom_config in %s" % os.getcwd()) 38 else: 39 logging.info("using custom_config from %s" % c_conf_dir) 40 SAS_OPENCL_CUSTOM = custom_config.SAS_OPENCL 28 # from sas.sasgui.guiframe.customdir import SetupCustom 29 # from sas.sasgui.guiframe.gui_manager import get_app_dir, _find_local_config 30 # 31 # PATH_APP = get_app_dir() 32 # c_conf_dir = SetupCustom().setup_dir(PATH_APP) 33 # self.custom_config = _find_local_config('custom_config', c_conf_dir) 34 # if self.custom_config is None: 35 # self.custom_config = _find_local_config('custom_config', os.getcwd()) 36 # if self.custom_config is None: 37 # msgConfig = "Custom_config file was not imported" 38 # logging.info(msgConfig) 39 # else: 40 # logging.info("using custom_config in %s" % os.getcwd()) 41 # else: 42 # logging.info("using custom_config from %s" % c_conf_dir) 43 44 # SAS_OPENCL_CUSTOM = None 45 # if self.custom_config.SAS_OPENCL: 46 # SAS_OPENCL_CUSTOM = self.custom_config.SAS_OPENCL 41 47 42 48 kwds["style"] = wx.DEFAULT_DIALOG_STYLE … … 52 58 self.buttons = [] 53 59 #Check if SAS_OPENCL is already set as enviromental variable 54 self.sas_opencl = os.environ["SAS_OPENCL"] \55 if "SAS_OPENCL" in os.environ else SAS_OPENCL_CUSTOM56 # or as a custom variable in the config file60 self.sas_opencl = os.environ.get("SAS_OPENCL","") 61 #self.sas_opencl = os.environ["SAS_OPENCL"] \ 62 # if "SAS_OPENCL" in os.environ else SAS_OPENCL_CUSTOM 57 63 58 64 for clopt in clinfo: … … 65 71 else: 66 72 self.option_button[clopt] = "None" 67 if self.sas_opencl.lower() == "none" 73 if self.sas_opencl.lower() == "none": 68 74 button.SetValue(1) 69 75 … … 174 180 if self.sas_opencl: 175 181 os.environ["SAS_OPENCL"] = self.sas_opencl 176 182 else: 177 183 if "SAS_OPENCL" in os.environ: 178 184 del(os.environ["SAS_OPENCL"]) 179 sasmodels.kernelcl.ENV = None 180 #TODO: Write to config.py 181 self.custom_config.SAS_OPENCL = self.sas_opencl 185 186 try: 187 imp.find_module('sasmodels.kernelcl') 188 kernelcl_exist = True 189 except: 190 kernelcl_exist = False 191 if kernelcl_exist: 192 sasmodels.kernelcl.ENV = None 193 #self.custom_config.SAS_OPENCL = self.sas_opencl 182 194 183 195 #Need to reload sasmodels.core module to account SAS_OPENCL = "None"
Note: See TracChangeset
for help on using the changeset viewer.