task_registry

class pyrosetta.distributed.cluster.task_registry.UserArgs(protocol_name: str, compressed_protocol: bytes, compressed_packed_pose: bytes, compressed_kwargs: bytes, pyrosetta_init_kwargs: Dict[str, Any], client_repr: str, extra_args: Dict[str, Any], masked_key: bytes, task_id: str)

Bases: Generic[G]

Dataclass for the user_spawn_thread function argument.

protocol_name: str
compressed_protocol: bytes
compressed_packed_pose: bytes
compressed_kwargs: bytes
pyrosetta_init_kwargs: Dict[str, Any]
client_repr: str
extra_args: Dict[str, Any]
masked_key: bytes
task_id: str
__init__(protocol_name: str, compressed_protocol: bytes, compressed_packed_pose: bytes, compressed_kwargs: bytes, pyrosetta_init_kwargs: Dict[str, Any], client_repr: str, extra_args: Dict[str, Any], masked_key: bytes, task_id: str) None
_is_protocol = False
class pyrosetta.distributed.cluster.task_registry.TaskRecord(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any])

Bases: Generic[G]

Dataclass for PyRosettaCluster task registry entries.

clients_index: int
user_args: UserArgs
submit_kwargs: Dict[str, Any]
__init__(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) None
_is_protocol = False
class pyrosetta.distributed.cluster.task_registry.TaskRegistryBase(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz')

Bases: Generic[G]

PyRosettaCluster task registry base class.

instance_id
compression
serializer
seal(task_record: TaskRecord) bytes

Compress a task registry entry.

unseal(buffer: bytes) TaskRecord

Decompress a task registry entry.

deepcopy_user_args(user_args: UserArgs) UserArgs

Deep copy a UserArgs dataclass to break in-memory references to any objects that keep billiard subprocesses alive.

create_task_record(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) TaskRecord

Create a task record.

unpack_task_record(task_record: TaskRecord) Tuple[int, UserArgs, Dict[str, Any]]

Unpack a task record.

__init__(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz') None

Method generated by attrs for class TaskRegistryBase.

_is_protocol = False
class pyrosetta.distributed.cluster.task_registry.DiskTaskRegistry(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz', task_registry_dir: str)

Bases: TaskRegistryBase[G]

Task registry for on-disk PyRosettaCluster task arguments.

task_registry_dir
file_ext
_shard_key(key: str) str

Shard a Dask future key for a subdirectory name.

_get_task_file(key: str, makedirs: bool = False) str

Get a filename for a task record.

total_size() int

Return the total size of the on-disk task registry (in bytes).

set(key: str, **kwargs: Any) None

Set a task record into the on-disk task registry.

get(key: str, default: None = None) Optional[Tuple[int, UserArgs, Dict[str, Any]]]

Get an unpacked task record from the on-disk task registry.

pop(key: str) None

Remove a task record from the on-disk task registry.

clear() None

Clear all task records from the on-disk task registry.

__init__(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz', task_registry_dir: str) None

Method generated by attrs for class DiskTaskRegistry.

_is_protocol = False
compression
create_task_record(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) TaskRecord

Create a task record.

deepcopy_user_args(user_args: UserArgs) UserArgs

Deep copy a UserArgs dataclass to break in-memory references to any objects that keep billiard subprocesses alive.

instance_id
seal(task_record: TaskRecord) bytes

Compress a task registry entry.

serializer
unpack_task_record(task_record: TaskRecord) Tuple[int, UserArgs, Dict[str, Any]]

Unpack a task record.

unseal(buffer: bytes) TaskRecord

Decompress a task registry entry.

class pyrosetta.distributed.cluster.task_registry.MemoryTaskRegistry(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz')

Bases: TaskRegistryBase[G]

Task registry for in-memory PyRosettaCluster task arguments.

registry
total_size() int

Return the total size of the in-memory task registry (in bytes).

set(key: str, **kwargs: Any) None

Set a task record into the in-memory task registry.

get(key: str, default: None = None) Optional[Tuple[int, UserArgs, Dict[str, Any]]]

Get an unpacked task record from the in-memory task registry.

pop(key: str) None

Remove a task record from the in-memory task registry.

clear() None

Clear all task records from the in-memory task registry.

__init__(*, instance_id: Optional[str] = None, compression: Optional[Union[str, bool]] = 'xz') None

Method generated by attrs for class MemoryTaskRegistry.

_is_protocol = False
compression
create_task_record(clients_index: int, user_args: UserArgs, submit_kwargs: Dict[str, Any]) TaskRecord

Create a task record.

deepcopy_user_args(user_args: UserArgs) UserArgs

Deep copy a UserArgs dataclass to break in-memory references to any objects that keep billiard subprocesses alive.

instance_id
seal(task_record: TaskRecord) bytes

Compress a task registry entry.

serializer
unpack_task_record(task_record: TaskRecord) Tuple[int, UserArgs, Dict[str, Any]]

Unpack a task record.

unseal(buffer: bytes) TaskRecord

Decompress a task registry entry.