Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

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)
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, long dataSize)
template<class T>
void recv (int sourceProcessID, string dataTag, T &dataToReceive)
template<class T>
void recv (int sourceProcessID, string dataTag, T *pdataToReceive, long 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.


The documentation for this class was generated from the following file:
Generated on Sun Feb 27 15:12:26 2005 by  doxygen 1.4.1