Matrix Science header
Public Types | Public Member Functions

ms_clusterparams Class Reference
[Mascot configuration files module]

An instance of this class represents all the parameters specified in the Cluster section of mascot.dat. More...

#include <ms_clusterparams.hpp>

Inheritance diagram for ms_clusterparams:
Inheritance graph
[legend]
Collaboration diagram for ms_clusterparams:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { NUM_PROCESSORS_AUTO_DETECT = -1 }
 

Value used to indicate that the number of processors in the first SubClusterSet should be automatically determined at runtime.

More...

Public Member Functions

 ms_clusterparams ()
 Default constructor.
 ms_clusterparams (const ms_clusterparams &src)
 Copying constructor.
 ~ms_clusterparams ()
 Destructor.
void appendSubCluster (const int id, const int maxCPUs)
 Add a new SubClusterSet entry.
void clearSubClusters ()
 Erases information about all sub clusters.
void copyFrom (const ms_clusterparams *right)
 Can be used to create a copy of another object.
void defaultValues ()
 Initialises the instance with default values.
int getCheckNodesAliveFreq () const
 Returns the value of CheckNodesAliveFreq.
std::string getDefaultNodeHomeDir () const
 Returns the value of DefaultNodeHomeDir.
std::string getDefaultNodeHomeDirFromMaster () const
 Returns the value of DefaultNodeHomeDirFromMaster.
OPERATING_SYS getDefaultNodeOS () const
 Returns value of DefaultNodeOS as one of the enumeration members.
int getDefaultPort () const
 Returns the value of DefaultPort.
std::string getIPCLogfile () const
 Returns the value of IPCLogfile.
int getIPCLogging () const
 Returns value of IPCLogging.
int getIPCTimeout () const
 Returns the value of IPCTimeout.
std::string getMascotNodeRebootScript () const
 Returns the value of MascotNodeRebootScript.
std::string getMascotNodeScript () const
 Returns the value of MascotNodeScript.
const ms_computeraddressgetMasterComputer () const
 Returns an instance of ms_computeraddress created for MasterComputerName.
std::string getNodeSequenceDatabaseDir () const
 Returns the value of NodeSequenceDatabaseDir.
int getNumberOfSubClusters () const
 Returns the number of SubClusterSet parameter entries, which is a total number of sub-clusters.
std::string getPreceedingComments () const
 Returns any comments preceeding the section.
int getSecsToWaitForNodeAtStartup () const
 Returns the value of SecsToWaitForNodeAtStartup.
int getSubClusterID (const int index) const
 Returns sub-cluster ID by its index.
int getSubClusterMaxCPU (const int index) const
 Returns the Y part of SubClusterSet.
bool isEnabled () const
 Returns TRUE if Enabled parameter is set to 1 and FALSE otherwise.
bool isSectionAvailable () const
 Check whether the section has been actually read from the file.
ms_clusterparamsoperator= (const ms_clusterparams &right)
 Assignment operator for C++ client applications.
void setCheckNodesAliveFreq (const int value)
 Change CheckNodesAliveFreq.
void setDefaultNodeHomeDir (const char *str)
 Change DefaultNodeHomeDir.
void setDefaultNodeHomeDirFromMaster (const char *str)
 Change DefaultNodeHomeDirFromMaster.
void setDefaultNodeOS (const OPERATING_SYS value)
 Change DefaultNodeOS.
void setDefaultPort (const int value)
 Change DefaultPort.
void setEnabled (const bool flag)
 Change Enabled.
void setIPCLogfile (const char *str)
 Change IPCLogfile.
void setIPCLogging (const int value)
 Change IPCLogging.
void setIPCTimeout (const int value)
 Change IPCTimeout.
void setMascotNodeRebootScript (const char *str)
 Change MascotNodeRebootScript.
void setMascotNodeScript (const char *str)
 Change MascotNodeScript.
void setMasterComputer (const ms_computeraddress *value)
 Change MasterComputerName.
void setNodeSequenceDatabaseDir (const char *str)
 Change NodeSequenceDatabaseDir.
void setPreceedingComments (const std::string &comments)
 Sets any comments preceeding the section.
void setSecsToWaitForNodeAtStartup (const int value)
 Change SecsToWaitForNodeAtStartup.
void setSectionAvailable (const bool value)
 Change availability of the section, i.e. if it should be saved in a file.

Detailed Description

An instance of this class represents all the parameters specified in the Cluster section of mascot.dat.

An instance of this class is created and polulated in ms_datfile. It can also be created separately and initialized with default values. One can create an instance of the class or copy from another instance in order to pass it then as an parameters-containing object. For detailed information on any of the options please consult Mascot manual.

Also get yourselves acquainted with the base class ms_customproperty. It facilitates the following tasks:

More functionality is described in the documentation for ms_customproperty.

Examples:

config_mascotdat.cpp.


Member Enumeration Documentation

