schrodinger.application.matsci.configdlgs module

Module for config dialog classes used by MatSci panels

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.configdlgs.PerStrucConfigDialog(parent, title='', jobname='', checkcommand=None, multi_gpgpu_allowed=True, no_cpu=True, **kw)

Bases: schrodinger.application.desmond.gui.DesmondGuiConfigDialog

Dialog for configuring jobs that can have CPUs/GPUs per input structure specified.

CPU_UNIT_LABEL = 'processors per structure'
GPU_UNIT_LABEL = 'GPUs per structure'
CANCEL = 'Cancel'
HELP = 'Help'
HOST_LABEL_TEXT = 'Host:'
PRODUCT_HOSTS_KEY = 'product_hosts'
SAVE = 'OK'
START = 'Run'
WRITE = 'Write'
__init__(parent, title='', jobname='', checkcommand=None, multi_gpgpu_allowed=True, no_cpu=True, **kw)

See class docstring. Raises an Exception if the disposition specified as the default is not recognized.

If pre_close_command is specified, it will be run when the user presses the Start button. The dialog is only closed if that function returns 0.

activate()

Display the dialog and return the dialog parameters as as StartDialogParam object. If the dialog was cancelled then return None and restore the prior state.

applySettings(settings)

See parent class docstring

cpus3Edited(ignored=None)
currentHost(menu=None)

Returns the host currently selected in the menu parameter. If none is given, use self.host_menu. currentHost() can be overridden to use a different menu by default.

Parameters

menu (QtWidgets.QComboBox) – Menu to check for current host

error(text)

Show an error message with the specified text.

Parameters

msg (str) – Error to show.

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

getHostType()
getHosts(_1=True, _2=False)

Get the hosts based on current CPU/GPU setting.

Returns

List of current hosts

Return type

config_dialog.Host

getNumCpusToValidate(is_queue)

Return the maximum number of processors that the job could potentially use, for validation.

Parameters

is_queue (bool) – If True, return number of threads per subjob requested, if False return number of threads * number of subjobs.

getOpenMPSettings()
Based on Open MP settings, return a tuple of:
  • Maximum number of CPUs to use

  • Number of threads to use.

  • Maximum number of subjobs to create.

Returns

(#cpus, #threads, #subjobs)

Return type

(int, int, int)

getSettings(extra_kws=None)

Return dialog state by saving the state of the checkbox and then calling the base class

getTotalOpenMPCPUs()

Compute the total number of Open MP CPUs to use based on the number of threads and subjobs the user entered

Return type

int

Returns

total number of CPUs

isCPUHost()
isGPUHost()
onProcUnitComboIndexChanged(use_host=None)

Update the available hosts based on the current processor unit type. Will also hide/show widgets based on whether GPU is selected but no GPU hosts are available or not.

Parameters

use_host (str) – Host to be set in the host combo

onWriteRequested()

Slot for Write button.

savePressed()

Slot for Save button

setUpButtonBox(can_start=True)

Set up the dialog’s button box and add ‘Write’ button.

setupHostCombo(combo, use_host=None, hosts=None)
setupHostLayout()

Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).

Returns

Whether the dialog should add a start button.

Return type

bool

showHelp()
startPressed()

Slot for OK and Run button

updateCPULimits()

This method is called whenever host selection is changed. It updates maximum number of allowed CPUs.

updateOpenMPInfo()

Show/Hide the proper frames and update the processors label

updateOpenMPLabel()

Update the Open MP label with the current number of processors requested

updateQueueResources()

This updates the queue resources display when the host has changed.

validate()

Checks the panel to make sure settings are valid. Return False if any validation test fails, otherwise return True.

validateAndAccept()

Validate the settings, and if no errors are found, close the dialog.

validateNumCpus(host, editfield, silent=False)

Validate number of CPUs :type host: Host :param host: the host on which the CPUs reside :type editfield: QWidget :param editfield: widget specifying the number of CPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumGpus(host, editfield, silent=False)

Validate number of GPUs :type host: Host :param host: the host on which the GPUs reside :type editfield: QWidget :param editfield: widget specifying the number of GPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumOpenMP(host, silent=False)

Checks to make sure the number of requested processors and threads is consistent with what we know of the host capabilities.

Parameters
  • host (Host) – The host on which the CPUs reside

  • silent (bool) – suppresses warning dialogs when set to True

Return type

bool

Returns

True if number of processors & threads is allowed, False if not

