RemoteKernelObject

RemoteKernelObject[spec]

specifies a remote kernel that can be used for RemoteEvaluate.

Details

  • RemoteKernelObject["spec",options ] can be used to override default settings for a kernel specification.
  • The following remote kernel specifications are recognized:
  • "ssh://user@hostname:port/path"a kernel on the given machine, accessed using SSH
    "ssh://hostname"use the default path, user and port on the given machine
    "hostname"equivalent to "ssh://hostname"
    "wstp://server:port/pool"a kernel on a WSTPServer
    "wstp://server"use the default port and kernel pool
    "localhost"a kernel on the same machine
    "https://www.wolframcloud.com/"a kernel in the Wolfram Cloud
  • Settings for ssh kernels include:
  • "Host"Nonethe name of the machine to connect to
    "Username"Nonethe login name that ssh should use
    "Method"(OS-dependent)how to connect to the kernel on the remote machine
    "RemoteKernelCommand""wolfram"the kernel program to run
    "RemoteKernelArguments"(OS-dependent)arguments to pass the the kernel program
    "SSHCommand""ssh"the name of the ssh command
    "SSHArguments"(see below)arguments to pass to the ssh command
    "SSHIdentity"Nonethe private ssh key to use
    "ForwardPort"Randomremote port to use for connection forwarding
    "Timeout"5number of seconds to wait for a connection
  • The connection method "Launch" is the default on macOS and Linux. It uses LinkLaunch to invoke ssh and uses stdin/stdout for the WSTP connection to the remote kernel.
  • The connection method "Forward" is the default on Windows. It creates a listening WSTP socket on the local machine and forwards the kernel connection inside an ssh tunnel from the remote kernel to the listening socket.
  • If the "wolfram" command is not on the search path on the remote machine, the absolute path to the remote kernel command should be given as value of "RemoteKernelCommand".
  • If "Username" is not set or is None, no username part is given on the ssh command line. "Username"$Username sets the remote username to be the same as the local one.
  • "Username" and "RemoteKernelCommand" can also be given as part of the specification as "ssh://user@hostname:port/path".
  • The default "SSHArguments" are -x -o StrictHostKeyChecking=accept-new -o BatchMode=yes.
  • Ssh cannot ask for passwords interactively. Keys can be specified, or an ssh password agent can be used.
  • Settings for WSTPServer kernels include:
  • "Host"Nonethe name of the server to connect to
    "Port"31415the port to connect to
    "Pool"Automaticthe kernel pool to request
  • If the kernel pool is not specified, the WSTPServer chooses a kernel from the default pool.
  • Settings for Cloud kernels include:
  • "CloudBase"Nonethe cloud base
  • The cloud base is given in the form of an https URL.
  • Settings for local kernels include:
  • "LocalKernelCommand"(OS-dependent)the kernel program to launch
    "LocalKernelArguments"(OS-dependent)arguments to pass to the kernel program

Examples

open allclose all

Basic Examples  (2)

Connect to a machine with ssh, launch a default kernel and evaluate some of its properties:

Optionally wrap the kernel specification in RemoteKernelObject:

Specify an absolute path to the remote kernel command:

Alternatively, give the path as an option of RemoteKernelObject:

Scope  (8)

Ssh Kernels  (2)

Give the path to the remote kernel as an option of RemoteKernelObject:

Alternatively, specify the path as part of the ssh string:

If no options are needed, RemoteKernelObject can be omitted:

WSTPServer Kernels  (2)

Connect to a WSTPServer listening on the given port:

Alternatively specify the port as an option of RemoteKernelObject:

Connect to a WSTPServer and request a kernel in the given pool:

Alternatively specify the kernel pool as an option of RemoteKernelObject:

Cloud Kernels  (2)

Use a kernel in the default cloud:

Specify a URL for a (private) cloud to use:

Local Kernels  (2)

Use a specific local kernel, given by its absolute path:

Alternatively, give the path in the first argument:

If no options are needed, RemoteKernelObject can be omitted:

Use a specific local kernel, given by its relative path:

Properties & Relations  (1)

A kernel object describes a method for launching a kernel; it does not represent a persistent connection:

Each evaluation launches a new kernel, which is discarded after use:

Wolfram Research (2020), RemoteKernelObject, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoteKernelObject.html.

Text

Wolfram Research (2020), RemoteKernelObject, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoteKernelObject.html.

BibTeX

@misc{reference.wolfram_2020_remotekernelobject, author="Wolfram Research", title="{RemoteKernelObject}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RemoteKernelObject.html}", note=[Accessed: 21-April-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_remotekernelobject, organization={Wolfram Research}, title={RemoteKernelObject}, year={2020}, url={https://reference.wolfram.com/language/ref/RemoteKernelObject.html}, note=[Accessed: 21-April-2021 ]}

CMS

Wolfram Language. 2020. "RemoteKernelObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RemoteKernelObject.html.

APA

Wolfram Language. (2020). RemoteKernelObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoteKernelObject.html