schrodinger.ui.qt.config_dialog module

This module provides classes for config dialogs (for use with AppFramework). These are dialogs that allow the user to specify parameters for launching a job (jobname, host, #cpus, etc).

class schrodinger.ui.qt.config_dialog.RequestedAction(value)

Bases: enum.Enum

An enumeration.

DoNothing = 1
Run = 2
Write = 3
class schrodinger.ui.qt.config_dialog.GpuHostProductMode(value)

Bases: enum.Enum

An enumeration.

NoGpus = 1
Single = 2
Multiple = 3
SingleOnlyGpu = 4
MultipleOnlyGpu = 5
schrodinger.ui.qt.config_dialog.get_num_nprocs(cd_params)

Get the number of processes requested by the user

Parameters

cd_params (schrodinger.ui.qt.appframework.StartDialogParams) – The current Config Dialog settings

Return type

int or None

Returns

The number of CPUs requested by the user if they are using the CPUs option, or the number of simultaneous subjobs if they are using the MP subjobs option. Or None if neither of these are specified.

schrodinger.ui.qt.config_dialog.strip_gpu_from_localhost(hostname)

Check host strings to see if ‘localhost-gpu’ was specified and, if so, replace with ‘localhost’

Parameters

hostname (str) – Host name to be checked

Returns

The actual hostname value to be used in a job command.

Return type

str

class schrodinger.ui.qt.config_dialog.HostProduct(host_menu, cpus_sb, cpus_units_label, gpus_mode, num_processor_widget)

Bases: object

A collection of widgets (e.g. host menu, processor spinbox, labels) for a host product and functionality to update the widgets as needed.

__init__(host_menu, cpus_sb, cpus_units_label, gpus_mode, num_processor_widget)
Parameters
  • host_menu (QtWidgets.QComboBox) – Host menu for this host product

  • cpus_sb (NumProcsSpinBox or None) – CPU entry field for this host product

  • cpus_units_label (QtWidgets.QLabel or None) – Processors units label for this host product

  • gpus_mode (int) – GPU mode for this host product. Should be one of GpuHostProductMode.NoGpus, GpuHostProductMode.Single, GpuHostProductMode.Multiple, GpuHostProductMode.SingleOnlyGpu or GpuHostProductMode.MultipleOnlyGpu

  • num_processor_widget (QtWidgets.QWidget or None) – Widget containing number of processor selection components

class schrodinger.ui.qt.config_dialog.NumProcsSpinBox(parent=None, min=1, max=10000, default=1)

Bases: PyQt5.QtWidgets.QSpinBox

Spin box specifically for setting number of processors.

__init__(parent=None, min=1, max=10000, default=1)
Parameters
  • parent (QtWidgets.QWidget) – Parent widget

  • min (int) – Min value for this spinbox

  • max (int) – Max value for this spinbox

  • default (int) – Default value for this spinbox

AdaptiveDecimalStepType = 1
class ButtonSymbols

Bases: int

CorrectToNearestValue = 1
CorrectToPreviousValue = 0
class CorrectionMode

Bases: int

DefaultStepType = 0
DrawChildren = 2
DrawWindowBackground = 1
IgnoreMask = 4
NoButtons = 2
class PaintDeviceMetric

Bases: int

PdmDepth = 6
PdmDevicePixelRatio = 11
PdmDevicePixelRatioScaled = 12
PdmDpiX = 7
PdmDpiY = 8
PdmHeight = 2
PdmHeightMM = 4
PdmNumColors = 5
PdmPhysicalDpiX = 9
PdmPhysicalDpiY = 10
PdmWidth = 1
PdmWidthMM = 3
PlusMinus = 1
class RenderFlag

Bases: int

class RenderFlags

Bases: sip.simplewrapper

QWidget.RenderFlags(Union[QWidget.RenderFlags, QWidget.RenderFlag]) QWidget.RenderFlags(QWidget.RenderFlags)

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

StepDownEnabled = 2
class StepEnabled

Bases: sip.simplewrapper

QAbstractSpinBox.StepEnabled(Union[QAbstractSpinBox.StepEnabled, QAbstractSpinBox.StepEnabledFlag]) QAbstractSpinBox.StepEnabled(QAbstractSpinBox.StepEnabled)

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

class StepEnabledFlag

Bases: int

StepNone = 0
class StepType

Bases: int

StepUpEnabled = 1
UpDownArrows = 0
acceptDrops(self) → bool
accessibleDescription(self) → str
accessibleName(self) → str
actionEvent(self, QActionEvent)
actions(self) → List[QAction]
activateWindow(self)
addAction(self, QAction)
addActions(self, Iterable[QAction])
adjustSize(self)
alignment(self) → Qt.Alignment
autoFillBackground(self) → bool
backgroundRole(self) → QPalette.ColorRole
baseSize(self) → QSize
blockSignals(self, bool) → bool
buttonSymbols(self) → QAbstractSpinBox.ButtonSymbols
changeEvent(self, QEvent)
childAt(self, QPoint) → QWidget

childAt(self, int, int) -> QWidget

childEvent(self, QChildEvent)
children(self) → List[QObject]
childrenRect(self) → QRect
childrenRegion(self) → QRegion
cleanText(self) → str
clear(self)
clearFocus(self)
clearMask(self)
close(self) → bool
closeEvent(self, QCloseEvent)
colorCount(self) → int
connectNotify(self, QMetaMethod)
contentsMargins(self) → QMargins
contentsRect(self) → QRect
contextMenuEvent(self, QContextMenuEvent)
contextMenuPolicy(self) → Qt.ContextMenuPolicy
correctionMode(self) → QAbstractSpinBox.CorrectionMode
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
createWindowContainer(QWindow, parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = 0) → QWidget
cursor(self) → QCursor
customContextMenuRequested

customContextMenuRequested(self, QPoint) [signal]

customEvent(self, QEvent)
deleteLater(self)
depth(self) → int
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
destroyed

destroyed(self, object: QObject = None) [signal]

devType(self) → int
devicePixelRatio(self) → int
devicePixelRatioF(self) → float
devicePixelRatioFScale() → float
disconnect(self)
disconnectNotify(self, QMetaMethod)
displayIntegerBase(self) → int
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
editingFinished

editingFinished(self) [signal]

effectiveWinId(self) → sip.voidptr
ensurePolished(self)
enterEvent(self, QEvent)
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
find(sip.voidptr) → QWidget
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

fixup(self, str) → str
focusInEvent(self, QFocusEvent)
focusNextChild(self) → bool
focusNextPrevChild(self, bool) → bool
focusOutEvent(self, QFocusEvent)
focusPolicy(self) → Qt.FocusPolicy
focusPreviousChild(self) → bool
focusProxy(self) → QWidget
focusWidget(self) → QWidget
font(self) → QFont
fontInfo(self) → QFontInfo
fontMetrics(self) → QFontMetrics
foregroundRole(self) → QPalette.ColorRole
frameGeometry(self) → QRect
frameSize(self) → QSize
geometry(self) → QRect
getContentsMargins(self) → Tuple[int, int, int, int]
grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) → QPixmap
grabGesture(self, Qt.GestureType, flags: Union[Qt.GestureFlags, Qt.GestureFlag] = Qt.GestureFlags())
grabKeyboard(self)
grabMouse(self)