validateNumProcs(silent=False)

See ConfigDialog.validateNumProcs docstring.

warning(text)

Display a warning window with the specified text.

writePressed()

Slot for Write button

class schrodinger.application.matsci.configdlgs.PerStrucSingleGpuConfigDialog(*args, **kwargs)

Bases: schrodinger.application.desmond.gui.SingleGpuDesmondGuiConfigDialog

Class to configure jobs that can use a single GPU per input structure.

CPU_UNIT_LABEL = 'processors per structure'
GPU_UNIT_LABEL = 'GPUs per structure'
CANCEL = 'Cancel'
HELP = 'Help'
HOST_LABEL_TEXT = 'Host:'
PRODUCT_HOSTS_KEY = 'product_hosts'
SAVE = 'OK'
START = 'Run'
WRITE = 'Write'
__init__(*args, **kwargs)

See class docstring. Raises an Exception if the disposition specified as the default is not recognized.

If pre_close_command is specified, it will be run when the user presses the Start button. The dialog is only closed if that function returns 0.

activate()

Display the dialog and return the dialog parameters as as StartDialogParam object. If the dialog was cancelled then return None and restore the prior state.

applySettings(settings)

See parent class docstring

cpus3Edited(ignored=None)
currentHost(menu=None)

Returns the host currently selected in the menu parameter. If none is given, use self.host_menu. currentHost() can be overridden to use a different menu by default.

Parameters

menu (QtWidgets.QComboBox) – Menu to check for current host

error(text)

Show an error message with the specified text.

Parameters

msg (str) – Error to show.

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

getHostType()
getHosts(_1=True, _2=False)

Get the hosts based on current CPU/GPU setting.

Returns

List of current hosts

Return type

config_dialog.Host

getNumCpusToValidate(is_queue)

Return the maximum number of processors that the job could potentially use, for validation.

Parameters

is_queue (bool) – If True, return number of threads per subjob requested, if False return number of threads * number of subjobs.

getOpenMPSettings()
Based on Open MP settings, return a tuple of:
  • Maximum number of CPUs to use

  • Number of threads to use.

  • Maximum number of subjobs to create.

Returns

(#cpus, #threads, #subjobs)

Return type

(int, int, int)

getSettings(extra_kws=None)

Return dialog state by saving the state of the checkbox and then calling the base class

getTotalOpenMPCPUs()

Compute the total number of Open MP CPUs to use based on the number of threads and subjobs the user entered

Return type

int

Returns

total number of CPUs

isCPUHost()
isGPUHost()
onProcUnitComboIndexChanged(use_host=None)

Update the available hosts based on the current processor unit type. Will also hide/show widgets based on whether GPU is selected but no GPU hosts are available or not.

Parameters

use_host (str) – Host to be set in the host combo

onWriteRequested()

Slot for Write button.

savePressed()

Slot for Save button

setUpButtonBox(can_start=True)

Set up the dialog’s button box and add ‘Write’ button.

setupHostCombo(combo, use_host=None, hosts=None)
setupHostLayout()

Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).

Returns

Whether the dialog should add a start button.

Return type

bool

showHelp()
startPressed()

Slot for OK and Run button

updateCPULimits()

This method is called whenever host selection is changed. It updates maximum number of allowed CPUs.

updateOpenMPInfo()

Show/Hide the proper frames and update the processors label

updateOpenMPLabel()

Update the Open MP label with the current number of processors requested

updateQueueResources()

This updates the queue resources display when the host has changed.

validate()

Checks the panel to make sure settings are valid. Return False if any validation test fails, otherwise return True.

validateAndAccept()

Validate the settings, and if no errors are found, close the dialog.

validateNumCpus(host, editfield, silent=False)

Validate number of CPUs :type host: Host :param host: the host on which the CPUs reside :type editfield: QWidget :param editfield: widget specifying the number of CPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumGpus(host, editfield, silent=False)

Validate number of GPUs :type host: Host :param host: the host on which the GPUs reside :type editfield: QWidget :param editfield: widget specifying the number of GPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumOpenMP(host, silent=False)

Checks to make sure the number of requested processors and threads is consistent with what we know of the host capabilities.

Parameters
  • host (Host) – The host on which the CPUs reside

  • silent (bool) – suppresses warning dialogs when set to True

Return type

bool

Returns

True if number of processors & threads is allowed, False if not

validateNumProcs(silent=False)

See ConfigDialog.validateNumProcs docstring.

