The Virtual Brain Project

Table Of Contents

Previous topic

services Package

Next topic

interfaces Package

This Page

backend_clients Package

backend_client

class tvb.core.services.backend_clients.backend_client.BackendClient[source]

Bases: builtins.object

Interface for a backend client that runs operations asynchronously on a specific environment

static execute(operation_id, user_name_label, adapter_instance)[source]

Start operation asynchronously

static stop_operation(operation_id)[source]

Stop the thread for a given operation id

cluster_scheduler_client

class tvb.core.services.backend_clients.cluster_scheduler_client.ClusterSchedulerClient[source]

Bases: tvb.core.services.backend_clients.backend_client.BackendClient

Simple class, to mimic the same behavior we are expecting from StandAloneClient, but firing behind the cluster job scheduling process..

static execute(operation_id, user_name_label, adapter_instance)[source]

Call the correct system command to submit a job to the cluster.

static stop_operation(operation_id)[source]

Stop a thread for a given operation id

hpc_scheduler_client

class tvb.core.services.backend_clients.hpc_scheduler_client.HPCJobStatus[source]

Bases: enum.Enum

An enumeration.

FAILED = <HPCJobStatus.FAILED: 'FAILED'>
QUEUED = <HPCJobStatus.QUEUED: 'QUEUED'>
READY = <HPCJobStatus.READY: 'READY'>
STAGINGIN = <HPCJobStatus.STAGINGIN: 'STAGINGIN'>
STAGINGOUT = <HPCJobStatus.STAGINGOUT: 'STAGINGOUT'>
SUCCESSFUL = <HPCJobStatus.SUCCESSFUL: 'SUCCESSFUL'>
class tvb.core.services.backend_clients.hpc_scheduler_client.HPCOperationThread(operation_id, *args, **kwargs)[source]

Bases: threading.Thread

stop()[source]
stopped()[source]
class tvb.core.services.backend_clients.hpc_scheduler_client.HPCSchedulerClient[source]

Bases: tvb.core.services.backend_clients.backend_client.BackendClient

Simple class, to mimic the same behavior we are expecting from StandAloneClient, but firing the operation on an HPC node. Define TVB_BIN_ENV_KEY and CSCS_LOGIN_TOKEN_ENV_KEY as environment variables before running on HPC.

CSCS_DATA_FOLDER = 'data'
CSCS_LOGIN_TOKEN_ENV_KEY = 'CSCS_LOGIN_TOKEN'
HOME_FOLDER_MOUNT = '/HOME_FOLDER'
TVB_BIN_ENV_KEY = 'TVB_BIN'
static compute_available_disk_space(operation)[source]
static execute(operation_id, user_name_label, adapter_instance)[source]

Call the correct system command to submit a job to HPC.

file_handler = <tvb.core.entities.file.files_helper.FilesHelper object at 0x7f5e8c546d90>
static stage_out_to_operation_folder(working_dir, operation, simulator_gid)[source]
static stop_operation(operation_id)[source]
update_datatype_groups()[source]
update_db_with_results(operation, sim_h5_filenames, metric_operation, metric_h5_filename)[source]

Generate corresponding Index entities for the resulted H5 files and insert them in DB.

tvb.core.services.backend_clients.hpc_scheduler_client.get_op_thread(op_id)[source]

standalone_client

class tvb.core.services.backend_clients.standalone_client.OperationExecutor(op_id)[source]

Bases: threading.Thread

Thread in charge for starting an operation, used both on cluster and with stand-alone installations.

run()[source]

Get the required data from the operation queue and launch the operation.

static stop_pid(pid)[source]

Stop a process specified by PID. :returns: True when specified Process was stopped in here, False in case of exception(e.g. process stopped in advance).

stopped()[source]

Check if current thread was marked for stop.

class tvb.core.services.backend_clients.standalone_client.StandAloneClient[source]

Bases: tvb.core.services.backend_clients.backend_client.BackendClient

Instead of communicating with a back-end cluster, fire locally a new thread.

static execute(operation_id, user_name_label, adapter_instance)[source]

Start asynchronous operation locally

static stop_operation(operation_id)[source]

Stop a thread for a given operation id