grabMouse(self, Union[QCursor, Qt.CursorShape])

grabShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) → int
graphicsEffect(self) → QGraphicsEffect
graphicsProxyWidget(self) → QGraphicsProxyWidget
hasAcceptableInput(self) → bool
hasFocus(self) → bool
hasFrame(self) → bool
hasHeightForWidth(self) → bool
hasMouseTracking(self) → bool
hasTabletTracking(self) → bool
height(self) → int
heightForWidth(self, int) → int
heightMM(self) → int
hide(self)
hideEvent(self, QHideEvent)
inherits(self, str) → bool
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionSpinBox)
inputMethodEvent(self, QInputMethodEvent)
inputMethodHints(self) → Qt.InputMethodHints
inputMethodQuery(self, Qt.InputMethodQuery) → Any
NumProcsSpinBox.insertAction(self, QAction, QAction)
insertActions(self, QAction, Iterable[QAction])
installEventFilter(self, QObject)
interpretText(self)
isAccelerated(self) → bool
isActiveWindow(self) → bool
isAncestorOf(self, QWidget) → bool
isEnabled(self) → bool
isEnabledTo(self, QWidget) → bool
isFullScreen(self) → bool
isGroupSeparatorShown(self) → bool
isHidden(self) → bool
isLeftToRight(self) → bool
isMaximized(self) → bool
isMinimized(self) → bool
isModal(self) → bool
isReadOnly(self) → bool
isRightToLeft(self) → bool
isSignalConnected(self, QMetaMethod) → bool
isVisible(self) → bool
isVisibleTo(self, QWidget) → bool
isWidgetType(self) → bool
isWindow(self) → bool
isWindowModified(self) → bool
isWindowType(self) → bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
keyboardGrabber() → QWidget
keyboardTracking(self) → bool
killTimer(self, int)
layout(self) → QLayout
layoutDirection(self) → Qt.LayoutDirection
leaveEvent(self, QEvent)
lineEdit(self) → QLineEdit
locale(self) → QLocale
logicalDpiX(self) → int
logicalDpiY(self) → int
lower(self)
mapFrom(self, QWidget, QPoint) → QPoint
mapFromGlobal(self, QPoint) → QPoint
mapFromParent(self, QPoint) → QPoint
mapTo(self, QWidget, QPoint) → QPoint
mapToGlobal(self, QPoint) → QPoint
mapToParent(self, QPoint) → QPoint
mask(self) → QRegion
maximum(self) → int
maximumHeight(self) → int
maximumSize(self) → QSize
maximumWidth(self) → int
metaObject(self) → QMetaObject
metric(self, QPaintDevice.PaintDeviceMetric) → int
minimum(self) → int
minimumHeight(self) → int
minimumSize(self) → QSize
minimumSizeHint(self) → QSize
minimumWidth(self) → int
mouseDoubleClickEvent(self, QMouseEvent)
mouseGrabber() → QWidget
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
move(self, QPoint)