warning(text)

Display a warning window with the specified text.

writePressed()

Slot for Write button

class schrodinger.application.matsci.configdlgs.PerStructDesmondSubhostConfigDialog(*arg, gpu_num=None, cpu_num=None, sim_jobnum=None, sim_job_sb=None, has_subjobs_func=None, **kwargs)

Bases: schrodinger.application.desmond.fep_dialog.FEPConfigDialog

Subclass fep_dialog.FEPConfigDialog dialog, and customize it for panels that run multiple desmond subjobs.

MAX_SUBJOBS_LABEL_TEXT = 'Maximum simultaneous subjobs:'
__init__(*arg, gpu_num=None, cpu_num=None, sim_jobnum=None, sim_job_sb=None, has_subjobs_func=None, **kwargs)

See parent class for additional documentation string.

Parameters
  • gpu_num (int) – Fix the gpu processor number per subjob, if provided.

  • cpu_num (int) – Fix the cpu processor number per subjob, if provided.

  • sim_jobnum (int) – The default simultaneous subjob number.

  • sim_job_sb (str) – the attribute name of the parent to define the number of simultaneous subjob.

  • has_subjobs_func – Function that takes no arguments and returns a boolean indicating whether subjobs will be run. If not supplied, validation will always assume subjobs are run.

Type

callable

updateMaxjobsDefault()

Overwrite the parent class method to set the upper limit of max simultaneous subjobs.

validateSubHost()

Overwritten the parent method.

validate()

Overwritten the parent method to allow cpu hosts for master jobs.

CANCEL = 'Cancel'
CPU_UNIT_LABEL = 'processors'
GPU_UNIT_LABEL = 'GPUs'
HELP = 'Help'
HOST_LABEL_TEXT = 'CPU Host:'
PRODUCT_HOSTS_KEY = 'product_hosts'
SAVE = 'OK'
START = 'Run'
WRITE = 'Write'
activate()

Display the dialog and return the dialog parameters as as StartDialogParam object. If the dialog was cancelled then return None and restore the prior state.

addNumericLineEdit(layout, value=1, prelabel=None, postlabel=None)

Creates a standard line edit used for input, adds it to the provided layout, and then returns the line edit so that it can be stored and its value accessed later.

Parameters

value (int) – the initial value for the line edit

If prelabel or postlabel are strings, QLabels with the textual value will be created.

addSubprocessStackedWidget(layout, prelabel, postlabel)

Add a stacked widget to the given layout with one widget being a lineedit with labels, and the other a combo box with labels.

Parameters
  • layout (QtWidgets.QLayout) – layout to which the stacked widget should be added.

  • prelabel (str or QLabel) – text preceding the widgets added to the stacked widget.

  • postlabel (str or QLabel) – text following the widgets added to the stacked widget.

Returns

the stacked widget containing the lineedit and combobox

Return type

QtWidgets.QStackedWidget

applySettings(settings)

See parent class docstring

buildComboBox()

Build a QComboBox with specific included options.

buildLabel(layout, label)

Build a new QLabel if label is a str, and add the widget to the given layout.

Parameters
  • layout (QtWidgets.QLayout) – layout to which the stacked widget should be added.

  • label (string or QLabel) – the text or widget to add to layout.

buildLineEdit(value=1)

Build a QLineEdit with specific width and validator.

cpus3Edited(ignored=None)
currentHost(menu=None)

See ConfigDialog.currentHost() docstring.

error(text)

Show an error message with the specified text.

Parameters

msg (str) – Error to show.

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

getHostType()
getHosts(ncpus=True, excludeGPGPUs=True)

Returns list of host entries from appropriate schrodinger.hosts file, with parenthetical entry of the number of available processors (if ‘ncpus’ is True). If excludeGPGPUs is True, hosts with GPGPUs will be excluded from the list

getNumCpusToValidate(is_queue)

Return the maximum number of processors that the job could potentially use, for validation.

Parameters

is_queue (bool) – If True, return number of threads per subjob requested, if False return number of threads * number of subjobs.

getOpenMPSettings()
Based on Open MP settings, return a tuple of:
  • Maximum number of CPUs to use

  • Number of threads to use.

  • Maximum number of subjobs to create.

Returns

