Example #1
0
    'Use "localhost" when setting up the computer that AiiDA is running on',
)

DESCRIPTION = options.DESCRIPTION.clone(
    prompt='Description', cls=InteractiveOption, help='A human-readable description of this computer.'
)

TRANSPORT = options.TRANSPORT.clone(prompt='Transport plugin', cls=InteractiveOption)

SCHEDULER = options.SCHEDULER.clone(prompt='Scheduler plugin', cls=InteractiveOption)

SHEBANG = OverridableOption(
    '--shebang',
    prompt='Shebang line (first line of each script, starting with #!)',
    default='#!/bin/bash',
    cls=InteractiveOption,
    help=
    'This line specifies the first line of the submission script for this computer (only the bash shell is supported).',
    type=types.ShebangParamType()
)

WORKDIR = OverridableOption(
    '-w',
    '--work-dir',
    prompt='Work directory on the computer',
    default='/scratch/{username}/aiida/',
    cls=InteractiveOption,
    help='The absolute path of the directory on the computer where AiiDA will '
    'run the calculations (often a "scratch" directory).'
    'The {username} string will be replaced by your username on the remote computer.'
)
Example #2
0
from aiida.cmdline.params.options.overridable import OverridableOption


def is_on_computer(ctx):
    return bool(ctx.params.get('on_computer'))


def is_not_on_computer(ctx):
    return bool(not is_on_computer(ctx))


ON_COMPUTER = OverridableOption(
    '--on-computer/--store-in-db',
    is_eager=False,
    default=True,
    cls=InteractiveOption,
    prompt='Installed on target computer?',
    help=
    'Whether the code is installed on the target computer, or should be copied to the target computer each time '
    'from a local path.')

REMOTE_ABS_PATH = OverridableOption(
    '--remote-abs-path',
    prompt='Remote absolute path',
    required_fn=is_on_computer,
    prompt_fn=is_on_computer,
    type=types.AbsolutePathParamType(dir_okay=False),
    cls=InteractiveOption,
    help=
    '[if --on-computer]: Absolute path to the executable on the target computer.'
)
Example #3
0
DESCRIPTION = options.DESCRIPTION.clone(
    prompt='Description',
    cls=InteractiveOption,
    help='A human-readable description of this computer.')

TRANSPORT = options.TRANSPORT.clone(prompt='Transport plugin',
                                    cls=InteractiveOption)

SCHEDULER = options.SCHEDULER.clone(prompt='Scheduler plugin',
                                    cls=InteractiveOption)

SHEBANG = OverridableOption(
    '--shebang',
    prompt='Shebang line (first line of each script, starting with #!)',
    default='#!/bin/bash',
    cls=InteractiveOption,
    help=
    'This line specifies the first line of the submission script for this computer.',
    type=types.ShebangParamType())

WORKDIR = OverridableOption(
    '-w',
    '--work-dir',
    prompt='Work directory on the computer',
    default='/scratch/{username}/aiida/',
    cls=InteractiveOption,
    help='The absolute path of the directory on the computer where AiiDA will '
    'run the calculations (typically, the scratch of the computer). You '
    'can use the {username} replacement, that will be replaced by your '
    'username on the remote computer.')
Example #4
0
DESCRIPTION = options.DESCRIPTION.clone(
    prompt='Description',
    cls=InteractiveOption,
    help='A human-readable description of this computer.')

TRANSPORT = options.TRANSPORT.clone(prompt='Transport plugin',
                                    cls=InteractiveOption)

SCHEDULER = options.SCHEDULER.clone(prompt='Scheduler plugin',
                                    cls=InteractiveOption)

SHEBANG = OverridableOption(
    '--shebang',
    prompt='Shebang line (first line of each script, starting with #!)',
    default='#!/bin/bash',
    cls=InteractiveOption,
    help=
    'Specify the first line of the submission script for this computer (only the bash shell is supported).',
    type=types.ShebangParamType())

WORKDIR = OverridableOption(
    '-w',
    '--work-dir',
    prompt='Work directory on the computer',
    default='/scratch/{username}/aiida/',
    cls=InteractiveOption,
    help='The absolute path of the directory on the computer where AiiDA will '
    'run the calculations (often a "scratch" directory).'
    'The {username} string will be replaced by your username on the remote computer.'
)
Example #5
0
from aiida.cmdline.params.options.overridable import OverridableOption


def is_on_computer(ctx):
    return bool(ctx.params.get('on_computer'))


def is_not_on_computer(ctx):
    return bool(not is_on_computer(ctx))


ON_COMPUTER = OverridableOption(
    '--on-computer/--store-in-db',
    is_eager=False,
    default=True,
    cls=InteractiveOption,
    prompt='Installed on target computer?',
    help=
    'Whether the code is installed on the target computer or should be copied each time from a local path.'
)

REMOTE_ABS_PATH = OverridableOption(
    '--remote-abs-path',
    prompt='Remote absolute path',
    required_fn=is_on_computer,
    prompt_fn=is_on_computer,
    type=types.AbsolutePathParamType(dir_okay=False),
    cls=InteractiveOption,
    help=
    ('[if --on-computer]: the absolute path to the executable on the remote machine.'
     ))
Example #6
0
    from aiida.common.datastructures import calc_states
    return tuple(state for state in calc_states)


def active_process_states():
    """Return a list of process states that are considered active."""
    from plumpy import ProcessState
    return ([
        ProcessState.CREATED.value,
        ProcessState.WAITING.value,
        ProcessState.RUNNING.value,
    ])


CALCULATION = OverridableOption(
    '-C', '--calculation', 'calculation',
    type=types.CalculationParamType(),
    help='A single calculation identified by its ID or UUID.')

CALCULATIONS = OverridableOption(
    '-C', '--calculations', 'calculations',
    type=types.CalculationParamType(), cls=MultipleValueOption,
    help='One or multiple calculations identified by their ID or UUID.')

CODE = OverridableOption(
    '-X', '--code', 'code',
    type=types.CodeParamType(),
    help='A single code identified by its ID, UUID or label.')

CODES = OverridableOption(
    '-X', '--codes', 'codes',
    type=types.CodeParamType(), cls=MultipleValueOption,