Matrix Science header

ms_clusterparams.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_clusterparams.hpp                                                 #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates "mascot.dat"-file that describes most important parameters    #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2003 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /Mowse/ms_mascotresfile/include/ms_clusterparams.hpp       $ #
00012 #     $Author: francoisr $ #
00013 #       $Date: 2016/05/17 12:49:19 $ #
00014 #   $Revision: 1.16 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_CLUSTERPARAMS_HPP
00020 #define MS_CLUSTERPARAMS_HPP
00021 
00022 #ifdef _WIN32
00023 #pragma warning(disable:4251)   // Don't want all classes to be exported
00024 #pragma warning(disable:4786)   // Debug symbols too long
00025 #   ifndef _MATRIX_USE_STATIC_LIB
00026 #       ifdef MS_MASCOTRESFILE_EXPORTS
00027 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00028 #       else
00029 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00030 #       endif
00031 #   else
00032 #       define MS_MASCOTRESFILE_API
00033 #   endif
00034 #else
00035 #   define MS_MASCOTRESFILE_API
00036 #endif
00037 
00038 // for the sake of #include <string>
00039 #ifdef __ALPHA_UNIX__
00040 #include <ctype.h>
00041 #endif
00042 #include <string>
00043 
00044 
00045 namespace matrix_science {
00059     enum OPERATING_SYS
00060     {
00061         _OS_AIX               = 0,   
00062         _OS_UNKNOWN           = 1,   
00063         _OS_WINDOWS_NT        = 2,   
00064         _OS_IRIX              = 3,   
00065         _OS_ALPHA_TRUE64      = 4,   
00066         _OS_SOLARIS           = 5,   
00067         _OS_LINUX             = 6,   
00068         _OS_LINUXALPHA        = 7,   
00069         _OS_FREE_BSD_         = 8,   
00070         _OS_NUM_OPERATING_SYS = 9    
00071     };
00072 
00074 
00096     class MS_MASCOTRESFILE_API ms_clusterparams: public ms_customproperty
00097     {
00098         friend class ms_datfile;
00099     public:
00101 
00108         enum {
00109             NUM_PROCESSORS_AUTO_DETECT = -1 
00110         };
00111 
00113         ms_clusterparams();
00114 
00116         ms_clusterparams(const ms_clusterparams& src);
00117 
00119         ~ms_clusterparams();
00120 
00122         void defaultValues();
00123 
00125         void copyFrom(const ms_clusterparams* right);
00126 
00127 #ifndef SWIG
00128 
00129         ms_clusterparams& operator=(const ms_clusterparams& right);
00130 #endif
00131 
00132         bool isSectionAvailable() const;
00133 
00135         void setSectionAvailable(const bool value);
00136 
00138         bool isEnabled() const;
00139 
00141         void setEnabled(const bool flag);
00142 
00144         const ms_computeraddress* getMasterComputer() const;
00145 
00147         void setMasterComputer(const ms_computeraddress* value);
00148 
00150         OPERATING_SYS getDefaultNodeOS() const;
00151 
00153         void setDefaultNodeOS(const OPERATING_SYS value);
00154 
00156         std::string getDefaultNodeHomeDir() const;
00157 
00159         void setDefaultNodeHomeDir(const char* str);
00160 
00162         int getDefaultPort() const;
00163 
00165         void setDefaultPort(const int value);
00166 
00168         std::string getDefaultNodeHomeDirFromMaster() const;
00169 
00171         void setDefaultNodeHomeDirFromMaster(const char* str);
00172 
00174         std::string getMascotNodeScript() const;
00175 
00177         void setMascotNodeScript(const char* str);
00178 
00180         std::string getMascotNodeRebootScript() const;
00181 
00183         void setMascotNodeRebootScript(const char* str);
00184 
00186         int getNumberOfSubClusters() const;
00187 
00189         void clearSubClusters();
00190 
00192         int getSubClusterID(const int index) const;
00193 
00195         int getSubClusterMaxCPU(const int index) const;
00196 
00198         void appendSubCluster(const int id, const int maxCPUs);
00199 
00200         // internal usage only
00201         int getThisSubClusterID() const;
00202 
00203         // internal usage only
00204         void setThisSubClusterID(const int id);
00205 
00207         int getIPCTimeout() const;
00208 
00210         void setIPCTimeout(const int value);
00211 
00213         int getIPCLogging() const;
00214 
00216         void setIPCLogging(const int value);
00217 
00219         std::string getIPCLogfile() const;
00220 
00222         void setIPCLogfile(const char* str);
00223 
00225         int getCheckNodesAliveFreq() const;
00226 
00228         void setCheckNodesAliveFreq(const int value);
00229 
00231         int getSecsToWaitForNodeAtStartup() const;
00232 
00234         void setSecsToWaitForNodeAtStartup(const int value);
00235 
00237         std::string getNodeSequenceDatabaseDir() const;
00238 
00240         void setNodeSequenceDatabaseDir(const char* str);
00241 
00242 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00243 #include "suppress_ms_customproperty.hpp"
00244 #endif
00245 
00246     private:
00247         bool            sectionAvailable_;
00248         bool            enabled_;
00249 
00250         ms_computeraddress masterComputer_;
00251 
00252         OPERATING_SYS   defaultNodeOS_;
00253         std::string     szDefaultNodeHomeDir_;
00254         int             defaultPort_;
00255         std::string     szDefaultNodeHomeDirFromMaster_;
00256         std::string     szMascotNodeScript_;
00257         std::string     szMascotNodeRebootScript_;
00258 
00259         std::vector<int> subClusterIDs_;
00260         std::vector<int> maxCpusPerSubCluster_;
00261         bool             anySubCluster_;
00262 
00263         int             thisSubCluster_;
00264 
00265         int             IPCTimeout_;
00266         int             IPCLogging_;
00267         std::string     IPCLogfile_;
00268         int             checkNodesAliveFreq_;
00269         int             secsToWaitForNodeAtStartup_;
00270 
00271         std::string     szNodeSequenceDatabaseDir_;
00272     }; // class ms_clusterparams // end of config_group
00274 } // namespace matrix_science
00275 
00276 #endif // MS_CLUSTERPARAMS_HPP
00277 
00278 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:50