(#cpus, #threads, #subjobs)

Return type

(int, int, int)

getSettings(extra_kws=None)
getTotalOpenMPCPUs()

Compute the total number of Open MP CPUs to use based on the number of threads and subjobs the user entered

Return type

int

Returns

total number of CPUs

isCPUHost()
isGPUHost()
onHostMenuChanged(index)
savePressed()

Slot for Save button

setUpButtonBox(can_start=True)

Set up the button box items for the dialog.

Parameters

can_start – If True, add a Start button. Otherwise add a Write button.

setupFFBuilderOptions()

Set up options for ffbuilder portion of the config dialog. Hidden if we are not enabling ffbuilder.

setupHostCombo(combo, use_host=None, hosts=None)
setupHostLayout()

Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).

Returns

Whether the dialog should add a start button.

Return type

bool

setupSubHostCombo(combo)

Add only GPU Hosts to the combo box input. The combo box menu will be cleared first.

Parameters

combo (QtWidgets.QComboBox) – combo box to append to.

setupSubHostLayout()
showHelp()
startPressed()

Slot for OK and Run button

updateCPULimits()

This method is called whenever host selection is changed. It updates maximum number of allowed CPUs as well as GPUs.

updateNumCPUsLabel()

We update the label here, if present.

updateOpenMPInfo()

Show/Hide the proper frames and update the processors label

updateOpenMPLabel()

Update the Open MP label with the current number of processors requested

updateQueueResources()

This updates the queue resources display when the host has changed.

validateAndAccept()

Validate the settings, and if no errors are found, close the dialog.

validateNumCpus(host, editfield, silent=False)

Validate number of CPUs :type host: Host :param host: the host on which the CPUs reside :type editfield: QWidget :param editfield: widget specifying the number of CPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumGpus(host, editfield, silent=False)

Validate number of GPUs :type host: Host :param host: the host on which the GPUs reside :type editfield: QWidget :param editfield: widget specifying the number of GPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumOpenMP(host, silent=False)

Checks to make sure the number of requested processors and threads is consistent with what we know of the host capabilities.

Parameters
  • host (Host) – The host on which the CPUs reside

  • silent (bool) – suppresses warning dialogs when set to True

Return type

bool

Returns

True if number of processors & threads is allowed, False if not

validateNumProcs(silent=False)

