The following kinds of information are described with IDL.
The following is a sample of IDL for implementing matrix multiplication. For detailed Ninf-G IDL specifications, see chapter 6, "Ninf-G IDL Specifications".
|
The following is an example of a "callback", that can be described with Ninf-G IDL.
|
Note: You may find some compiler warnings when you compile Callback function, but they are harmless. For example, following compiler warning is output by Solaris/vendor-cc.
"warning: old-style declaration or incorrect type for: callback_test"
The required remote functions and remote methods (those called in the IDL) must be implemented (in C or FORTRAN).
The source code (C) for the mmul() function used in the Ninf-G IDL sample shown above is presented below.
|
Note: Implementing cancel processing
When implementing processing for canceling a session, call grpc_is_canceled_np() in the Ninf-G Executable Library API from within a remote function or remote method and check the return value. Coding for performing session cancel processing if the return value is 1 is needed.
|
% ${NG_DIR}/bin/ng_gen
Executing the above command generates the following.
The makefile generated by the stub generator is used to execute the make command.
% make -f <module_name>.mak
An executable Ninf-G Executable is generated.
(The following tasks are not necessary if MDS is not being used. The Ninf-G Executable information can be acquired without MDS by using the Ninf-G Executable path information that is contained in the local LDIF file on the client side or in the Ninf-G Client configuration file.)
The LDIF file generated by the stub generator is copied to $GLOBUS_LOCATION/var/gridrpc.
% make -f <module_name>.mak install
The content of the copied LDIF file is shown below.
|
Note: Copying the LDIF file to the prescribed location as above enables provision of Ninf-G Executable information by MDS.
Ninf-G provides utility commands (described below) for managing the Ninf-G Executable information supplied by MDS. Details on the commands can be found in chapter 8, "Utility Command Reference".
Prepared according to the need for a configuration file for adjusting the location of the temporary files generated during filename type argument processing and for the log output.
Written in ${GLOBUS_LOCATION}/var/gridrpc/ngstub.conf.
Write ".ngstubrc" in the user's home directory.
If the system settings and user settings described above both have the same setting items, the user settings have priority.
The Ninf-G Executable configuration file is a text file which contains the settings information that is required for operation of Ninf-G Executable.
An example of entries in the Ninf-G Executable configuration file is shown below.
#comment attribute value # comment attribute value # comment attribute value # comment ... |
The following description produces an error.
AttributeValue # No delimiter between attribute and attribute value Attribute Value Attribute Value # Multiple attributes on a line Attribute Value # attribute value extend across more than one line Attribute # No attribute value tmp_dir /tmp tmp_dir /var/tmp # Overlapping of the attribute values of an attribute # that can not have multiple definitions |
The attributes and their attribute value definitions are listed below.
tmp_dir Directory loglevel [0-5] loglevel_globusToolkit [0-5] loglevel_ninfgProtocol [0-5] loglevel_ninfgInternal [0-5] log_filePath File name log_suffix Suffix log_nFiles Number of files log_maxFileSize Number of bytes log_overwriteDirectory [true/false] commLog_enable [true/false] commLog_filePath PathFile name commLog_suffix Suffix commLog_nFiles FilesNumber of files commLog_maxFileSize FileSizeNumber of bytes commLog_overwriteDirectory [true/false] save_stdout File name save_stderr File name handling_signals Signals ... continue_on_error [true/false] |
The definable attributes and attribute values are listed below.
Attribute | Attribute value | Default value | Multiple | Explanation |
---|---|---|---|---|
tmp_dir | For temporary files | /tmp | Not possible | The directory in which temporary files are placed Directory |
loglevel | [0-5] | 2 | Not possible | Overall log level |
loglevel_globusToolkit | [0-5] | 2 | Not possible | Error generated by the Globus Toolkit API |
loglevel_ninfgProtocol | [0-5] | 2 | Not possible | Error concerning the Ninf-G protocol |
loglevel_ninfgInternal | [0-5] | 2 | Not possible | Internal Ninf-G error |
log_filePath | File name | stderr | Not possible | Log file name |
log_suffix | Suffix | Sequence number | Not possible | Log file suffix |
log_nFiles | Number of files | 1 | Not possible | Number of log output files |
log_maxFileSize | Number of bytes | 1M/unlimited | Not possible | Maximum number of bytes for log file |
log_overwriteDirectory | [true/false] | False | Not possible | Over-write permission for log directory |
commLog_enable | [true/false] | False | Not possible | Communication log output enabled/disabled |
commLog_filePath | File name | stderr | Not possible | Communication log file name |
commLog_suffix | Suffix | Sequence number | Not possible | Communication log file suffix |
commLog_nFiles | Number of files | 1 | Not possible | Number of files for outputting communication log |
commLog_maxFileSize | Number of bytes | 1M/unlimited | Not possible | Maximum number of bytes for communication log file |
commLog_overwriteDirectory | [true/false] | False | Not possible | Over-write communication log directory enabled/disabled Permitted |
save_stdout | File name | None | Not possible | Save stdout to file |
save_stderr | File name | None | Not possible | Save stderr to file |
handling_signals | Signal names/numbers | SIGHUP SIGINT SIGTERM | Not possible | Handling signals |
continue_on_error | [true/false] | False | Not possible | continue computation if an error occurs |
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. |
The directory in which temporal files are placed for passing the filename type arguments to a remote method.
When omitted, if TMPDIR environment variable is defined, it is used; otherwise, "/tmp" is used.
The log level is specified for all log categories by loglevel 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 the NG_LOG_LEVEL environment variable is used.
If the 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 Executable hostname.
"%p" is replaced with the process id of the Ninf-G Executable.
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 log file name is omitted, the log_suffix, log_nFiles, and log_maxFileSize are ignored.
Note: When the Ninf-G Executable exits abnormally on startup, the executable id is not added and the hostname and process id are added to the end of the file name.
When a log file is specified, this specifies the suffix used 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 that an unlimited number of files can be output. A negative value results in an error.
If omitted, the value 1 is used.
This is the maximum number of bytes for the log file. A unit indicator from among "kKmMgG" can be appended to the numerical value to indicate Kilobytes (1024 bytes), Megabytes (1024 Kbytes), or Gigabytes (1024 Mbytes).
If omitted, the value will be unlimited if the number of files is one, or 1 Mbyte 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.
Operation in the case that the directory exists is shown below.
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 Executable hostname.
"%p" is replaced with the process id of the Ninf-G Executable.
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 used 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 the 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 an unlimited number of files can be output. A 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. A unit indicator from among "kKmMgG" can be appended to the numerical value to indicate Kilobytes (1024 bytes), Megabytes (1024 Kbytes), or Gigabytes (1024 Mbytes).
If omitted, the value is either unlimited if the number of files is one or 1 Mbyte 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. Operation in the case that the directory exists is shown below.
This specifies the file name to save stdout.
If this attribute is set, stdout is saved to the specified file.
If the given file name for both save_stdout and save_stderr attribute is the same, output is shared to one file in arbitrary order.
The output file is opend by append mode.
If omitted, stdout output is delivered to Ninf-G Client or discarded.
This specifies the file name to save stderr.
If this attribute is set, stderr is saved to the specified file.
If the given file name for both save_stdout and save_stderr attribute is the same, output is shared to one file in arbitrary order.
The output file is opend by append mode.
If omitted, stderr output is delivered to Ninf-G Client or discarded.
This attribute specifies signals which will be caught by Ninf-G Executable.
When the Ninf-G Executable catches the signal, Ninf-G cleans up all temporary files, and exits. This clean up process is performed only for signals which are specified in this attribute.
The signals are specified by either signal name or signal number. Multiple signals can be specified by space-delimited enumeration. The value "none" can be specified if no signals need to be caught.
If ommitted, SIGINT, SIGTERM and SIGHUP will be caught by Ninf-G Executable.
Note: This attribute is available for Ninf-G Version 4.2.0 or later.
This attribute is used to control behaviors of a Ninf-G Executable when a communication error occurs. Such a communication includes explicit one (e.g. data transfer) as well as implicit one (e.g. heartbeating).
If the value is set to 'false', which is the default value, the Ninf-G Executable immediately exits from its execution when a communication error occurs. This enables Ninf-G Executables to release computing resources immediately after the error. It is also useful to avoid Ninf-G Executables remaining as zombie processes when the Ninf-G Client would die.
If the value is set to 'true', a Ninf-G Executable does not exit and continues to run until the callee function or method will be completed. This configuration is valuable if the callee functions and methods record results of the computation as files in the server machines. In this case, it may be worth to continue the execution of the Ninf-G Executable even if a communication error occurs.
If omitted, the value 'false' is used.
Note: Even if the value is set to true, Ninf-G Executables may exit by catching signals from queueing system like SGE or PBS, when the Ninf-G Client was killed by SIGHUP, SIGINT or SIGTERM signal.
Note: In order for Ninf-G Executables to detect an error immediately when the connection to the Ninf-G Client was closed, Ninf-G Executables must be linked with the pthread flavor of the Globus Toolkit libraries.