Programs for executing remote functions and remote methods are written using the GridRPC API. The creation of these programs is described in section 4.5.
(If the application program is written in C, there is no particular need for the NG_COMPILER settings.)
The NG_COMPILER environment variable is used to specify the compiler to be used to compile the Ninf-G Client. The default compiler for ng_cc is cc. Required options can be specified in NG_COMPILER in addition to the compiler name (path). When g++ is used, for example, NG_COMPILER is set in the following way.
'g++ -Wall -g'
(If the application program is written in C, there is no particular need for the NG_LINKER settings.)
The NG_ LINKER environment variable is used to specify the linker to be used to link the Ninf-G Client. The default linker for ng_cc is cc. Required options can be specified in NG_ LINKER in addition to the linker name (path). When g++ is used, for example, NG_ LINKER is set in the following way.
'g++ -Wall -g'
The application program created earlier is compiled using the ng_cc command, thus creating a Ninf-G Client program. An example of using the ng_cc command is shown below.
% ${NG_DIR}/bin/ng_cc -g -o test_client test_client.c
test_client.c: Ninf-G client source program
test_client: Ninf-G client executable program
(the result of compiling source program)
This is the configuration file for settings concerning servers, clients and the MDS.
(The configuration file specifications are described in section 4.3.)
Prepare the following files as specified in the configuration file.
Note: The local LDIF file is generated when the Ninf-G Executable is created on the server. When used, the local LDIF file that is generated on the server that executes the remote functions or remote methods must be copied to a place where it can be used from the Ninf-G Client.
Note: The environment variable LD_LIBRARY_PATH must be specified appropriately in the client configuration file if the Ninf-G Executable file will be staged to a system whose software environment is different from the build environment of the Ninf-G Executable.
The Ninf-G Client configuration file is a text file which contains settings information that is required for the operation of Ninf-G Client. It consists of seven sections, which are INCLUDE, CLIENT, LOCAL_LDIF, FUNCTION_INFO, MDS_SERVER, SERVER, and SERVER_DEFAULT.
Examples of section and attribute descriptions are shown below.
#comment <section> attribute value # comment attribute value # comment attribute value # comment </section> ... |
Examples of errors in description are shown below.
<section>Attribute Value # Section and attribute on the same line AttributeValue # No delimiter between the attribute and attribute value Attribute Value Attribute Value # Multiple attributes on the same line Attribute # Attribute and attribute value Value # extend across more than one line. Attribute \ Value # Line continued with a backslash (\) Attribute # No attribute value </section> <CLIENT> # Multiple definitions in a section where ... # </CLIENT> # <CLIENT> # multiple definitions are not allowed ... # </CLIENT> # <MDS_SERVER> # Attribute value redundancy within a section hostname example.org # where multiple definitions are allowed </MDS_SERVER> <MDS_SERVER> hostname example.org # </MDS_SERVER> # <LOCAL_LDIF> # Attribute value redundancy filename example.ngdef # for an attribute that allows filename example.ngdef # multiple attribute values </LOCAL_LDIF> <SERVER> HostName example.com # Upper and lower case letters hostname EXAMPLE.COM # Upper and lower case letters </SERVER> |
When a time value is specified as an attribute value (for time-out or other such attributes), a unit of time can be specified (e.g., 30 s, 30 sec or 30 seconds).
It is also possible to specify 'minute' or 'hour' as the time unit. Character strings such as 'se' and 'seco' are also interpreted to mean second, but strings that are not contained in 'second', such as 'set' will cause an error.
When specifying the number of bytes as an attribute value for attributes such as log file size, units (*) such as 1 K or 1 Kilo can be specified. Mega and Giga can also be specified as a unit for number of bytes.
Character strings such as Me, Meg, etc. are also interpreted to mean Mega, but strings that are not contained in Mega, such as Ma cause an error.
(*) 1 K = 1024 bytes, 1 M = 1024 Kbytes, 1 G = 1024 Mbytes
Each section of the configuration file is described below.
The INCLUDE section allows multiple definitions.
An example of an INCLUDE section description is shown below.
<INCLUDE> filename file name filename file name </INCLUDE> |
The attributes and attribute values of the INCLUDE section are shown below.
Attribute | Attribute value | Default value | Multiple | Explanation |
---|---|---|---|---|
filename | File name | None | Yes | File to include |
The file name of the configuration file to be read is specified. The file to be read must be in the configuration file format.
The CLIENT section does not allow multiple definitions.
An example of a CLIENT section description is shown below.
<CLIENT> hostname Host name save_sessionInfo Session information count loglevel [0-5] loglevel_globusToolkit [0-5] loglevel_ninfgProtocol [0-5] loglevel_ninfgInternal [0-5] loglevel_ninfgGrpc [0-5] log_filePath File name log_suffix Suffix log_nFiles Number of files log_maxFileSize Number of bytes log_overwriteDirectory [true/false] refresh_credential Seconds </CLIENT> |
The attributes and attribute values of the CLIENT section are shown below.
Attribute | Attribute value | Default value | Multiple | Explanation |
---|---|---|---|---|
hostname | Host name | globus_libc_ gethostname() | No | The host name of the client |
save_sessionInfo | Session information count | 256 | No | The number of session information units to be saved |
loglevel | [0-5] | 2 | No | Overall log level |
loglevel_globusToolkit | [0-5] | 2 | No | Globus Toolkit API error log level |
loglevel_ninfgProtocol | [0-5] | 2 | No | Ninf-G protocol error log level |
loglevel_ninfgInternal | [0-5] | 2 | No | Ninf-G internal error log level |
loglevel_ninfgGrpc | [0-5] | 2 | No | Grid RPC API error log level |
log_filePath | File name | stderr | No | The log file name |
log_suffix | Suffix | Sequence number | No | The log file suffix |
log_nFiles | Number of files | 1 | No | The number of files for log |
log_maxFileSize | Number of bytes | 1M/unlimited | No | Maximum number of bytes for log file |
log_overwriteDirectory | [true/false] | false | No | Over-write permission for log directory |
refresh_credential | Seconds | 0 | No | Refreshing proxy credential interval |
The log level can be specified by using the strings listed in the 'Meaning' column in the table below as well as by using a number value.
The meanings of the log level values are described below.
Value | Meaning | Explanation |
---|---|---|
0 | Off | Nothing is output. |
1 | Fatal | A fatal error is output. |
2 | Error | A nonfatal error is output. |
3 | Warning | A warning error is output. |
4 | Information | Guidance or other such information is output. |
5 | Debug | Debugging information is output. |
This host name is the host name of client machine on which the Ninf-G Client is running. It is used by Ninf-G Executable when connecting to Ninf-G Client.
The host name can be specified by an IP address such as 192.168.0.1 as well as by the ordinary host name.
If omitted, the hostname returned by the Globus Toolkit API globus_libc_gethostname() function is used. The hostname is equivalent to the output of globus-hostname command.
The main purposes for which this is used are described below.
Note: If hostname attribute is set, the environment variable GLOBUS_HOSTNAME is overwritten by its value.
Note: The hostname attribute may not be set appropriately when globus_libc_gethostname() is called before grpc_initialize().
This is the number of session information units stored internally by Ninf-G.
If the number defined here is exceeded, the session entries are discarded beginning with the oldest first.
If omitted, the value of 256 is used.
The log level is specified for all log categories by log level and for each category individually by loglevel_*.
When the log level for each category has not been specified, the log level for all categories is applied.
When omitted, the value of NG_LOG_LEVEL environment variable is used.
If NG_LOG_LEVEL environment variable is not set, 2 (Error) is used as
the default value of loglevel.
The name of the file to which the log is output is specified in the log file name.
The file name may include a path that includes a directory (e.g., "/home/myHome/var/logFile").
The file and directory name can include the following specifiers.
"%t" is replaced with the date as year, month and day, and the time in hours, minutes, seconds and milliseconds ("yyyymmdd-hhmmss-MMM") (e.g., "/ home/myHome/var/logDir%t/logFile" is replaced by "/home/myHome/var/logDir20030101-154801-123/logFile").
"%h" is replaced with the Ninf-G Client hostname.
"%p" is replaced with the process id of the Ninf-G Client.
When omitted, the log is output to standard error. If the log file name is omitted, the log_suffix, log_nFiles and log_maxFileSize are ignored.
When a log file is specified, this specifies the suffix for when the log file is created.
If a suffix is specified, the generated file name will be from "filename[000].suffix" to "filename[nnn].suffix". If omitted, the generated file name will be from "filename.[000]" to "filename.[nnn]". The number of files minus 1 is "nnn".
The number of digits in "nnn" is the same as the number of digits in number of files minus 1. For example, if the number of files is set to 100, then the number will range from "00" to "99".
This is the number of files created for log output.
0 indicates to output unlimited number of files. An negative value results in an error.
If omitted, the value 1 is used.
This is the maximum number of bytes for the log file.
If omitted, the value will be unlimited if the number of files is one or 1Mbyte if the number of files is two or more.
This establishes overwrite permission for the directory. If the specified directory exists, this specifies whether the creation of log files in that directory is enabled or disabled. The operation in the case that the directory exists is shown below.
This specifies the interval for refreshing the proxy credential.
If the value 0 is specified, Ninf-G Client will not refresh the proxy credential. If a value of 1 or greater is specified, Ninf-G Client will refresh the proxy credential and send it to Job Manager. If a negative value is specified, an error results.
If omitted, the value 0 is used.
Note: refreshing the proxy credential on client program feature is supported only in pthread version. It's OK to build Ninf-G Executable with both pthread version and non-thread version of Globus Toolkit flavor.
Note: Ninf-G Java Client does not support this feature.
The LOCAL_LDIF section allows multiple definitions. The LOCAL_LDIF section may be omitted.
An example of a LOCAL_LDIF section description is shown below.
<LOCAL_LDIF> filename file name filename file name </LOCAL_LDIF> |
The attributes and attribute values of the LOCAL_LDIF section are shown below.
Attribute | Attribute value | Default value | Multiple | Explanation |
---|---|---|---|---|
filename | File name | None | Yes | Local LDIF file |
This specifies the local LDIF file that contains the Ninf-G Executable information. One file name cannot have multiple descriptions. The local LDIF file is generated by the ng_gen command.
The FUNCTION_INFO section allows multiple definitions. The FUNCTION_INFO section may be omitted.
An example of a FUNCTION_INFO section description is shown below.
<FUNCTION_INFO> hostname Host name funcname Function name path Path staging [true/false] backend Backend session_timeout Seconds </FUNCTION_INFO> |
The attributes and attribute values of the FUNCTION_INFO section are shown below.
Attribute | Attribute value | Default value | Multiple | Explanation |
---|---|---|---|---|
hostname | Host name | None | No | Server machine host name |
funcname | Function name | None | No | The function name of the remote function |
path | Path | None | No | The path to the Ninf-G Executable |
staging | [true/false] | false | No | Staging enabled or disabled |
backend | Backend | normal | No | Backend software by which Ninf-G Executable is launched |
session_timeout | Seconds | 0 | No | RPC execution timeout |
This specifies the host name of the server machine.
It cannot be omitted.
This specifies the function name of the remote function.
It cannot be omitted.
This specifies the path to Ninf-G Executable. If staging is set to true, the path on the client machine is specified. If staging is set to false, the path on the server machine is specified.
It cannot be omitted.
This specifies whether or not staging (*) is to be executed. If 'true' is specified, staging is executed.
If omitted, the value is taken to be 'false'.
(*) A function for starting up the Ninf-G Executable located on the client machine after transfer to the server machine.
This specifies backend software by which Ninf-G Executable is launched. Backend should be either normal, mpi or blacs. If the backend is normal, Ninf-G Executable is directly launched by GRAM. If the backend is mpi, GRAM will use mpirun command to launch Ninf-G Executable as MPI processes. blacs is used when Ninf-G Executable should be launched by blacs.
Backend should be specified if neither MDS nor local LDIF is used for execution and users intend to use mpi or blacs for launching Ninf-G Executable.
If omitted, the value is taken to be 'normal'.
This specifies the RPC execution timeout value. If the RPC execution time exceeds the timeout, then the outstanding RPC will be terminated and returned as a timeout error. The handle which was associated with the RPC becomes inoperative and will not be able to be used for any RPCs.
Measurement of the execution time of an RPC is started when a session invocation API such as grpc_call() is called. The execution time of an RPC involves not only the time for computation of the remote library but also other unexpected time. For example, the timeout error may occur when the job will not be invoked due to unknown reason.
The session_timeout attribute can be used for avoiding unexpected freeze of the Ninf-G client caused by rare-case accidents on Ninf-G Executables.
If 0 is specified, then the timeout feature is disabled. The default value of session_timeout is 0.
Note: session_timeout feature is supported for pthreads flavors.
The MDS_SERVER section allows multiple definitions. The MDS_SERVER section can be omitted.
When an MDS request for information is made, the request is issued to the MDS server specified by the MDS_SERVER section defined in the configuration file. The search is executed repeatedly in order, beginning with the first definition, until the information has been found or the last MDS_SERVER defined in the section has been searched.
An example of MDS_SERVER section description is shown below.
<MDS_SERVER> hostname Host name port Port number vo_name VONAME client_timeout Seconds server_timeout Seconds </MDS_SERVER> |
The attributes and attribute values of the MDS_SERVER section are shown below.
Attribute | Attribute value | Default value | Multiple | Explanation |
---|---|---|---|---|
hostname | Host name | None | No | MDS server host name |
port | Port number | 2135 | No | MDS server port number |
vo_name | VONAME | Local | No | GIIS vo name |
client_timeout | Seconds | 0 | No | The client time-out time |
server_timeout | Seconds | 0 | No | The server time-out time |
This specifies the host name of the MDS server.
The MDS server host name cannot be omitted.
This specifies the port number of the MDS server.
If omitted, the default port 2135 is used.
This specifies the vo name of GIIS.
If omitted, "local" is used.
The client time-out value specifies the time-out time for connection between client and server.
If the value 0 is specified, there is no time-out in waiting for a response.
If omitted, the default value 0 is used.
The server time-out value specifies the time-out time for connection between servers.
If the value 0 is specified, there is no time-out in waiting for a response.
If omitted, the default value 0 is used.
The SERVER section allows multiple definitions.
When the SERVER section contains multiple definitions, the following API checks to see if remote function information is registered in the first-defined SERVER. If it is, that server is used. If it is not, a check is made for registered remote function information in the second SERVER. This is repeated until remote function information is found.
An example of a SERVER section description is shown below.
<SERVER> hostname Host name hostname Host name host name host name port Port number mds_hostname host name mpi_runNoOfCPUs [function name]=number of CPUs gass_scheme [http/https] crypt [false/SSL/GSI] protocol [XML/binary] force_xdr [true/false] jobmanager JOBMANAGER subject "Subject" job_startTimeout Seconds job_stopTimeout Seconds job_maxTime Minutes job_maxWallTime Minutes job_maxCpuTime Minutes job_queue queue name job_project project name job_hostCount Number of nodes job_minMemory Size job_maxMemory Size heartbeat Seconds heartbeat_timeoutCount Times redirect_outerr [true/false] tcp_nodelay [true/false] tcp_connect_retryCount Counts tcp_connect_retryBaseInterval Seconds tcp_connect_retryIncreaseRatio Ratio tcp_connect_retryRandom [true/false] argument_transfer [wait/nowait/copy] compress [raw/zlib] compress_threshold Number of bytes argument_blockSize Number of bytes workDirectory Directory name coreDumpSize Size commLog_enable [true/false] commLog_filePath File name commLog_suffix Suffix commLog_nFiles Number of files commLog_maxFileSize Number of bytes commLog_overwriteDirectory [true/false] debug [true/false] debug_display DISPLAY debug_terminal Command path name debug_debugger Command path name debug_busyLoop [true/false] environment Variable name environment Variable name = value </SERVER> |
The attributes and attribute values of the SERVER section are shown below.
Attribute | Attribute value | Default value | Multiple | Explanation |
---|---|---|---|---|
hostname | Host name | None | Yes | Server machine host name |
port | Port number | 2119 | No | The server port number on which the Globus gatekeeper is listening |
mds_hostname | Host name | None | No | MDS server host name |
mpi_runNoOfCPUs | Function name, Number of CPUs | None | Yes | The number of CPUs used by MPI function |
gass_scheme | [http/https] | http | No | GASS server scheme |
crypt | [false/SSL/GSI] | false | No | Specification of the communication path encryption |
protocol | [XML/binary] | XML | No | Specifies the protocol. |
force_xdr | [true/false] | false | No | Makes XDR compulsory. |
jobmanager | JOBMANAGER | None | No | The job manager used on the server machine |
subject | Subject | None | No | Subject of resource manager contact |
job_startTimeout | Seconds | 0 | No | The time-out at job startup |
job_stopTimeout | Seconds | -1 | No | The time-out for when the job stops |
job_maxTime | Minutes | None | No | The maximum job execution time |
job_maxWallTime | Minutes | None | No | The maximum job execution wall clock time |
job_maxCpuTime | Minutes | None | No | The maximum job execution cpu time |
job_queue | queue name | None | No | A remote queue name |
job_project | project name | None | No | A remote project name |
job_hostCount | Number of nodes | None | No | Number of nodes (for SMP clusters) |
job_minMemory | Size | None | No | Minimum amount of memory, in Megabytes |
job_maxMemory | Size | None | No | Maximum amount of memory, in Megabytes |
heartbeat | Seconds | 60 | No | The heart-beat interval |
heartbeat_timeoutCount | Times | 5 | No | The heart-beat time-out times |
redirect_outerr | [true/false] | true | No | Ninf-G Executable output redirect |
tcp_nodelay | [true/false] | false | No | TCP_NODELAY socket option |
tcp_connect_retryCount | Counts | 4 | No | The maximum number of retries for a TCP connection |
tcp_connect_retryBaseInterval | Seconds | 1 | No | The base interval time for the first retry |
tcp_connect_retryIncreaseRatio | Ratio | 2.0 | No | The increase ratio for calculating the maximum interval time between retries |
tcp_connect_retryRandom | [true/false] | true | No | A flag that specifies whether the random value is used or not for the interval time |
argument_transfer | [wait/nowait/copy] | wait | No | Returns the called function for an asynchronous function call Timing (Wait or do not wait for completion of argument transfer.) |
compress | [raw/zlib] | raw | No | Compression method |
compress_threshold | Number of bytes | 64KBytes | No | Threshold for performing compression |
argument_blockSize | Number of bytes | 16KBytes | No | The block size of transferred arguments |
workDirectory | Directory name | The path to the Ninf-G Executable | No | The working directory for Ninf-G Executable |
coreDumpSize | Size | Undefined | No | Core dump size for Ninf-G Executable |
commLog_enable | [true/false] | false | No | Whether the communication log output is enabled or disabled |
commLog_filePath | File name | stderr | No | Communication log file name |
commLog_suffix | Suffix | Sequence number | No | The communication log file suffix |
commLog_nFiles | Number of files | 1 | No | The number of files for communication log output |
commLog_maxFileSize | Number of bytes | 1M/unlimited | No | Maximum number of bytes for the communication log file |
commLog_overwriteDirectory | [true/false] | false | No | Overwrite permission for the communication log directory |
debug | [true/false] | false | No | Whether the debugging function is enabled or not |
debug_display | DISPLAY | Environment variable | No | Debugging display |
debug_terminal | Command path name | Environment variable | No | Path to the debugging terminal emulator |
debug_debugger | Command path name | Environment variable | No | Debugger path |
debug_busyLoop | [true/false] | false | No | Wait attach from debugger or not |
environment | Character string | None | Yes | Environment variable |
This specifies the host name of the server machine.
Multiple hostname attributes can be defined.
It is possible for multiple host names to be defined on one line.
This value cannot be omitted.
This specifies the port number on the Globus gatekeeper is listening.
If omitted, the default '2119' value is used.
This is the MDS queried first when querying for information concerning the MPI of the server machine and remote function information. This specifies the host name of the server.
This specifies the path to the MPI command when MPI is used on the server machine.
This specifies the number of CPUs for when MPI is used on the server machine.
The number of CPUs for executing particular functions can be specified with the format "function name = number of CPUs".
If the function name is omitted, the default value for the number of CPUs for MPI on that server machine is used.
This specifies the scheme for the GASS server.
If omitted, http is used.
This specifies whether an SSL encrypted communication path or an unencrypted path is used for communications between a Ninf-G Client and Ninf-G Executable.
If omitted, the unencrypted communication path is used.
This specifies the protocol between a Ninf-G Client and Ninf-G Executable. Either XML or binary can be specified.
If omitted, the XML is used.
This specifies whether or not to force the use of XDR in the protocol between a Ninf-G Client and Ninf-G Executable.
If XML is used as the protocol, this setting has no effect. The main purpose of using this is for measurement of processing speed when XDR is used.
If omitted, the default value 'false' is used.
This specifies the job manager to be used on the server machine. Any of jobmanager-fork, jobmanager-pbs, jobmanager-gdr or jobmanager-lsf can be specified, depending on the server machine settings.
If omitted, the default job manager on the server machine is used.
This specifies the subject part of the Globus Toolkit GRAM resource manager contact. The subject are usually used for the Globus personal gatekeeper.
If the value are quoted by double-quote character ("), the value can include the space character, like "/C=JP/O=EXAMPLE/OU=GRID/CN=Example of Subject".
If omitted, no values is used.
This specifies the time-out time for job startup.
When grpc_call(), grpc_invoke_np() or other such RPC is executed, if the job has not started after this time has passed since the job start request was issued, a time-out occurs; each API ends and returns an error.
If the 0 value is specified, there is no time-out and the process waits until the job starts. If a value of 1 or greater is specified, the process waits that amount of time for the job to start. If a negative value is specified, an error results.
If omitted, the 0 value is used.
When grpc_function_handle_destruct(), grpc_object_handle_destruct() or other such job stop request is issued by the API, if the job has not stopped after this time elapses, a time-out occurs; each API ends and returns an error.
If a negative value is specified, there is no time-out and the process waits until the job stops. If the 0 value is specified, the process doesn't wait the job to stop. If a value of 1 or greater is specified, the process waits that amount of time for the job to stop.
If omitted, the -1 value is used.
Note: This attribute is changed on Ninf-G version 2.4.0.
In Ninf-G version 2.3.0 or former:
If the 0 value is specified, there is no time-out and the process
waits until the job stops. If a negative value is specified, an
error results.
This specifies the maximum job execution time. The value specified is used to pass Globus GRAM RSL attribute "maxTime". The units is in minutes.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.2.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.2.0, or use later version.
This specifies the maximum job execution wall clock time. The value specified is used to pass Globus GRAM RSL attribute "maxWallTime". The units is in minutes.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.2.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.2.0, or use later version.
This specifies the maximum job execution cpu time. The value specified is used to pass Globus GRAM RSL attribute "maxCpuTime". The units is in minutes.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.2.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.2.0, or use later version.
Target the GRAM job to a queue (class) name as defined by the scheduler at the defined (remote) resource.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.0.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.0.0, or use later version.
Target the GRAM job to be allocated to a project account as defined by the scheduler at the defined (remote) resource.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.0.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.0.0, or use later version.
Defines the number of nodes (hosts) to distribute the Ninf-G Executable processes created by handle array init API across. This attribute is only applies to clusters of SMP computers.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.0.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.0.0, or use later version.
Note: There is a BUG of jobmanager-pbs, so jobmanager-pbs doesn't work with this attribute variable.
Specify the minimum amount of memory required for Ninf-G Executable process. Units are in Megabytes.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.0.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.0.0, or use later version.
Specify the maximum amount of memory required for Ninf-G Executable process. Units are in Megabytes.
If omitted, no values are used.
Note: This attribute is not appeared in Ninf-G version 2.0.0. If you want to use this attribute, apply the patch for this attribute into Ninf-G version 2.0.0, or use later version.
This specifies the interval for sending the heart-beat from Ninf-G Executable to Ninf-G Client.
If the value 0 is specified, the heart-beat is not sent. If a value of 1 or greater is specified, the heartbeat is sent at that interval. If a negative value is specified, an error results.
If omitted, the value 60 is used.
Note: heartbeat checking on client program feature is supported only in pthread version. heartbeat sending on Ninf-G Executable feature is supported both pthread version and non-thread version of Globus Toolkit flavor.
Note: If you debugging Ninf-G Executable or client, I suggest that, you disable heartbeat feature. For to suppress periodic heartbeat work and unexpected heartbeat timeout.
This specifies the number of times until a time-out occurs when the heart-beat is not being sent.
When the heartbeat has not been sent for a time equal to the heart-beat interval times the heart-beat time-out value, the Ninf-G Client takes it as meaning that the Ninf-G Executable is also not operating.
If omitted, the value 5 is used.
This specifies redirection of the standard error or standard output of a Ninf-G Executable to a Ninf-G Client.
If omitted, the value 'true' is used.
Note: If save_stdout or save_stderr attribute on the server side configuration file is set, stdout or stderr is not delivered to the Ninf-G Client regardless of the value of redirect_outerr.
This specifies whether or not to set TCP_NODELAY for both ends of connections between a Ninf-G Client and Ninf-G Executables.
If omitted, "false" is used.
Note: Setting this attribute to true is not available with Globus Toolkit 3 (probably).
Note: There are the following report from users.
"If the size of arguments or results is less than 1.5KB, performance of data transfer is improved by setting tcp_nodelay to true."
This specifies the maximum number of retries for establishing a TCP connection. This attribute is used for the following cases.
The default value of this attribute is 4.
Note: Ninf-G 2.3.0 and prior versions do not support this attribute. In order to disable this attribute, set tcp_connect_retryCount to 0 if the version of Ninf-G on the server is 2.3.0 or prior.
This specifies the base interval time for the first retry. The value is in second and must be a non-negative integer. This value is used as the maximum interval time for the first retry.
The default value of this attribute is 1.
This specifies the increase ratio which is used to calculate the maximum interval time between retries. The maximum interval time is calculated by multiplying this value and the maximum interval time for the last retry. For the first retry, the value of tcp_connect_retryBaseInterval is used as the maximum interval time.
The value must be greater than 1.0 and the default value of this attribute is 2.0.
This specifies a flag that specifies whether the random value is used or not for the interval time. If the value is true, interval time between retries is set randomly between 0.0 second to the maximum interval time. If the value is false, the maximum interval time is used as interval time.
The default value of this attribute is true.
When an asynchronous call function is used, this specifies the timing for that function's return.
The values that can be specified are 'wait' (wait until argument transfer is completed), 'nowait' (do not wait until argument transfer is completed), and 'copy' (without waiting for the completion of argument transfer, the values of the arguments passed to the asynchronous function are copied on the client side, and the argument transfer is done in the background).
If omitted, 'wait' is used.
This specifies the method for compressing the argument information. Either 'raw' or 'zlib' can be specified.
If omitted, 'raw' is used.
This specifies the threshold value for when compression is performed. If the argument information size equals or exceeds the specified value, the information is compressed.
If omitted, the value of 64 kilobytes is used.
Arguments and results are divided into specified block size, when they are transferred between Ninf-G Client and Ninf-G Executable.
The value of this attribute affect the performance of data transfer and appropriate value should be specified according to the size of the transferred data and network performance.
If 0 is specified, arguments and results will not be divided. If a positive integer is specified, they are divided into blocks with the specified value. An error occurs if a negative value is specified.
If omitted, the default value 16Kbytes is used.
This specifies the working directory for Ninf-G Executable.
If omitted, no changing directory was made when staging function was used, other case, Ninf-G Executable path was used for working directory.
This specifies the core dump file size for Ninf-G Executable. The size is 1024-byte increments.
If 0 was specified, it means no core dump file was created. If -1 was specified, it means core dump file size is unlimited and infinite.
If omitted, No setup for core dump file size was performed.
This specifies whether the communication log output function is enabled or disabled.
If 'true' is specified, the communication log is output.
If not specified, the default value is false.
The name of the file to which the communication log is output is specified in the log file name.
The file name may include a path that includes a directory (e.g., "/home/myHome/var/logFile").
The file and directory name can include the following specifiers.
"%t" is replaced with the date as year, month and day, and the time in hours, minutes, seconds and milliseconds ("yyyymmdd-hhmmss-MMM") (e.g., "/ home/myHome/var/logDir%t/logFile" is replaced by "/home/myHome/var/logDir20030101-154801-123/logFile").
"%h" is replaced with the Ninf-G Client hostname.
"%p" is replaced with the process id of Ninf-G Client.
The Ninf-G Executable id number is added to the end of the file name.
When omitted, the log is output to standard error. If the communication log file name is omitted, the commLog_suffix, commLog_nFiles and commLog_maxFileSize are ignored.
When the communication log file is specified, this specifies the suffix for when the log file is created.
If a suffix is specified, the generated file name will be from "filename[000].suffix" to "filename[nnn].suffix". If omitted, the generated file name will be from "filename.[000]" to "filename.[nnn]". The number of files minus 1 is "nnn". The number of digits in "nnn" is the same as the number of digits in number of files minus 1. For example, if the number of files is set to 100, then the number will range from "00" to "99".
This is the number of files created for communication log output.
0 indicates to output unlimited number of files. An negative value results in an error.
If omitted, the value 1 is used.
This specifies the maximum number of bytes for the communication log file.
If omitted, the value will be unlimited if the number of files is one, or 1Mbyte if the number of files is two or more.
This establishes overwrite permission for the directory. If the specified directory exists, this specifies whether creation of log files in that directory is enabled or disabled. The operation in the case that the directory exists is shown below.
This specifies whether the debugging function is enabled or disabled.
If 'true' is specified, the debugger will be started up when the Ninf-G Executable starts up, allowing debugging of the Ninf-G Executable. If 'false' is specified, Ninf-G Executable starts up without starting the debugger.
If omitted, the default 'false' value is used.
This specifies an X11 display for displaying the debugging terminal emulator.
To use the debugger, start up the terminal emulator on the server machine, and run the debugger on that terminal. This defines the value for the environment variable DISPLAY that is passed to the terminal emulator.
This specifies the path to the terminal emulator command.
If omitted, the value 'xterm' is used. Ninf-G Executable searches terminal emulator command in PATH that is set in the Ninf-G operating environment on the server machine is used.
This specifies the path to the debugger command.
If omitted, the value 'gdb' is used. Ninf-G Executable searches debugger command in PATH that is set in the Ninf-G operating environment on the server machine is used.
This specifies whether the Ninf-G Executable perform waiting attach from debugger or not.
If 'true' is specified, the Ninf-G Executable waits attaching from debugger, just after its invocation.
The user need to invoke debugger and attach that Ninf-G Executable. Then user must change variable for attach waiting (debugBusyLoop), and continue execution. (When user uses gdb, try "set var debugBusyLoop=0", "continue".)
If omitted, the default 'false' value is used.
Note: It's very helpful to specify this attribute with "environment NG_LOG_LEVEL=4" in the SERVER section. which displays which process id must be attached.
The environment variable specifies the environment variable that is passed to Ninf-G Executable. It can be written as 'variable name' only or 'variable name = value'.
If omitted, the environment variable is not used.
The SERVER_DEFAULT section does not allow multiple definitions. This section may be omitted.
The SERVER_DEFAULT section defines the default values for attributes which are used when attributes are omitted in the SERVER section.
The description of the SERVER_DEFAULT section is the same as the SERVER section, except that the attribute "hostname" is not described.
The SERVER_DEFAULT section may also be described in the configuration file or other such place. (*)
(*) For example, even if the SERVER_DEFAULT section is written later than the SERVER section, if attributes are omitted in the previously described SERVER section, the attributes defined in the SERVER_DEFAULT section are used.
% grid-proxy-init
./test_client [args ...]
Ninf-G supports the GridRPC API for C and Java.
In this section, the flow of an application program (written in C) for using GridRPC is described and a few typical GridRPC API functions are introduced.
Of the functions described here, those that contain *_np are not included in the GridRPC API standard (i.e., they are specific to Ninf-G).
A full list of the GridRPC APIs and detailed explanation of each API can be found in chapter 7, "API Reference".
The typical flow of an application program for using GridRPC is as follows.
The functions used in the above processes are described below.
The following function is used for initialization.
grpc_error_t grpc_initialize(char *configFile)
This function accepts the name of the configuration file as an argument, reads the file named by the argument, analyzes the content, and saves the values.
If the argument value is NULL, the file specified by the NG_CONFIG_FILE environment variable is taken to be the configuration file.
As the return value, an error status code is returned to inform of failure to read the configuration file or failure to save the values that were read.
An example of using grpc_initialize() is given below. (In this example, the configuration file name is taken from the command line argument and that value is used as the argument.)
|
In GridRPC, "handles" are used when performing operations such as executing remote functions and remote methods. A handle must be created before executing a remote function or remote method, but the type of handle to create differs with the type of Ninf-G Executable used.
If only one remote function is defined for the Ninf-G Executable used, a "function handle" is used; if multiple remote methods are defined, an "object handle" is used.
Functions for creating both kinds of handles are shown below.
grpc_error_t grpc_function_handle_init(grpc_function_handle_t *handle,
char *server_name,
char *func_name)
grpc_error_t grpc_object_handle_init_np(grpc_object_handle_t_np *handle,
char *server_name,
char *class_name)
These functions accept a 'server name' and 'function or class name', and creates a handle for operating the specified Ninf-G Executable on the specified server.
As the return value, an error code is returned to inform of failure to create the handle.
For example, a function handle is created as follows.
|
The following functions for creating multiple handles at one time are also provided by Ninf-G. (See Section 7 for details)
grpc_function_handle_array_init_np()
grpc_object_handle_array_init_np()
The handle just created can be used to call the specified remote function or remote method on the server. When the call is made, the value of the argument defined by the Ninf-G IDL must be passed.
The functions for calling a function differ for a function handle and an object handle. When calling a remote method with an object handle, the name of the remote method must be specified.
Remote functions and remote methods can be called in two ways, with a 'synchronous call' and with an 'asynchronous call'.
The synchronous call does not return until the execution of the remote function or remote method is completed.
The asynchronous call returns either at the beginning or at the completion of sending the arguments to the remote function or remote method; it then waits for the completion of the remote function or remote method to obtain the result. (The return timing of the function that makes the asynchronous call can be specified in the configuration file.)
Functions for making remote functions and remote methods calls of the synchronous type are shown below.
grpc_error_t grpc_call(grpc_function_handle_t *handle, ...)
grpc_error_t grpc_invoke_np(grpc_object_handle_t_np *handle,
char *method_name, ...)
These functions accept the handle and the parameter values to be passed to the remote function or remote method (the remote method name also, in the case of the grpc_invoke_np() function), execute the computation by the specified remote function or remote method, and return as soon as the computation is completed.
As the return value, an error status code is returned to inform when the execution of the remote function or remote method fails.
For example, a call to a remote function or remote method defined in the IDL below is made in the form of grpc_call() below.
|
|
Functions for making remote functions and remote methods calls of the asynchronous type are shown below.
grpc_error_t grpc_call_async(grpc_function_handle_t *handle,
grpc_sessionid_t *session_id, ...)
grpc_error_t grpc_invoke_async_np(grpc_object_handle_t_np *handle,
char *method_name,
grpc_sessionid_t *session_id, ...)
These functions accept the handle and the parameter values to be passed to the remote function or remote method (remote method name also, in the case of the grpc_invoke_np() function), issue a request for computation to the specified remote function or remote method, and return when the transmission of arguments begins or when it ends (which can be set in the configuration file).
If successful, GRPC_NO_ERROR is returned. In the case of an error, Error code is returned.
The returned session ID is used when waiting for the execution results or for other such purposes.
Functions for waiting for the completion of the computation for an asynchronous call are shown below. All of these functions return an error status code to inform of cases in which execution of the session fails.
grpc_error_t grpc_wait(grpc_sessionid_t session_id)
This waits for completion of the session specified by the session ID passed in the argument and returns when the session ends.
grpc_error_t grpc_wait_any(grpc_sessionid_t *id)
This waits for completion of any of the current sessions and returns when the session ends.
grpc_error_t grpc_wait_and(
grpc_sessionid_t *sessions, size_t length)
Waits for completion of all of the sessions specified by the array of session IDs and returns when they end.
grpc_error_t grpc_wait_or(
grpc_sessionid_t *sessions, size_t length, grpc_sessionid_t *id)
Waits for completion of any of the sessions specified by the array of session IDs and returns when one of them ends.
grpc_error_t grpc_wait_all()
This waits for completion of all of the current sessions and returns when they all have ended.
For releasing resources, the unnecessary "handles" must be destructed. The function for destructing differs with the type of "handles".
Functions for destructing handles are shown below.
grpc_error_t grpc_function_handle_destruct(
grpc_function_handle_t *handle)
grpc_error_t grpc_object_handle_destruct_np(
grpc_object_handle_t_np *handle)
These functions destruct the specified handle.
As the return value, an error status code is returned to inform of failure to destruct the handle.
If two or more handles were created at once, then the following functions for destructing multiple handles at one time must be used.
grpc_function_handle_array_destruct_np()
grpc_object_handle_array_destruct_np()
The following function is used to perform the termination processing.
grpc_error_t grpc_finalize()
This function executes the processing for when Ninf-G is terminated.
The return value is an error status code to inform when the termination processing fails.
The API that provides capabilities that have been added in Ninf-G v2 is described below.
When callback is used, "a function that has both the same name as the name of the callback type argument described in the Ninf-G IDL and the same arguments" must be defined and implemented in the application program.
Below is an application program that corresponds to the callback example that appears in chapter 3, "Creating and setting up server-side programs"(section 3.1). (Ninf-G Executable and Ninf-G Client exchange status values)
Note: The maximum number of the parameter which can be defined as callback function is 6.
|
A function for checking the status of a session is shown below.
grpc_error_t grpc_get_info_np(grpc_sessionid_t session_id,
grpc_exec_info_t_np *info, int *status)
This checks the status of the session that corresponds to the session ID specified in the argument.
When the heartbeat is not obtained normally, GRPC_SESSION_DOWN is returned as the 3rd argument of this function. If an error has occurred, the error code is returned.
A function for canceling a session is shown below.
grpc_error_t grpc_cancel(grpc_sessionid_t session_id)
This checks the status of the session that corresponds to the session ID specified in the argument.
An error code is returned as the return value to inform that an error has occurred.