Checks that the number of processors requested is reasonable. Here the validation is conditional on the ‘cpus’ option. In derived classes this may not be valid (i.e. the validation should be run regardless of the ncpus options.

Parameters
  • menu (QComboBox) – The menu specifying the host selection to be validated

  • numfield (QLineEdit) – The widget specifying the requested # of processors

  • silent (bool) – suppresses warning dialogs when set to True

validatePlatform()

Verify that the current platform is acceptible for the requested action.

Returns

True if the platform is valid, False otherwise

Return type

bool

validateSubjobs()

Validates subjob fields are populated with values that can be cast into an int

warning(text)

Display a warning window with the specified text.

writePressed()

Slot for Write button

class schrodinger.application.matsci.configdlgs.ConfigDialogWithPlatformValidation(*args, incompatible_platforms=(), platform_warning='', **kwargs)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

Adds a platform check to ConfigDialog for localhost jobs.

__init__(*args, incompatible_platforms=(), platform_warning='', **kwargs)
Parameters
  • incompatible_platforms (tuple) – Incompatible platforms for the job.

  • platform_warning (str) – The warning to be displayed if the platform is incompatible.

validateHost(host)

Validates whether or not a launch host is valid for the job. Currently only validates localhost.

Parameters

host (schrodinger.job.jobcontrol.Host object) – Launch host to validate

Return type

bool

Returns

True if the selected host is valid for the job, False otherwise.

validate()

Checks the panel to make sure settings are valid. Return False if any validation test fails, otherwise return True.

Return type

bool

Returns

True if all checks pass, False otherwise

CANCEL = 'Cancel'
CPU_UNIT_LABEL = 'processors'
GPU_UNIT_LABEL = 'GPUs'
HELP = 'Help'
HOST_LABEL_TEXT = 'Host:'
PRODUCT_HOSTS_KEY = 'product_hosts'
SAVE = 'OK'
START = 'Run'
WRITE = 'Write'
activate()

Display the dialog and return the dialog parameters as as StartDialogParam object. If the dialog was cancelled then return None and restore the prior state.

applySettings(settings)

Set dialog state using previously-saved parameters

Parameters

settings (StartDialogParams) – saved dialog settings

cpus3Edited(ignored=None)
currentHost(menu=None)

Returns the host currently selected in the menu parameter. If none is given, use self.host_menu. currentHost() can be overridden to use a different menu by default.

Parameters

menu (QtWidgets.QComboBox) – Menu to check for current host

error(text)

Show an error message with the specified text.

Parameters

msg (str) – Error to show.

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

getHostType()
getHosts(ncpus=True, excludeGPGPUs=True)

Returns list of host entries from appropriate schrodinger.hosts file, with parenthetical entry of the number of available processors (if ‘ncpus’ is True). If excludeGPGPUs is True, hosts with GPGPUs will be excluded from the list

getNumCpusToValidate(is_queue)

Return the maximum number of processors that the job could potentially use, for validation.

Parameters

is_queue (bool) – If True, return number of threads per subjob requested, if False return number of threads * number of subjobs.

getOpenMPSettings()
Based on Open MP settings, return a tuple of:
  • Maximum number of CPUs to use

  • Number of threads to use.

  • Maximum number of subjobs to create.

Returns

(#cpus, #threads, #subjobs)

Return type

(int, int, int)

getSettings(extra_kws=None)
getTotalOpenMPCPUs()

Compute the total number of Open MP CPUs to use based on the number of threads and subjobs the user entered

Return type

int

Returns

total number of CPUs

isCPUHost()
isGPUHost()
savePressed()

Slot for Save button

setUpButtonBox(can_start=True)

Set up the button box items for the dialog.

Parameters

can_start – If True, add a Start button. Otherwise add a Write button.

setupHostCombo(combo, use_host=None, hosts=None)
setupHostLayout()

Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).

Returns

Whether the dialog should add a start button.

Return type

bool

showHelp()
startPressed()

Slot for OK and Run button

updateCPULimits()

This method is called whenever host selection is changed. It updates maximum number of allowed CPUs.

updateOpenMPInfo()

Show/Hide the proper frames and update the processors label

updateOpenMPLabel()

Update the Open MP label with the current number of processors requested

updateQueueResources()

This updates the queue resources display when the host has changed.

validateAndAccept()

Validate the settings, and if no errors are found, close the dialog.

validateNumCpus(host, editfield, silent=False)

Validate number of CPUs :type host: Host :param host: the host on which the CPUs reside :type editfield: QWidget :param editfield: widget specifying the number of CPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumGpus(host, editfield, silent=False)

Validate number of GPUs :type host: Host :param host: the host on which the GPUs reside :type editfield: QWidget :param editfield: widget specifying the number of GPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumOpenMP(host, silent=False)

Checks to make sure the number of requested processors and threads is consistent with what we know of the host capabilities.

Parameters
  • host (Host) – The host on which the CPUs reside

  • silent (bool) – suppresses warning dialogs when set to True

Return type

bool

Returns

True if number of processors & threads is allowed, False if not

validateNumProcs(silent=False)

Checks that the number of processors requested is reasonable. Here the validation is conditional on the ‘cpus’ option. In derived classes this may not be valid (i.e. the validation should be run regardless of the ncpus options.

Parameters
  • menu (QComboBox) – The menu specifying the host selection to be validated

  • numfield (QLineEdit) – The widget specifying the requested # of processors

  • silent (bool) – suppresses warning dialogs when set to True

warning(text)

Display a warning window with the specified text.

writePressed()

Slot for Write button

class schrodinger.application.matsci.configdlgs.ThreadOnlyConfigDialog(parent, title='', jobname='', checkcommand=None, help_topic='MM_TOPIC_JOB_START_DIALOG', **kw)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

Manage a config dialog that only exposes the number of threads and locks the number of simultaneous subjobs at one.

CANCEL = 'Cancel'
CPU_UNIT_LABEL = 'processors'
GPU_UNIT_LABEL = 'GPUs'
HELP = 'Help'
HOST_LABEL_TEXT = 'Host:'
PRODUCT_HOSTS_KEY = 'product_hosts'
SAVE = 'OK'
START = 'Run'
WRITE = 'Write'
__init__(parent, title='', jobname='', checkcommand=None, help_topic='MM_TOPIC_JOB_START_DIALOG', **kw)

See class docstring. Raises an Exception if the disposition specified as the default is not recognized.

If pre_close_command is specified, it will be run when the user presses the Start button. The dialog is only closed if that function returns 0.

activate()

Display the dialog and return the dialog parameters as as StartDialogParam object. If the dialog was cancelled then return None and restore the prior state.

applySettings(settings)

Set dialog state using previously-saved parameters

Parameters

settings (StartDialogParams) – saved dialog settings

cpus3Edited(ignored=None)
currentHost(menu=None)

Returns the host currently selected in the menu parameter. If none is given, use self.host_menu. currentHost() can be overridden to use a different menu by default.

Parameters

menu (QtWidgets.QComboBox) – Menu to check for current host

error(text)

Show an error message with the specified text.

Parameters

msg (str) – Error to show.

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

getHostType()
getHosts(ncpus=True, excludeGPGPUs=True)

Returns list of host entries from appropriate schrodinger.hosts file, with parenthetical entry of the number of available processors (if ‘ncpus’ is True). If excludeGPGPUs is True, hosts with GPGPUs will be excluded from the list

getNumCpusToValidate(is_queue)

Return the maximum number of processors that the job could potentially use, for validation.

Parameters

is_queue (bool) – If True, return number of threads per subjob requested, if False return number of threads * number of subjobs.

getOpenMPSettings()
Based on Open MP settings, return a tuple of:
  • Maximum number of CPUs to use

  • Number of threads to use.

  • Maximum number of subjobs to create.

Returns

(#cpus, #threads, #subjobs)

Return type

(int, int, int)

getSettings(extra_kws=None)
getTotalOpenMPCPUs()

Compute the total number of Open MP CPUs to use based on the number of threads and subjobs the user entered

Return type

int

Returns

total number of CPUs

isCPUHost()
isGPUHost()
savePressed()

Slot for Save button

setUpButtonBox(can_start=True)

Set up the button box items for the dialog.

Parameters

can_start – If True, add a Start button. Otherwise add a Write button.

setupHostCombo(combo, use_host=None, hosts=None)
setupHostLayout()

Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).

Returns

Whether the dialog should add a start button.

Return type

bool

showHelp()
startPressed()

Slot for OK and Run button

updateCPULimits()

This method is called whenever host selection is changed. It updates maximum number of allowed CPUs.

updateOpenMPInfo()

Show/Hide the proper frames and update the processors label

updateOpenMPLabel()

Update the Open MP label with the current number of processors requested

updateQueueResources()

This updates the queue resources display when the host has changed.

validate()

Checks the panel to make sure settings are valid. Return False if any validation test fails, otherwise return True.

validateAndAccept()

Validate the settings, and if no errors are found, close the dialog.

validateNumCpus(host, editfield, silent=False)

Validate number of CPUs :type host: Host :param host: the host on which the CPUs reside :type editfield: QWidget :param editfield: widget specifying the number of CPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumGpus(host, editfield, silent=False)

Validate number of GPUs :type host: Host :param host: the host on which the GPUs reside :type editfield: QWidget :param editfield: widget specifying the number of GPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumOpenMP(host, silent=False)

Checks to make sure the number of requested processors and threads is consistent with what we know of the host capabilities.

Parameters
  • host (Host) – The host on which the CPUs reside

  • silent (bool) – suppresses warning dialogs when set to True

Return type

bool

Returns

True if number of processors & threads is allowed, False if not

validateNumProcs(silent=False)

Checks that the number of processors requested is reasonable. Here the validation is conditional on the ‘cpus’ option. In derived classes this may not be valid (i.e. the validation should be run regardless of the ncpus options.

Parameters
  • menu (QComboBox) – The menu specifying the host selection to be validated

  • numfield (QLineEdit) – The widget specifying the requested # of processors

  • silent (bool) – suppresses warning dialogs when set to True

warning(text)

Display a warning window with the specified text.

writePressed()

Slot for Write button

class schrodinger.application.matsci.configdlgs.DesmondSubhostConfigDialog(*args, multiple_gpus=False, **kwargs)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

Custom job config dialog that launches using Launch API and supports subhost.

DRIVER_HOST = 'Driver/GPU host'
GPU_SUBHOST = 'GPU subhost'
__init__(*args, multiple_gpus=False, **kwargs)

Initialize the dialog. Set host products.

Parameters

multiple_gpus (bool) – Whether to allow multiple GPUs

setLaunchParams(job_spec, launch_params)

Set launch parameters from config dialog settings. See parent for docs.

useSubhost()

Check if subhost is needed.

Return type

bool

Returns

Whether subhost is needed. In this particular case, if driver host is GPU, subhost is not needed.

getLicHost()

Get license host.

Return type

str or None

Returns

If driver host is GPU, all the jobs will run there, need to request license for it. Otherwise return None

getNumGPUS()

Get number of GPUs. Only makes sense when multiple GPUs is allowed.

Return type

None or int

Returns

Number of GPUs requested, None if multiple GPUs hasn’t been requested

CANCEL = 'Cancel'
CPU_UNIT_LABEL = 'processors'
GPU_UNIT_LABEL = 'GPUs'
HELP = 'Help'
HOST_LABEL_TEXT = 'Host:'
PRODUCT_HOSTS_KEY = 'product_hosts'
SAVE = 'OK'
START = 'Run'
WRITE = 'Write'
activate()

Display the dialog and return the dialog parameters as as StartDialogParam object. If the dialog was cancelled then return None and restore the prior state.

applySettings(settings)

Set dialog state using previously-saved parameters

Parameters

settings (StartDialogParams) – saved dialog settings

cpus3Edited(ignored=None)
currentHost(menu=None)

Returns the host currently selected in the menu parameter. If none is given, use self.host_menu. currentHost() can be overridden to use a different menu by default.

Parameters

menu (QtWidgets.QComboBox) – Menu to check for current host

error(text)

Show an error message with the specified text.

Parameters

msg (str) – Error to show.

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

getHostType()
getHosts(ncpus=True, excludeGPGPUs=True)

Returns list of host entries from appropriate schrodinger.hosts file, with parenthetical entry of the number of available processors (if ‘ncpus’ is True). If excludeGPGPUs is True, hosts with GPGPUs will be excluded from the list

getNumCpusToValidate(is_queue)

Return the maximum number of processors that the job could potentially use, for validation.

Parameters

is_queue (bool) – If True, return number of threads per subjob requested, if False return number of threads * number of subjobs.

getOpenMPSettings()
Based on Open MP settings, return a tuple of:
  • Maximum number of CPUs to use

  • Number of threads to use.

  • Maximum number of subjobs to create.

Returns

(#cpus, #threads, #subjobs)

Return type

(int, int, int)

getSettings(extra_kws=None)
getTotalOpenMPCPUs()

Compute the total number of Open MP CPUs to use based on the number of threads and subjobs the user entered

Return type

int

Returns

total number of CPUs

isCPUHost()
isGPUHost()
savePressed()

Slot for Save button

setUpButtonBox(can_start=True)

Set up the button box items for the dialog.

Parameters

can_start – If True, add a Start button. Otherwise add a Write button.

setupHostCombo(combo, use_host=None, hosts=None)
setupHostLayout()

Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).

Returns

Whether the dialog should add a start button.

Return type

bool

showHelp()
startPressed()

Slot for OK and Run button

updateCPULimits()

This method is called whenever host selection is changed. It updates maximum number of allowed CPUs.

updateOpenMPInfo()

Show/Hide the proper frames and update the processors label

updateOpenMPLabel()

Update the Open MP label with the current number of processors requested

updateQueueResources()

This updates the queue resources display when the host has changed.

validate()

Checks the panel to make sure settings are valid. Return False if any validation test fails, otherwise return True.

validateAndAccept()

Validate the settings, and if no errors are found, close the dialog.

validateNumCpus(host, editfield, silent=False)

Validate number of CPUs :type host: Host :param host: the host on which the CPUs reside :type editfield: QWidget :param editfield: widget specifying the number of CPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumGpus(host, editfield, silent=False)

Validate number of GPUs :type host: Host :param host: the host on which the GPUs reside :type editfield: QWidget :param editfield: widget specifying the number of GPUs :type silent: bool :param silent: suppresses warning dialogs when set to True

validateNumOpenMP(host, silent=False)

Checks to make sure the number of requested processors and threads is consistent with what we know of the host capabilities.

Parameters
  • host (Host) – The host on which the CPUs reside

  • silent (bool) – suppresses warning dialogs when set to True

Return type

bool

Returns

True if number of processors & threads is allowed, False if not

validateNumProcs(silent=False)

Checks that the number of processors requested is reasonable. Here the validation is conditional on the ‘cpus’ option. In derived classes this may not be valid (i.e. the validation should be run regardless of the ncpus options.

Parameters
  • menu (QComboBox) – The menu specifying the host selection to be validated

  • numfield (QLineEdit) – The widget specifying the requested # of processors

  • silent (bool) – suppresses warning dialogs when set to True

warning(text)

Display a warning window with the specified text.

writePressed()

Slot for Write button