move(self, int, int)

moveEvent(self, QMoveEvent)
moveToThread(self, QThread)
nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) → Tuple[bool, int]
nativeParentWidget(self) → QWidget
nextInFocusChain(self) → QWidget
normalGeometry(self) → QRect
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

overrideWindowFlags(self, Union[Qt.WindowFlags, Qt.WindowType])
overrideWindowState(self, Union[Qt.WindowStates, Qt.WindowState])
paintEngine(self) → QPaintEngine
paintEvent(self, QPaintEvent)
paintingActive(self) → bool
palette(self) → QPalette
parent(self) → QObject
parentWidget(self) → QWidget
physicalDpiX(self) → int
physicalDpiY(self) → int
pos(self) → QPoint
prefix(self) → str
previousInFocusChain(self) → QWidget
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

raise_(self)
receivers(self, PYQT_SIGNAL) → int
rect(self) → QRect
releaseKeyboard(self)
releaseMouse(self)
releaseShortcut(self, int)
removeAction(self, QAction)
removeEventFilter(self, QObject)
render(self, QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground | QWidget.DrawChildren))

render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground|QWidget.DrawChildren))

repaint(self)

repaint(self, int, int, int, int) repaint(self, QRect) repaint(self, QRegion)

resize(self, QSize)

resize(self, int, int)

resizeEvent(self, QResizeEvent)
restoreGeometry(self, Union[QByteArray, bytes, bytearray]) → bool
saveGeometry(self) → QByteArray
NumProcsSpinBox.scroll(self, int, int)

scroll(self, int, int, QRect)

