Classes | Namespaces | Defines | Enumerations | Functions | Variables

gridmd.h File Reference

Classes for GridMD workflow interface. More...

#include <stdint.h>
#include "wxinc.h"
#include <wx/cmdline.h>
#include "refobj.h"
#include "logexc.h"
#include "seqpack.h"
#include "jobmngr/pbsmngr.h"
#include "jobmngr/plinkshell.h"
#include "jobmngr/unixshell.h"
Include dependency graph for gridmd.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  gmHardLink
 Category structure for indicating the hard link to gmManager::mark_node() function. More...
struct  gmDataLink< data_t >
 Category structure for indicating the data link to gmManager::mark_node() function. More...
struct  gmResourceDescr
 Resourse description for gmManager. More...
class  gmSelector
 Class representing a collection of nodes/ports selected using differemt categories:

  • indicating integer ID of a node
  • indicating regular expression matching the symbolic name of a node
  • indicating a node category by using node selector flags gmNODES.
More...
class  gmManager
 Main interface class to access workflow functions. More...

Namespaces

namespace  gridmd
 

Namespace for global GridMD functions.


Defines

#define MAX_RES_TYPES   1
 The number of defined resource types.
#define MAX_SHELL_TYPES   2
 The number of defined shell types.
#define MAX_RECURSION   10
 Maximum allowed number of recursions in calls to gridmd_main.

Enumerations

enum  gmNODES {
  gmNODE_NONE = -1, gmNODE_ALL = -2, gmNODE_PREV = -3, gmNODE_NOINPUTS = -4,
  gmNODE_NOOUTPUTS = -5, gmNODE_AUTO = -6
}
 

Node selector flags for use in linking functions together with node ids (see also gmSelector).

More...
enum  gmEXE_MODES
 

Execution modes.


enum  gmMODES { gmMODE_LOCAL = 0, gmMODE_MANAGER = 0x1, gmMODE_CONSTRUCT = 0x1, gmMODE_WORKER = 0x2 }
 

gmManager operation modes (bit flags)

More...
enum  gmLINKS { gmLINK_HARD = 0x1, gmLINK_DATA = 0x2, gmLINK_PROC = 0x4, gmLINK_LOCAL = 0x8 }
 

Types of links used to connect GridMD nodes.

More...
enum  gmGV_FIELDS {
  gmGV_NODENAME = 0x1, gmGV_LINKNAME = 0x2, gmGV_DESTNAME = 0x4, gmGV_NODENUM = 0x8,
  gmGV_NODESTATE = 0x10, gmGV_THREAD = 0x20, gmGV_CLUSTER = 0x40, gmGV_ALL = 0xfffffff
}
 

Fields to output in the graph file for Graphviz visualization.

More...
enum  gmTMP_FILES { gmFILES_LOCAL = 0x1, gmFILES_CLEANUP = 0x2 }
 

Bit flags to indicate temporary files settings in gmManager::set_link_files().

More...
enum  gmRESOURCE_TYPES { gmRES_PBS }
 

Resource broker types.

More...
enum  gmSHELL_TYPES { gmSHELL_PLINK = 0, gmSHELL_UNIX = 1 }
 

Shell types.

More...
enum  gmNAME_SORT { gmSEL_ALL = -1, gmSEL_NEAREST = -2 }
 

Treatement of nodes with duplicated names for gmSelector.

More...

Functions

int gridmd_main (int argc, char **argv)
 User function to work with gridmd.
template<class T >
bool dump_to_file (FILE *f, const T *ptr)
 Template function that performs the datatype packing into a file.
template<class T >
bool restore_from_file (FILE *f, T *ptr)
 Template function that performs the datatype reading from a file.
int gridmd::begin_distributed ()
 gmManager::begin_distributed() called for the global gmExperiment
int gridmd::end_distributed ()
 gmManager::end_distributed() called for the global gmExperiment
template<class link_type >
int gridmd::mark_node (const string &name, gmSelector input=gmNODE_PREV, const link_type &t=gmHardLink(), int srcport=-1)
 See gmManager::mark_node().
int gridmd::mark_node (const string &name, gmSelector input=gmNODE_PREV)
 See gmManager::mark_node().
template<class link_type >
int gridmd::node (const string &name, gmSelector input=gmNODE_PREV, const link_type &t=gmHardLink(), int srcport=-1)
 See gmManager::mark_node().
int gridmd::node (const string &name, gmSelector input=gmNODE_PREV)
 See gmManager::mark_node().
