Host Selection

mi_msg_add_host
void mi_msg_add_host(
    const char      *hostname,
    const int       socket_id)

Nominates a host for network rendering. This must be called after mi_raylib_process_attach and before mi_raylib_init. The hostname argument is expected to be the name of a machine that offers a mental ray service. Optionally, a colon followed by a port number may be appended. The service name is taken from the environment variables MI_RAY3_SERVICE or MI_RAY_SERVICE, in that order of definition, and default to mi-ray3/tcp or mi-ray/tcp. The service name is then looked up in the operating system's services database if available to obtain the IP port number; if this fails it defaults to 7002. The server host will be contacted during initialization, and if it passes the negotiation phase it will be available for tessellation and rendering as a mental ray server. See the installation guide for installing a machine as a mental ray server. The socket_id argument should always be set to -1. Note that mi_msg_add_host does not immediately connect to the host but builds a list of hosts that will be connected during mi_raylib_init.

Note that standalone mental ray executables use this function for every host found in the .ray3hosts or .rayhosts file in the current or home directory, except for the first line that matches the host name. If the host is called castor, the first line in the file referencing castor (but not aliases such as localhost) is ignored and not passed to mi_msg_add_host. This is done to allow sharing a host list between all hosts.

mi_msg_remove_host
void mi_msg_remove_host(
    const char      *hostname)

Remove a slave host from the host list. The host will not be given any new jobs from this point on, and when it has finished its current jobs it will be disconnected. This means that there may be some delay before the host is disconnected.

mi_msg_no_of_cpus
const char *mi_msg_no_of_cpus(void)

Return the number of processors on the local host. This call can be used before mi_raylib_init to determine a good number of render threads to use (passed as second argument of mi_raylib_init).

Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.