Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

sc::ShmMessageGrp Class Reference

The ShmMessageGrp class is an implementation of MessageGrp that allows multiple process to be started that communicate with shared memory. More...

#include <messshm.h>

Inheritance diagram for sc::ShmMessageGrp:

Inheritance graph
[legend]
Collaboration diagram for sc::ShmMessageGrp:

Collaboration graph
[legend]
List of all members.

Public Methods

 ShmMessageGrp ()
 Reads the number of processors from environmental variable NUMPROC.

 ShmMessageGrp (const Ref< KeyVal > &)
 The ShmMessageGrp KeyVal constructor takes a single keyword that specifies the number of processors. More...

 ShmMessageGrp (int nprocs)
 Initialize ShmMessageGrp to use nprocs processors.

 ~ShmMessageGrp ()
void sync ()
 Synchronize all of the processors.

Ref< MessageGrpclone (void)
 Returns a copy of this MessageGrp specialization that provides an independent communication context.


Protected Methods

void basic_send (int target, int type, void *data, int nbyte)
 Must be implemented by specializations.

void basic_recv (int type, void *data, int nbyte)
 Must be implemented by specializations.

int basic_probe (int type)
 Must be implemented by specializations.

void initialize (int nprocs)
void initialize ()
msgbuf_t * NEXT_MESSAGE (msgbuf_t *m)
void get_change (int node)
void put_change (int node)
void wait_for_write (int node)
void release_write (int node)
void print_buffer (int node, int me)

Protected Attributes

commbuf_t * commbuf [MAXPROCS]
int shmid
int semid
int change_semid
void * sharedmem
sembuf semdec
sembuf seminc

Detailed Description

The ShmMessageGrp class is an implementation of MessageGrp that allows multiple process to be started that communicate with shared memory.

This only provides improved performance if you have multiple CPU's in a symmetric multiprocessor configuration. Nonetheless, it is quite useful on a single CPU for tracking down bugs.


Constructor & Destructor Documentation

sc::ShmMessageGrp::ShmMessageGrp const Ref< KeyVal > &   
 

The ShmMessageGrp KeyVal constructor takes a single keyword that specifies the number of processors.

Here is an example of a ParsedKeyVal input that creates a ShmMessageGrp that runs on four processors:

       message<ShmMessageGrp>: n = 4
       


The documentation for this class was generated from the following file:
Generated at Fri Jan 10 08:16:55 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14.