anonymous enum

Value used to indicate that the number of processors in the first SubClusterSet should be automatically determined at runtime.

The value assigned will be identical to the number of 'processors' licensed.

See also:
getSubClusterMaxCPU().

(Defined as an enum rather than static const int to support VC6)

Enumerator:
NUM_PROCESSORS_AUTO_DETECT 

Value used to indicate that the number of processors in the first SubClusterSet should be automatically determined at runtime.


Member Function Documentation

void appendSubCluster ( const int  id,
const int  maxCPUs 
)

Add a new SubClusterSet entry.

See getNumberOfSubClusters() for more information.

Parameters:
idunique ID identifying a sub-cluster (from 0 to 49) to set number of CPUs for.
maxCPUsmaximum number of CPUs for the specified sub-cluster (from 0 to 1024*64).
void clearSubClusters (  )

Erases information about all sub clusters.

One entry (0,0) for "this subcluster" stays in the list forever.

int getCheckNodesAliveFreq (  ) const

Returns the value of CheckNodesAliveFreq.

The CheckNodesAliveFreq parameter specifies the interval in seconds between 'health checks' on the nodes. Default value is 30 sec.

Returns:
Frequency to check if nodes are alive
std::string getDefaultNodeHomeDir (  ) const

Returns the value of DefaultNodeHomeDir.

If no specific home directory is specified for a particular node in nodelist.txt, then the value of the DefaultNodeHomeDir parameter is used. To override this setting for a particular node, enter the directory on the node line in nodelist.txt.

Default is the /MascotNode folder.

See also:
getDefaultPort()
Returns:
Default node home directory
std::string getDefaultNodeHomeDirFromMaster (  ) const

Returns the value of DefaultNodeHomeDirFromMaster.

This is the directory on the node as seen from the master. For a Windows cluster, this must be present and specified as a UNC name. For a Unix cluster, this parameter must be commented out.

Default is

\\<host_name>\c$\mascotnode 
Returns:
Default node home directory from master
OPERATING_SYS getDefaultNodeOS (  ) const

Returns value of DefaultNodeOS as one of the enumeration members.

If no OS is defined for a particular node, then this parameter value is assumed as the OS. See OPERATING_SYS for a list of possible values.

Default is _OS_WINDOWS_NT (2).

Returns:
Default node OS
int getDefaultPort (  ) const

Returns the value of DefaultPort.

If no port number is specified for a node in nodelist.txt, then this port number will be used.

Default is 5001.

See also:
getDefaultNodeHomeDir()
Returns:
Default port
std::string getIPCLogfile (  ) const

Returns the value of IPCLogfile.

The IPCLogfile parameter specifies a relative path to the inter-process communication log file.

Default is ../logs/IPC.log.

See also:
getIPCTimeout()
Returns:
IPC log file name
int getIPCLogging (  ) const

Returns value of IPCLogging.

IPCLogging specifies logging level for inter-process communications. It has the followings possible values:

  • 0 for no logging of inter-process communication
  • 1 for for minimal logging
  • 2 for for verbose logging

Default is 0.

See also:
getIPCTimeout()
Returns:
IPC logging level
int getIPCTimeout (  ) const

Returns the value of IPCTimeout.

The IPCTimeout parameter is the timeout in seconds for inter-process communication.

Default is 10 seconds.

See also:
getIPCLogging(), getIPCLogfile()
Returns:
IPC timeout value
std::string getMascotNodeRebootScript (  ) const

Returns the value of MascotNodeRebootScript.

MascotNodeRebootScript is the name of an optional script to re-boot a cluster node. If this parameter is defined, then there will be a link at the bottom of each Mascot Cluster Node status page. When this link is clicked, ms-monitor will run the defined script on the master. The host name of the specified node will be passed to the script as a parameter.

By default this is empty.

Returns:
Mascot node reboot script
std::string getMascotNodeScript (  ) const

Returns the value of MascotNodeScript.

The MascotNodeScript parameter specifies a script name which is run for each node with different parameters described in Mascot manual.

By default this is empty.

Returns:
Mascot node script
const ms_computeraddress * getMasterComputer (  ) const

Returns an instance of ms_computeraddress created for MasterComputerName.

The MasterComputerName parameter contains a host name for the master computer and, optionally, the IP address separated by a comma. See ms_computeraddress for information about its parameters and default values.

Returns:
Pointer to the master computer object
std::string getNodeSequenceDatabaseDir (  ) const

Returns the value of NodeSequenceDatabaseDir.

Specify the sequence database directory to be used by to all cluster nodes. This can be a relative path to the node bin directory or an absolute path. Default is the ../sequence sub folder.

Returns:
Node sequence database directory
int getNumberOfSubClusters (  ) const

Returns the number of SubClusterSet parameter entries, which is a total number of sub-clusters.

Large clusters can be divided into sub-clusters. There might be several SubClusterSet parameter entries on separate lines in the configuration file. Each parameter line has the following format:

SubClusterSet X Y 

X is a unique integer value (0-based) used to identify the sub-cluster (from 0 to 49 inclusively).

Y is the maximum number of processors in the sub-cluster.

A single cluster must have a single entry with X set to 0. If no such entries are present in the file, one subcluster is assumed - default entry (0,0). Therefore, default value returned by this function is 1.

Use getSubClusterID() and getSubClusterMaxCPU() to retrieve the entries.

Returns:
Number of sub clusters
std::string getPreceedingComments (  ) const [inherited]

Returns any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also:
setPreceedingComments()
Returns:
any comments preceeding the section
int getSecsToWaitForNodeAtStartup (  ) const

Returns the value of SecsToWaitForNodeAtStartup.

The SecsToWaitForNodeAtStartup parameter specifies a timeout. At startup, if a node is not available within this time, the system will continue to startup without that node. If the value is set to 0, then the system will wait indefinitely.

This timeout is also used if a node fails while the system is running. The system will wait for this number of seconds before re-initialising ms-monitor.exe. This means that a short-lived interruption in network communication doesn't create a major service interruption.

Default is 60 sec.

Returns:
Seconds to wait for node at startup
int getSubClusterID ( const int  index ) const

Returns sub-cluster ID by its index.

Parameters:
indexa number between 0 and (getNumberOfSubClusters()-1).
Returns:
integer number which serves as a sub-cluster ID.
int getSubClusterMaxCPU ( const int  index ) const

Returns the Y part of SubClusterSet.

See getNumberOfSubClusters() for more detailed explanations.

Parameters:
indexa number in the list (from 0 to (getNumberOfSubClusters()-1)).
Returns:
maximum number of CPUs for the specified sub-cluster (0 by default).
bool isSectionAvailable (  ) const

Check whether the section has been actually read from the file.

By default the Options section is unavailable until it has been set to a different state.

Returns:
true is the section is available
Examples:
config_mascotdat.cpp.
void setCheckNodesAliveFreq ( const int  value )

Change CheckNodesAliveFreq.

See getCheckNodesAliveFreq() for more information.

Parameters:
valueFrequency to check if nodes are alive
void setDefaultNodeHomeDir ( const char *  str )

Change DefaultNodeHomeDir.

See getDefaultNodeHomeDir() for more information.

Parameters:
strdefault node home directory
void setDefaultNodeHomeDirFromMaster ( const char *  str )

Change DefaultNodeHomeDirFromMaster.

See getDefaultNodeHomeDirFromMaster() for more information.

Parameters:
strdefault mode home directory from master
void setDefaultNodeOS ( const OPERATING_SYS  value )

Change DefaultNodeOS.

See getDefaultNodeOS() for more information.

Parameters:
valuedefault node OS
void setDefaultPort ( const int  value )

Change DefaultPort.

See getDefaultPort() for more information.

Parameters:
valueDefault port
void setEnabled ( const bool  flag )

Change Enabled.

See isEnabled() for more information.

Parameters:
flagEnabled
void setIPCLogfile ( const char *  str )

Change IPCLogfile.

See getIPCLogfile() for more information.

Parameters:
strIPC log file
void setIPCLogging ( const int  value )

Change IPCLogging.

See getIPCLogging() for more information.

Parameters:
valueIPC logging level
void setIPCTimeout ( const int  value )

Change IPCTimeout.

See getIPCTimeout() for more information.

Parameters:
valueIPC timeout
void setMascotNodeRebootScript ( const char *  str )

Change MascotNodeRebootScript.

See getMascotNodeRebootScript() for more information.

Parameters:
strmascot mode reboot script
void setMascotNodeScript ( const char *  str )

Change MascotNodeScript.

See getMascotNodeScript() for more information.

Parameters:
strMascot node script
void setMasterComputer ( const ms_computeraddress value )

Change MasterComputerName.

See getMasterComputer() for more information.

Parameters:
valuePointer to a valid ms_computeraddress object
void setNodeSequenceDatabaseDir ( const char *  str )

Change NodeSequenceDatabaseDir.

See getNodeSequenceDatabaseDir() for more information.

Parameters:
strnode sequence database directory
void setPreceedingComments ( const std::string &  comments ) [inherited]

Sets any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also:
getPreceedingComments()
Parameters:
commentsany comments preceeding the section
void setSecsToWaitForNodeAtStartup ( const int  value )

Change SecsToWaitForNodeAtStartup.

See getSecsToWaitForNodeAtStartup() for more information.

Parameters:
valueseconds to wait for node at startup
void setSectionAvailable ( const bool  value )

Change availability of the section, i.e. if it should be saved in a file.

Value of 1 is to enable cluster mode, whereas 0 is to enable single server mode.

Default is 0.

Parameters:
valueBoolean whether the section is available

The documentation for this class was generated from the following files:

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:31