selectAll(self)
sender(self) → QObject
senderSignalIndex(self) → int
setAccelerated(self, bool)
setAcceptDrops(self, bool)
setAccessibleDescription(self, str)
setAccessibleName(self, str)
setAlignment(self, Union[Qt.Alignment, Qt.AlignmentFlag])
setAttribute(self, Qt.WidgetAttribute, on: bool = True)
setAutoFillBackground(self, bool)
setBackgroundRole(self, QPalette.ColorRole)
NumProcsSpinBox.setBaseSize(self, int, int)

setBaseSize(self, QSize)

setButtonSymbols(self, QAbstractSpinBox.ButtonSymbols)
NumProcsSpinBox.setContentsMargins(self, int, int, int, int)

setContentsMargins(self, QMargins)

setContextMenuPolicy(self, Qt.ContextMenuPolicy)
setCorrectionMode(self, QAbstractSpinBox.CorrectionMode)
setCursor(self, Union[QCursor, Qt.CursorShape])
setDisabled(self, bool)
setDisplayIntegerBase(self, int)
setEnabled(self, bool)
setFixedHeight(self, int)
setFixedSize(self, QSize)

setFixedSize(self, int, int)

setFixedWidth(self, int)
setFocus(self)

setFocus(self, Qt.FocusReason)

setFocusPolicy(self, Qt.FocusPolicy)
setFocusProxy(self, QWidget)
setFont(self, QFont)
setForegroundRole(self, QPalette.ColorRole)
setFrame(self, bool)
setGeometry(self, QRect)

setGeometry(self, int, int, int, int)

setGraphicsEffect(self, QGraphicsEffect)
setGroupSeparatorShown(self, bool)
setHidden(self, bool)
setInputMethodHints(self, Union[Qt.InputMethodHints, Qt.InputMethodHint])
setKeyboardTracking(self, bool)
setLayout(self, QLayout)
setLayoutDirection(self, Qt.LayoutDirection)
setLineEdit(self, QLineEdit)
setLocale(self, QLocale)
setMask(self, QBitmap)

setMask(self, QRegion)

setMaximum(self, int)
setMaximumHeight(self, int)
NumProcsSpinBox.setMaximumSize(self, int, int)

setMaximumSize(self, QSize)

setMaximumWidth(self, int)
setMinimum(self, int)
setMinimumHeight(self, int)
NumProcsSpinBox.setMinimumSize(self, int, int)

setMinimumSize(self, QSize)

setMinimumWidth(self, int)
setMouseTracking(self, bool)
setObjectName(self, str)
setPalette(self, QPalette)
setParent(self, QWidget)

setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType])

setPrefix(self, str)
setProperty(self, str, Any) → bool
NumProcsSpinBox.setRange(self, int, int)
setReadOnly(self, bool)
setShortcutAutoRepeat(self, int, enabled: bool = True)
setShortcutEnabled(self, int, enabled: bool = True)
setSingleStep(self, int)
NumProcsSpinBox.setSizeIncrement(self, int, int)

setSizeIncrement(self, QSize)

setSizePolicy(self, QSizePolicy)

setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy)

