Package schrodinger :: Package ui :: Package qt :: Module appframework :: Class ConfigDialog
[hide private]
[frames] | no frames]

Class ConfigDialog

Known Subclasses:


Toplevel Qt widget that mimics the Maestro Start dialog.
Configuration options set via constructor keywords are...

    title -         Title for the dialog window.  Default is
                    '<parent_title> - Start'.

    command -       Function to call (not used?).

    jobname -       Initial string value for the job name entry field.
                    Default is ''.

    incorporation - Display a disposition selector for Maestro
                    incorporation.  Maestro only.  Default is True.

    default_disp -  The default disposition, if 'incorporation' is True.
                    Must be DISP_APPEND or DISP_IGNORE.
                    Default is DISP_IGNORE.

    disp_flags -    Additional Maestro job disposition flags.
                    Currently, the only available flag is DISP_FLAG_FIT.
                    The flags should be separated using DISP_FLAG_SEPARATOR.
                    Default value is empty string (no flags).

    host -          Display a pull-down menu (or a table) for selecting
                    the host for the job. Default is True.

    multihost -     Whether to display a host table that supports multiple
                    hosts. By default, a pull-down menu is displayed.

    host_products   Products that will get their own host menu and #cpus
                    box. Not compatible with multihost or cpus3.
                    Takes a list of strings. Default is one host menu.

    localdriver -   Display a checkbutton for running driver job on the
                    localhost (Default is remote driver)

    remotedriver -  Display a checkbutton for running driver job on the
                    localhost (Default is local driver)

    jobentry -      Display widgets for setting the job name.
                    Default is True.

    cpus -          Display additional options for distributed jobs,
                    including the number of CPUs.  Default is False.
                    NOTE: This option is not available with multihost.

    cpus3 -         Display additional options for Desmond distributed jobs
                    which includes 3 CPUS values: X, Y, and Z.
                    Default is False.
                    NOTE: This option is not available with multihost.

    njobs -         Display widgets for running the job as a specified
                    number of subjobs.  Default is False.

    adjust -        Whether to display the "Adjust" checkbox. Default is
                    False. Requires <njobs> to be True.

    tmpdir -        Show the tmpdir for the currently selected host.
                    Default is False.

    save_host -     Used the last saved host as the default host.  Save any
                    new host chosen for the next start dialog from this
                    panel.

    open_mp -       True/False. Allow the user to specify either the total
                    number of cpus or the number of Open MP threads and
                    subjobs. Default is False. open_mp is mutually exclusive
                    with cpus as well as cpus3. open_mp is incompatible with
                    host_products.

    set_resources - True/False. Allow the user to set or select queue
                    resources from the Python start panel

    NOTE: localdriver and remotedriver options are mutually exclusive and
          if either feature is requested, commandLineOptions() method will
          append -LOCALDRIVER or -REMOTEDRIVER to the command list,
          depending on whether the checkbutton is checked or not.


Job parameters passed out in the StartDialogParams object upon
the dialog deactivating with via a "Start" (not "Cancel") action...

    proj -    The Project from which the job is launched (required for
              incorporation).  "" if not in Maestro.

    disp -    Maestro disposition.  'append' or 'ignore' if
              'incorporation' is True.  "" if not in Maestro.  Undefined
              if in Maestro but 'incorporation' is False.

    jobname - Job name.  Undefined if 'jobentry' is False.

    host -    Main host.  Undefined if 'host' option is False.
              NOTE: Hosts string (with ncpus) if multihost is set.

    localdriver - Wheather to run driver on localhost. Undefined if
                    'localdriver' & 'remotedriver' options are False

    njobs -   Number of subjobs.  Undefined if 'njobs' option is False.

    adjust -  Whether the user checked the "Adjust" checkbox.

    cpus -    Number of CPUs.  Undefined if 'cpus' option is False.  Set
              to 'njobs' if the "Distribute subjobs over maximum..." is
              chosen, otherwise set to the number of specified CPUs.
              NOTE: not available with multihost setting.

    cpus3 -   Number of CPUs as 3 numbers: X, Y, & Z. Used by the Desmond
              panels. Undefined if 'cpus3' option is False.

    openmpcpus - Number of total Open MP CPUs if the open_mp option was
              used. If the open_mp options was used and threads is 0, then
              openmpcpus is just the number of CPUs. None if the open_mp
              option was not used.

    threads - Number of threads if the open_mp option was used and the user
              chose to specify the number of Open MP threads and subjobs. If
              the open_mp option was used but the user only specifies CPUS,
              threads is 0. None if the open_mp option was not used.

    openmpsubjobs - Maximum number of subjobs that may be run
              simultaneously, if the open_mp option was used.

    queue_resources - Queue resource options


Please see the DialogParameters class below for usage instructions.

Instance Methods [hide private]
 
__init__(self, parent, title='', jobname='', checkcommand=None, help_product='maestro', help_topic='MM_TOPIC_JOB_START_DIALOG', **kw)
See class docstring.
 
showHelp(self)
 
validateNumProcs(self, silent=False)
Checks that the number of processors requested is reasonable.
 
_validateNumProcs(self, name, requested, available, units, silent=False)
Validate that the number of resources is reasonable.
 
validateNumCpus(self, host, editfield, silent=False)
Validate number of CPUs
 
validateNumGpus(self, host, editfield, silent=False)
Validate number of GPUs
bool
validateNumOpenMP(self, host, silent=False)
Checks to make sure the number of requested processors and threads is consistent with what we know of the host capabilities.
 
