mdp_psim Class Reference

Parallel SIMulator used by class mdp_communicator. More...

#include <mdp_psim.h>

List of all members.

Public Member Functions

 mdp_psim (int processCount, string logFileName=".psim.log", int verbatim=0)
 mdp_psim (int argc, char **argv)
virtual ~mdp_psim ()
void log (string message, int level=2)
int id ()
int nprocs ()
void setCommTimeout (unsigned int commTimeout)
template<class T >
void send (int destProcessID, string dataTag, T &dataToSend)
template<class T >
void send (int destProcessID, string dataTag, T *pdataToSend, mdp_int dataSize)
template<class T >
void recv (int sourceProcessID, string dataTag, T &dataToReceive)
template<class T >
void recv (int sourceProcessID, string dataTag, T *pdataToReceive, mdp_int dataSize)
template<class T >
void broadcast (int sourceProcessID, T &data)
template<class T >
void broadcast (int sourceProcessID, T *data, int dataSize)
template<class T >
vector< T > collect (int dest, T &data)
template<class T >
vector< T > combine (T &data)
void barrier ()
template<class T >
add (T &item)

Static Public Member Functions

static int parse_argv_nprocs (int argc, char **argv)
static string parse_argv_logfile (int argc, char **argv)
static int parse_argv_verbatim (int argc, char **argv)

Detailed Description

Parallel SIMulator used by class mdp_communicator.

Attention: under MDP and/or FermiQCD this is already Instantiated inside class mdp_communicator.

Example:

/// int main(int argc, char** argv) {
///    mdp_psim node(argc,argv);
///    int a=3, b=0;
///    if(node.id()==0) node.send(1,a);
///    if(node.id()==1) { node.recv(0,b); cout << b << endl;
///    return 0;
/// }
/// 

Compile with

///    g++ [filename] -o a.out
/// 

and run with

///    ./a.out -PSIM_NPROCS=2
/// 

Output should be 3.


Constructor & Destructor Documentation

mdp_psim::mdp_psim ( int  processCount,
string  logFileName = ".psim.log",
int  verbatim = 0 
) [inline]
mdp_psim::mdp_psim ( int  argc,
char **  argv 
) [inline]
virtual mdp_psim::~mdp_psim (  )  [inline, virtual]

Member Function Documentation

template<class T >
T mdp_psim::add ( T &  item  )  [inline]
void mdp_psim::barrier (  )  [inline]
template<class T >
void mdp_psim::broadcast ( int  sourceProcessID,
T *  data,
int  dataSize 
) [inline]
template<class T >
void mdp_psim::broadcast ( int  sourceProcessID,
T &  data 
) [inline]
template<class T >
vector<T> mdp_psim::collect ( int  dest,
T &  data 
) [inline]
template<class T >
vector<T> mdp_psim::combine ( T &  data  )  [inline]
int mdp_psim::id (  )  [inline]
void mdp_psim::log ( string  message,
int  level = 2 
) [inline]
int mdp_psim::nprocs (  )  [inline]
static string mdp_psim::parse_argv_logfile ( int  argc,
char **  argv 
) [inline, static]
static int mdp_psim::parse_argv_nprocs ( int  argc,
char **  argv 
) [inline, static]
static int mdp_psim::parse_argv_verbatim ( int  argc,
char **  argv 
) [inline, static]
template<class T >
void mdp_psim::recv ( int  sourceProcessID,
string  dataTag,
T *  pdataToReceive,
mdp_int  dataSize 
) [inline]
template<class T >
void mdp_psim::recv ( int  sourceProcessID,
string  dataTag,
T &  dataToReceive 
) [inline]
template<class T >
void mdp_psim::send ( int  destProcessID,
string  dataTag,
T *  pdataToSend,
mdp_int  dataSize 
) [inline]
template<class T >
void mdp_psim::send ( int  destProcessID,
string  dataTag,
T &  dataToSend 
) [inline]
void mdp_psim::setCommTimeout ( unsigned int  commTimeout  )  [inline]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines

Generated on Wed Dec 23 14:03:15 2009 for fermiqcd by  doxygen 1.6.1