LaunchProcess
Purpose
Launch a local or remote process to run an analysis engine. This function is called by the Ansys Electromagnetics desktop application to launch an engine process on a specified host. The hostname is one of the names in the list provided by the GetMachineListAvailableForDistribution function. SeeGetMachineListAvailableForDistribution. If the hostname does not refer to the local host, then this function shall use the scheduler to launch the engine on the specified host. If the hostname refers to the local host, then the engine may be started as a child process, or it may be started using the scheduler.
Signature
extern "C" int FN_PREFIX_LaunchProcess(const char*
hostName, const char* exePathName, const char* arg1, const char* arg2);
Arguments
hostName: The name of the host where the process is to be launched.
exePathName: The pathname of the analysis engine executable to be started.
arg1: The first argument of the analysis engine command line.
arg2: The second argument of the analysis engine command line.
Return Value
Returns 0 on success. Returns a non-zero value if an error occurs.
Notes
The hostName
argument will be one of the hostnames provided
by the function GetMachineListAvailableForDistribution().
If the hostName
argument is the same as the current host,
then the analysis engine process may be started as a child process. If
the hostName
argument is not the same as the current host, then the analysis
engine process will be started on the remote host using the facilities
available in the scheduler environment. The command line of the analysis
engine process is exePathName arg1 arg2.
The command line arguments arg1 and arg2 may contain newlines, tabs, spaces or
other characters that are interpreted by the command processor, such
as single quote (') or double quote (") characters, or dollar signs ($).
Newlines or tabs may be replaced by spaces, if the newline or tab characters
cannot be easily handled. If the analysis engine command is processed
by a shell, then it may be necessary to quote any special characters
in the exePathName or in the arguments
so that the special meaning is removed. If a scheduler command is used
to request the scheduler to launch the command to start the engine process,
the analysis engine command may be processed by the shell twice: once
when the scheduler command is processed, and a second time when the analysis
engine process is started. If this is the case, then the quoting of special
characters needs to account for two passes through the command processor.