2.10 Environment Variable

Shell environment variable can be set in MCMD to customize the settings for commands. The environment variables that can be set for MCMD are listed in Table 2.5.

Table 2.5: List of the environment variable to configure KGMOD

Variable name

Default value

Description

KG_iSize

4096000

Size of data read for each time

   

Four times of KG_iSize is allocated for input buffer.

   

However, 10 times of the command parameters is allocated for kgsortf.

   

Refer to KG_BlockCount for command’s buffer size on processing by key block.

   

The following conditions must be satisfied.

   

KG_iSize=KG_MaxRecLen$*$i (given i is an integer greater than 1)

   

KG_iSize$\ge $KG_MaxRecLen$*$2

KG_oSize

2048000

Size of data written for each time

   

The same memory size in KG_oSize is allocated for output buffer.

   

KG_oSize=KG_MaxRecLen$*$i (given i is an integer greater than 1)

   

KG_oSize$\ge $KG_MaxRecLen$*$2

KG_MaxRecLen

1024000

The maximum number of characters per row (maximum:10240000)

   

It must satisfy the conditions shown in KG_iSize and KG_oSize.

KG_BlockCount

128

The number of buffers required when processing$^{1)}$ by key.

   

The column KG_iSize shows buffer size$*$KG_BlockCount is allocated.

   

KG_MaxRecLen $*$2 + 4$*$ KG_ioSize) $*$ KG_BlockCount

KG_TmpPath

/tmp

The directory of temporary files in the default directory used by library functions.

KG_Precision

10

Significant figures

KG_VerboseLevel

4

Output error message for M-Command

   

0: Do not print any messages.

   

1: + error message output

   

2: + warning message output

   

3: + end message output

   

4: + msg message output (default)

Note 1) Processing by key, such as mnjoin, refers to reading data with same key into the memory at once. Refer to the manual of corresponding command for more details.

Below is an example of changing the settings of KG_VerboseLevel to control the command message.

Examples

Example 1: End message

The default setting of output message is set as KG_Verbose=4 which displays a message when the program finished processing normally or terminates upon an error.

$ more dat.csv
k,v
A,1
B,2
$ mcut f=k,v i=dat.csv o=out.csv
#END# kgcut f=k,v i=dat.csv o=out.csv
$ mcut x=k,v i=dat.csv o=out.csv
#ERROR# unknown parameter x= (kgcut)

Example 2: Only display error messages

If KG_Verbose=1, the stop error message is displayed, but not the normal exit message.

$ export KG_VerboseLevel=1
$ mcut f=k,v i=dat.csv o=out.csv
$ mcut x=k,v i=dat.csv o=out.csv
#ERROR# unknown parameter x= (kgcut)

Example 3: Do not display any messages

If KG_Verbose=0, no message will be displayed.

$ export KG_VerboseLevel=0
$ mcut f=k,v i=dat.csv o=out.csv
$ mcut x=k,v i=dat.csv o=out.csv