setSpecialValueText(self, str)
setStatusTip(self, str)
setStepType(self, QAbstractSpinBox.StepType)
setStyle(self, QStyle)
setStyleSheet(self, str)
setSuffix(self, str)
NumProcsSpinBox.setTabOrder(QWidget, QWidget)
setTabletTracking(self, bool)
setToolTip(self, str)
setToolTipDuration(self, int)
setUpdatesEnabled(self, bool)
setValue(self, int)
setVisible(self, bool)
setWhatsThis(self, str)
setWindowFilePath(self, str)
setWindowFlag(self, Qt.WindowType, on: bool = True)
setWindowFlags(self, Union[Qt.WindowFlags, Qt.WindowType])
setWindowIcon(self, QIcon)
setWindowIconText(self, str)
setWindowModality(self, Qt.WindowModality)
setWindowModified(self, bool)
setWindowOpacity(self, float)
setWindowRole(self, str)
setWindowState(self, Union[Qt.WindowStates, Qt.WindowState])
setWindowTitle(self, str)
setWrapping(self, bool)
sharedPainter(self) → QPainter
show(self)
showEvent(self, QShowEvent)
showFullScreen(self)
showMaximized(self)
showMinimized(self)
showNormal(self)
signalsBlocked(self) → bool
singleStep(self) → int
size(self) → QSize
sizeHint(self) → QSize
sizeIncrement(self) → QSize
sizePolicy(self) → QSizePolicy
specialValueText(self) → str
stackUnder(self, QWidget)
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
statusTip(self) → str
stepBy(self, int)
stepDown(self)
stepEnabled(self) → QAbstractSpinBox.StepEnabled
stepType(self) → QAbstractSpinBox.StepType
stepUp(self)
style(self) → QStyle
styleSheet(self) → str
suffix(self) → str
tabletEvent(self, QTabletEvent)
testAttribute(self, Qt.WidgetAttribute) → bool
text(self) → str
textFromValue(self, int) → str
thread(self) → QThread
timerEvent(self, QTimerEvent)
toolTip(self) → str
toolTipDuration(self) → int
tr(self, str, disambiguation: str = None, n: int = - 1) → str
underMouse(self) → bool
ungrabGesture(self, Qt.GestureType)
unsetCursor(self)
unsetLayoutDirection(self)
unsetLocale(self)
update(self)

update(self, QRect) update(self, QRegion) update(self, int, int, int, int)

updateGeometry(self)
updateMicroFocus(self)
updatesEnabled(self) → bool
validate(self, str, int) → Tuple[QValidator.State, str, int]
value(self) → int
valueChanged

valueChanged(self, int) [signal] valueChanged(self, str) [signal]

valueFromText(self, str) → int
visibleRegion(self) → QRegion
whatsThis(self) → str
wheelEvent(self, QWheelEvent)
width(self) → int
widthMM(self) → int
winId(self) → sip.voidptr
window(self) → QWidget
windowFilePath(self) → str
windowFlags(self) → Qt.WindowFlags
windowHandle(self) → QWindow
windowIcon(self) → QIcon
windowIconChanged

windowIconChanged(self, QIcon) [signal]

windowIconText(self) → str
windowIconTextChanged

windowIconTextChanged(self, str) [signal]

windowModality(self) → Qt.WindowModality
windowOpacity(self) → float
windowRole(self) → str
windowState(self) → Qt.WindowStates
windowTitle(self) → str
windowTitleChanged

windowTitleChanged(self, str) [signal]

windowType(self) → Qt.WindowType
wrapping(self) → bool
x(self) → int
y(self) → int
class schrodinger.ui.qt.config_dialog.ConfigDialog(parent, title='', jobname='', checkcommand=None, help_topic='MM_TOPIC_JOB_START_DIALOG', **kw)

Bases: object

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.

allow_replace - Allow the ‘Replace existing entries’ incorporation

option. (Default = False)

allow_in_place - Allow the ‘Append new entries in place’ incorporation

option. (Default = True)

default_disp - The default disposition, if ‘incorporation’ is True.

Must be DISP_APPEND, DISP_APPENDINPLACE, DISP_REPLACE, 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.

host_products Products that will get their own host menu and #cpus

box. Not compatible with cpus3. Takes a list of strings. Default is one host menu.

gpu_host_products Optional map with keys being keys from host_products

that should allow GPU hosts and values being what GpuHostProductMode should be set.

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.

cpus3 - Display additional options for Desmond distributed jobs

which includes 3 CPUS values: X, Y, and Z. Default is False.

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

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.

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.

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.

START = 'Run'
SAVE = 'OK'
WRITE = 'Write'
CANCEL = 'Cancel'
HELP = 'Help'
CPU_UNIT_LABEL = 'processors'
GPU_UNIT_LABEL = 'GPUs'
HOST_LABEL_TEXT = 'Host:'
__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.

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.

showHelp()
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

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

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.

savePressed()

Slot for Save button

writePressed()

Slot for Write button

startPressed()

Slot for OK and Run button

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

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

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

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

updateQueueResources()

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

updateOpenMPLabel()

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

setupHostCombo(combo, use_host=None, hosts=None)
cpus3Edited(ignored=None)
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.

