org.objectweb.proactive.core.group.spmd
Class ProSPMD

java.lang.Object
  extended byorg.objectweb.proactive.core.group.spmd.ProSPMD

public class ProSPMD
extends java.lang.Object

This class provides a static method to build (an deploy) an 'SPMD' group of active objects with all references between them to communicate.

For instance, the following code builds objects of type A on nodes node1,node2,..., with parameters param1,param2,... and build for each object created its diffusion group to communicate with the others.

 Object[] params = {param1,param2,...};
 Node[] nodes = {node1,node2,...};

 A group  =  (A) ProSPMD.newSPMDGroup("A", params, nodes);
 

Since:
ProActive 1.0.3
Version:
1.0, 2003/10/09
Author:
Laurent Baduel

Constructor Summary
ProSPMD()
           
 
Method Summary
static void barrier(java.lang.String barrierName)
          Strongly synchronizes all the members of the spmd group
static void barrier(java.lang.String[] methodNames)
          Stops the activity and wait for the methods to resume.
static void barrier(java.lang.String barrierName, java.lang.Object group)
          Strongly synchronizes all the members of the group.
static int getMyRank()
          Returns the rank (position) of the object in the Group
static int getMySPMDGroupSize()
          Returns the size of the SPMD group of this
static java.lang.Object getSPMDGroup()
          Returns the SPMD group of this
static java.lang.Object newSPMDGroup(java.lang.String className, java.lang.Object[][] params, Node node)
          Creates an object representing a spmd group (a typed group) and creates all members with params on the node.
static java.lang.Object newSPMDGroup(java.lang.String className, java.lang.Object[][] params, Node[] nodeList)
          Creates an object representing a spmd group (a typed group) and creates members with params cycling on nodeList.
static java.lang.Object newSPMDGroup(java.lang.String className, java.lang.Object[][] params, java.lang.String nodeName)
          Creates an object representing a spmd group (a typed group) and creates all members with params on the node.
static java.lang.Object newSPMDGroup(java.lang.String className, java.lang.Object[][] params, java.lang.String[] nodeListString)
          Creates an object representing a spmd group (a typed group) and creates members with params cycling on nodeList.
static java.lang.Object newSPMDGroup(java.lang.String className, java.lang.Object[][] params, VirtualNode virtualNode)
          Creates an object representing a spmd group (a typed group) and creates members with params cycling on the nodes of the virtual node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProSPMD

public ProSPMD()
Method Detail

newSPMDGroup

public static java.lang.Object newSPMDGroup(java.lang.String className,
                                            java.lang.Object[][] params,
                                            java.lang.String nodeName)
                                     throws java.lang.ClassNotFoundException,
                                            ClassNotReifiableException,
                                            ActiveObjectCreationException,
                                            NodeException
Creates an object representing a spmd group (a typed group) and creates all members with params on the node.

Parameters:
className - - the name of the (upper) class of the group's member.
params - - the array that contain the parameters used to build the group's member.
nodeName - - the name (String) of the node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newSPMDGroup

public static java.lang.Object newSPMDGroup(java.lang.String className,
                                            java.lang.Object[][] params,
                                            java.lang.String[] nodeListString)
                                     throws java.lang.ClassNotFoundException,
                                            ClassNotReifiableException,
                                            ActiveObjectCreationException,
                                            NodeException
Creates an object representing a spmd group (a typed group) and creates members with params cycling on nodeList.

Parameters:
className - - the name of the (upper) class of the group's member.
params - - the array that contain the parameters used to build the group's member.
nodeListString - - the names of the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newSPMDGroup

public static java.lang.Object newSPMDGroup(java.lang.String className,
                                            java.lang.Object[][] params,
                                            Node node)
                                     throws java.lang.ClassNotFoundException,
                                            ClassNotReifiableException,
                                            ActiveObjectCreationException,
                                            NodeException
Creates an object representing a spmd group (a typed group) and creates all members with params on the node.

Parameters:
className - - the name of the (upper) class of the group's member.
params - - the array that contain the parameters used to build the group's member.
node - - the node where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newSPMDGroup

public static java.lang.Object newSPMDGroup(java.lang.String className,
                                            java.lang.Object[][] params,
                                            Node[] nodeList)
                                     throws java.lang.ClassNotFoundException,
                                            ClassNotReifiableException,
                                            ActiveObjectCreationException,
                                            NodeException
Creates an object representing a spmd group (a typed group) and creates members with params cycling on nodeList.

Parameters:
className - - the name of the (upper) class of the group's member.
params - the array that contain the parameters used to build the group's member. If params is null, builds an empty group.
nodeList - - the nodes where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

newSPMDGroup

public static java.lang.Object newSPMDGroup(java.lang.String className,
                                            java.lang.Object[][] params,
                                            VirtualNode virtualNode)
                                     throws java.lang.ClassNotFoundException,
                                            ClassNotReifiableException,
                                            ActiveObjectCreationException,
                                            NodeException
Creates an object representing a spmd group (a typed group) and creates members with params cycling on the nodes of the virtual node.

Parameters:
className - the name of the (upper) class of the group's member.
params - - the array that contain the parameters used to build the group's member. If params is null, builds an empty group.
virtualNode - - the virtual where the members are created.
Returns:
a typed group with its members.
Throws:
ActiveObjectCreationException - if a problem occur while creating the stub or the body
java.lang.ClassNotFoundException - if the Class corresponding to className can't be found.
ClassNotReifiableException - if the Class corresponding to className can't be reify.
NodeException - if the node was null and that the DefaultNode cannot be created

getSPMDGroup

public static java.lang.Object getSPMDGroup()
Returns the SPMD group of this

Returns:
the SPMD group of this

getMySPMDGroupSize

public static int getMySPMDGroupSize()
Returns the size of the SPMD group of this

Returns:
a size (int)

getMyRank

public static int getMyRank()
Returns the rank (position) of the object in the Group

Returns:
the index of the object

barrier

public static void barrier(java.lang.String barrierName)
Strongly synchronizes all the members of the spmd group

Parameters:
barrierName - the name of the barrier (used as unique identifier)

barrier

public static void barrier(java.lang.String barrierName,
                           java.lang.Object group)
Strongly synchronizes all the members of the group. Beware ! The caller object HAVE TO BE IN THE GROUP group

Parameters:
barrierName - - the name of the barrier (used as unique identifier)
group - - the typed group the barrier is invoked on

barrier

public static void barrier(java.lang.String[] methodNames)
Stops the activity and wait for the methods to resume.

Parameters:
methodNames - - the name of the methods used to synchronize


Copyright ? April 2005 INRIA All Rights Reserved.