validate(self)
Checks the panel to make sure settings are valid.
 
validateAndAccept(self)
Validate the settings, and if no errors are found, close the dialog.
 
savePressed(self)
Slot for Save button
 
startPressed(self)
Slot for OK and Run button
 
setupHostLayout(self)
Setup the host layout, including hostlist/table and numbers of cpus (including cpus3).
 
_setupQueueWidgets(self)
Set up all the Queue jobcontrol setting widgets
 
_setupOpenMPWidgets(self)
Add all the widgets to the dialog to allow the user the option of specifying the number of Open MP threads and subjobs.
 
updateOpenMPInfo(self)
Show/Hide the proper frames and update the processors label
int
getTotalOpenMPCPUs(self)
Compute the total number of Open MP CPUs to use based on the number of threads and subjobs the user entered
 
_queueMemoryFixup(self, val)
This makes sure memory is not over the maximum allowed, and that an empty space was not entered.
 
_queueWalltimeFixup(self, val)
This verifies that an empty space wasn't entered
 
updateQueueResources(self)
This updates the queue resources display when the host has changed.
 
_updateQArgs(self)
This updates the QArgs line when any relevant option has changed.
 
updateOpenMPLabel(self)
Update the Open MP label with the current number of processors requested
 
setupHostCombo(self, combo, use_host=None)
 
cpus3Edited(self, ignored=None)
 
activate(self)
Display the dialog and return the dialog parameters as as StartDialogParam object.
 
getSettings(self, extra_kws=None)
 
_applySetting(self, setter, settings, prop)
Applies a specific setting via a call to the setter.
 
_selectComboText(self, combo, text)
Select the item in a combobox matching the specified text.
 
applySettings(self, settings)
Set dialog state using previously-saved parameters
 
warning(self, text)
Display a warning window with the specified text.
 
getHosts(self, 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).
 
currentHost(self, menu=None)
Returns the host currently selected in the menu parameter.
 
_stripProcs(self, host_entry)
Returns host name minus the parenthetical available processors entry
Class Methods [hide private]
 
_getRemoteGPGPUs(cls, host)
Return a list of GPGPUs belonging to the specified host.
 
_getLocalGPGPUs(cls)
Detect local GPUs via mmgpu
 
getGPGPUs(cls, hostname)
Given a host, return a list of GPUs
Class Variables [hide private]
  CPU_UNIT_LABEL = 'processors'
  GPU_UNIT_LABEL = 'GPUs'
  CANCEL = 'Cancel'
  HELP = 'Help'
  SAVE = 'OK'
  START = 'Run'
Method Details [hide private]

__init__(self, parent, title='', jobname='', checkcommand=None, help_product='maestro', help_topic='MM_TOPIC_JOB_START_DIALOG', **kw)
(Constructor)

 

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.

validateNumProcs(self, 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

_validateNumProcs(self, name, requested, available, units, silent=False)

 

Validate that the number of resources is reasonable.

Parameters:
  • name (str) - name of host
  • requested (int) - number of processors requested for use
  • available (int) - number of processors available on name
  • units (str) - unit string for requested and abailable
  • silent (bool) - suppresses warning dialogs when set to True

validateNumCpus(self, host, editfield, silent=False)

 

Validate number of CPUs

Parameters:
  • host (Host) - the host on which the CPUs reside
  • editfield (QWidget) - widget specifying the number of CPUs
  • silent (bool) - suppresses warning dialogs when set to True

validateNumGpus(self, host, editfield, silent=False)

 

Validate number of GPUs

Parameters:
  • host (Host) - the host on which the GPUs reside
  • editfield (QWidget) - widget specifying the number of GPUs
  • silent (bool) - suppresses warning dialogs when set to True

validateNumOpenMP(self, 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
Returns: bool
True if number of processors & threads is allowed, False if not

validate(self)

 

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

getTotalOpenMPCPUs(self)

 

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

Returns: int
total number of CPUs

activate(self)

 

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.

_applySetting(self, setter, settings, prop)

 

Applies a specific setting via a call to the setter.

Parameters:
  • setter (callable) - a method taking a single argument to set the field
  • settings (StartDialogParams) - saved dialog settings
  • prop (str) - a dictionary key to access the desired item in settings

_selectComboText(self, combo, text)

 

Select the item in a combobox matching the specified text. If text is not found, the selection is left unchanged.

Parameters:
  • combo (QComboBox) - a combo box to search and set
  • text (str) - text to search for within the items of combo

applySettings(self, settings)

 

Set dialog state using previously-saved parameters

Parameters:
  • settings (StartDialogParams) - saved dialog settings

getHosts(self, 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

currentHost(self, menu=None)

 

Returns the host currently selected in the menu parameter. If none is given, use self.host_menu. Validates that the menu item matches the corresponding self.hosts member variable. currentHost() can be overridden to use a different menu by default.

_stripProcs(self, host_entry)

 

Returns host name minus the parenthetical available processors entry

Deprecated: use appframework.Host rather than parse host strings

_getRemoteGPGPUs(cls, host)
Class Method

 

Return a list of GPGPUs belonging to the specified host.

Parameters:
  • host (str) - name of host matching a name from the host file

Deprecated: both local and remote GPUs accessed through getGPGPUs()

_getLocalGPGPUs(cls)
Class Method

 

Detect local GPUs via mmgpu

Deprecated: both local and remote GPUs accessed through getGPGPUs()