getSettings(extra_kws=None)
applySettings(settings)

Set dialog state using previously-saved parameters

Parameters

settings (StartDialogParams) – saved dialog settings

warning(text)

Display a warning window with the specified text.

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

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

getHostType()
isGPUHost()
isCPUHost()
class schrodinger.ui.qt.config_dialog.GPUConfigDialog(parent, title='', jobname='', checkcommand=None, help_topic='MM_TOPIC_JOB_START_DIALOG', **kw)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

Subclass of the ConfigDialog that shows only GPU hosts.

HOST_LABEL_TEXT = 'GPU host:'
getHosts()

Return a list of GPU hosts

Returns

List of GPU hosts

Return type

list

CANCEL = 'Cancel'
CPU_UNIT_LABEL = 'processors'
GPU_UNIT_LABEL = 'GPUs'
HELP = 'Help'
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

getHostPref()

Get the stored host preference if available

Returns

Stored host preference if available or None

Return type

str or None

getHostType()
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.ui.qt.config_dialog.DummyGpuHost

Bases: schrodinger.tasks.hosts.Host

A dummy host to allow users to write job files to launch elsewhere when a GPU host is not available in their hosts file.

__init__()

Initialize self. See help(type(self)) for accurate signature.

CPUTYPE = 'cpu'
GPUTYPE = 'gpu'
autoSetGpuList()
classmethod fromJobControlHost(jchost, ncpus)
classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromJsonImplementation(json_dict)

Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.

Parameters

json_dict (dict) – A dictionary loaded from a JSON string or file.

Returns

An instance of the derived class.

Return type

cls

getHost() → str

Return the name of the host, which defaults to ‘name’ if a separate ‘host’ attribute wasn’t specified.

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

property host

Return the name of the host, which defaults to ‘name’ if a separate ‘host’ attribute wasn’t specified.

hostType()

Used to determine what type of host this is.

isQueue() → bool

Check to see whether the host represents a batch queue. Returns True if the host is a HPC queueing system.

label()

Returns the string to show in controls, etc.

matchesRequirement(resource_requirement: schrodinger.job.resource.ComputeRequirement) → bool

Return True if this host can meet the resource requirements provided.

All hosts will meet CPU resource requirements.

maxNum()

Returns the number of processors for the type of host - for GPU host, return the number of GPUs, for non-GPU hosts, return the number of CPUs.

setGpuList(gpulist)
setHost(host: str)

Store host as _host to allow us to use a property for the ‘host’ attr.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

toJsonImplementation()

Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.

Returns

A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders

to_hostentry() → str

Return a string representation of the Host object suitable for including in a hosts file.

units()

Return the unit string for the type of processors provided by this host.

schrodinger.ui.qt.config_dialog.get_hosts(ncpus=True, excludeGPGPUs=True)

Return a list of Host objects for use in config dialogs. Note these are a subclass of jobcontrol.Host which has additional features for text labels and accounting for GPUs. If schrodinger.hosts file is missing, only localhost will be returned. If it is unreadable, then an error message will be shown in a dialog box, and an empty list will be returned.

Parameters
  • ncpus (bool) – whether host text labels should include number of processors

  • excludeGPGPUs (bool) – whether to exclude GPU hosts from the list

Returns

a list of Host objects

Return type

list

schrodinger.ui.qt.config_dialog.gpu_hosts_available()

Determines whether any GPU host is available.

Returns

returns True if any GPU host is available and False otherwise.

Return type

bool

schrodinger.ui.qt.config_dialog.get_host_from_hostname(hostname)
Parameters

hostname (str) – The name of the desired host object.

Returns

The host object associated with a host name.

:rtype : Host

class schrodinger.ui.qt.config_dialog.StartDialogParams

Bases: object

A collection of parameter values from the StartDialog class.

__init__()

Initialize. The defaults are used for options that were not requested njobs is not currently used as there is no uniform way to set it

update(params)

Update the param’s attributes based on the given dictionary.

commandLineArgs(include_njobs=True, add_cpus=True)