int gridmd::get_curnode ()
 See gmManager::get_curnode().
template<class data_t >
int gridmd::link (gmNodeID from, gmNodeID to, int srcport=-1)
 See gmManager::link().
template<class data_t >
data_t & gridmd::node_output (int portid=0)
 See gmManager::node_output().
template<class data_t >
const data_t & gridmd::node_input (int portid=0)
 See gmManager::node_input().
int gridmd::process_cur_node ()
 See gmManager::process_cur_node().
int gridmd::gridmd_init (int argc, char **argv)
 See gmManager::init().

Variables

const char * gmResTypeName []
 Type names corresponding to resource types gmRESOURCE_TYPES.
const char * gmShellTypeName []
 Type names corresponding to shell types gmSHELL_TYPES.
gmManager gmExperiment
 Main experiment object.

Detailed Description

Classes for GridMD workflow interface.


Enumeration Type Documentation

Fields to output in the graph file for Graphviz visualization.

Enumerator:
gmGV_NODENAME 

node name

gmGV_LINKNAME 

link (file) name

gmGV_DESTNAME 

link destination name

gmGV_NODENUM 

node number

gmGV_NODESTATE 

node state

gmGV_THREAD 

execution thread

gmGV_CLUSTER 

index of hard-linked cluster

gmGV_ALL 

all

enum gmLINKS

Types of links used to connect GridMD nodes.

Enumerator:
gmLINK_HARD 

Hard (logical) link.

gmLINK_DATA 

Data link.

gmLINK_PROC 

Process link.

gmLINK_LOCAL 

Hard link to intermediate 'finish' node (does not require simultaneous node processing).

enum gmMODES

gmManager operation modes (bit flags)

Enumerator:
gmMODE_LOCAL 

Default setting, the modes are automatically selected in course of operation.

gmMODE_MANAGER 

Same as gmMODE_CONSTRUCT.

gmMODE_CONSTRUCT 

Construction mode in which the graph is assembled.

gmMODE_WORKER 

Worker mode for execution of the worker nodes.

Treatement of nodes with duplicated names for gmSelector.

Enumerator:
gmSEL_ALL 

Select all nodes including thouse with duplicated names.

gmSEL_NEAREST 

Between the nodes with duplicated names select the nearest in id to the current node.

enum gmNODES

Node selector flags for use in linking functions together with node ids (see also gmSelector).

Enumerator:
gmNODE_NONE 

No nodes selected.

gmNODE_ALL 

All available nodes.

gmNODE_PREV 

Previous node.

gmNODE_NOINPUTS 

All nodes currently with no input links.

gmNODE_NOOUTPUTS 

All nodes currently with no output links.

gmNODE_AUTO 

Automatic selection performed by implementation.

Resource broker types.

Enumerator:
gmRES_PBS 

Cluster with installed PBS-compatible queueing system.

Shell types.

The shell is used to access the resource broker remotely. Not all combinations of (resource,shell) are valid within gmResourceDescr (see gmJobManager documentation). gmManager::add_resource() returns <0 for invalid combinations.

Enumerator:
gmSHELL_PLINK 

Windows plink (ssh client), requires plink.exe and pscp.exe available from PuTTy.

gmSHELL_UNIX 

Plain unix command line (no ssh) to access the resource at local machine.

Bit flags to indicate temporary files settings in gmManager::set_link_files().

Enumerator:
gmFILES_LOCAL 

Create link files even for local mode.

gmFILES_CLEANUP 

Cleanup all temporary link files after all connected nodes are processed.


Function Documentation

template<class T >
bool dump_to_file ( FILE *  f,
const T *  ptr 
)

Template function that performs the datatype packing into a file.

The function is used when transferring link data from/to a node. The existing implementation (memory dump) is valid for all simple plain data types. Has to be specialized for user types requiring any special procedures.

int gridmd_main ( int  argc,
char **  argv 
)

User function to work with gridmd.

This function must be explicitly defined by the user and explicitly called from the user code. The command line prameters argc and argv are usually redirected from main() and used for calling gmManager::init(). See description of gmManager::init() for the list of GridMD-specific command line parameters.

template<class T >
bool restore_from_file ( FILE *  f,
T *  ptr 
)

Template function that performs the datatype reading from a file.

The function is used when transferring link data from/to a node. The existing implementation (copy form file to memory) is valid for all simple plain data types. Has to be specialized for user types requiring any special procedures.