Convert this set of start dialog parameters into the canonical jobcontrol command line argument list.

Return type

list

Returns

list of job control command line flags

formJaguarCPUFlags()

Determine the command line flags as requested by the user if openmp=True was used in creating the dialog

Return type

list

Returns

The requested command line flags

commandLineOptions()

Convert this set of start dialog parameters into the canonical jobcontrol command line options. NOTE: Does NOT export NJOBS for backward compatability.

schrodinger.ui.qt.config_dialog.form_jaguar_cpu_flags(host, cpus, subjobs, threads, use_parallel_flag=True)

Determine the command line flags for an Open MP job.

Parameters
  • host (str) – The host name

  • cpus (int) – The number of CPUs requested. If subjobs and threads are non-zero, this value will be equal to subjobs * threads and can be ignored.

  • subjobs (int) – The number of subjobs requested. Will be 0 if the user only specified the total number of CPUs.

  • threads (int) – The number of threads requested. Will be 0 if the user only specified the total number of CPUs.

  • use_parallel_flag (bool) – Whether requesting CPUs > 1 without specifying threads > 1 should be represented by the use of the -PARALLEL X flag (True) or -HOST host:X (False). -PARALLEL is a Jaguar flag and may not be appropriate for other programs.

Returns

The appropriate command line flags.

Return type

list

class schrodinger.ui.qt.config_dialog.StartDialog(*args, **kwargs)

Bases: schrodinger.ui.qt.config_dialog.ConfigDialog

START = 'Start'
__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.

CANCEL = 'Cancel'
CPU_UNIT_LABEL = 'processors'
GPU_UNIT_LABEL = 'GPUs'
HELP = 'Help'
HOST_LABEL_TEXT = 'Host:'
SAVE = 'OK'
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

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

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.ui.qt.config_dialog.JobParameters

Bases: object

Class for holding job parameters. Required by AppFrameworkFrame.

__init__()

All attributes are set directly after the instance is created.

printout()

Print out the job parameters.

class schrodinger.ui.qt.config_dialog.DialogParameters

Bases: object

Class for holding dialog parameters. Required by AppFramework Frame Dialogs.

When creating an AppFramework instance, keyword ‘dialogs’ can be sent with dictionary. This dictionary should hold another dictionary of options for each dialog the user wants to set options for, and the key for that dictionary should be the name of the dialog.

Example:

dialogs = {
            'start': {
                        'jobname': 'my_job',
                        'cpus': 0,
                      },
            'read': {
                        'filetypes': [('Input Files', '*.in'),],
                    },
            'write': {},
          }

Options need not be set upon creation of the AppFramework instance, however. You can set options at any point, causing the next call for that dialog to generate itself with the new options.

The DialogParameters instance can be found as:

<AppFramework instance>.dialog_param

Thus if I wanted to turn off the number of cpus option in the start dialog, I would have:

<AppFramework instance>.dialog_param.start['cpus'] = 0

or to change the file type for the read dialog:

<AppFramework instance>.dialog_param.read['filetypes'] =
                                            [('<Type>', '<.ext>')]

See the individual Dialog classes for the supported configuration options.

__init__()

See class docstring. Read dialogs parameters (askopenfilename options) are set to:

'initialdir': '.'
'filetypes': [('Input Files', '*.in')]

by default.

update(dict)

Built in function for updating the DialogParameters class. Passing a dictionary of the values that need to be changed or added will change current values if he key already exists, or add a new key/value pair if it doesn’t.

Thus, if I wanted to change the start dialog behavior with regard to jobname and tmpdir, I would probably do something like:

dict = {
           "start": {
                        'jobname': '<my_new_jobname>',
                        'tmpdir': 1,
                    }
       }

<DialogParameters object>.update(dict)

The next time I brought up the dialog, the changes will have been made.

set(dialog, **kw)

As an alternative to the update() method, I could change the same start dialog options with the command:

<DialogParameters object>.set(‘start’,

jobname = ‘<my_new_jobname>’, tmpdir = 1)

The next time I brought up the dialog, the changes will have been made.