3 import java.io.Serializable;
7 * Class representing a computing node
8 * @author Sébastien Miquée
11 public class GNode implements Serializable
13 private static final long serialVersionUID = 1L;
16 private int nb_cores ;
17 private int frequency ;
22 private boolean mapped ;
23 private boolean inCluster ;
24 private String clusterName ;
25 private String siteName ;
27 private Cluster cluster ;
31 * Default constructor.
50 public void setCluster( Cluster _cl )
55 public Cluster getCluster()
62 * Set the cluster's name in which the computing node is.
63 * @param _c The name of the cluster containing the node
65 public void setClusterName( String _cn )
72 * Return the cluster's name in which the node is.
73 * @return The cluster's name
75 public String getClusterName()
82 * Set the site's name in which the computing node is.
83 * @param _s The site's name
85 public void setSiteName( String _s )
92 * Return the name of the site in which the computing node is.
93 * @return The site's name
95 public String getSiteName()
102 * Change the status of the node concerning its participation in the computation.
103 * @param _b The status of its participation
105 public void setMapped( boolean _b )
112 * Return the status of the participation of the computing node.
113 * @return The status of the node
115 public boolean getMapped()
122 * Set the status of the computing node in order to know if
123 * it is in cluster or not.
124 * @param _b The status of the node
126 public void setInCluster( boolean _b )
133 * Return the status of the computing node concerning its
134 * presence, or not, in a cluster.
135 * @return The status of the node
137 public boolean getInCluster()
144 * Set the name of the computing node.
145 * @param _name The node's name
147 public void setName( String _name )
154 * Return the name of the computing node
155 * @return The node's name
157 public String getName()
164 * Set the external representation of the node. This object
165 * represents the node in application using this library.
166 * @param n The external representation of the node
168 public void setNode( Object n )
175 * Return the external representation of the node.
176 * @return The external representation of the node
178 public Object getNode()
186 * Set the amount of computing cores of the computing node.
187 * @param _nb_cores The amount of cores
189 public void setNb_cores( int _nb_cores )
191 nb_cores = _nb_cores;
196 * Return the amount of computing cores of the computing node.
197 * @return The amount of cores
199 public int getNb_cores()
206 * Set the frequency of computing cores of the computing node.
207 * @param _freq The frequency of cores
209 public void setFrequency( int _freq )
216 * Return the frequency of computing cores of the computing node.
217 * @return The frequency of cores
219 public int getFrequency()
226 * Set the MFlops of each computing core of the computing node.
227 * @param _mflops The MFlops of cores
229 public void setMFlops( int _mflops )
236 * Return the MFlops of each computing core of the computing node.
237 * @return The MFlops of cores
239 public int getMFlops()
245 * Set the amount of available memory of the computing node.
246 * @param _mem Amount of memory
248 public void setMemory( int _mem )
255 * Return the amount of the available memory of the computing node.
256 * @return The amount of memory
258 public int getMemory()
265 * Return the computational power of the computing node. It includes
266 * the multiplication of cores by frequency.
267 * @return The computational power of the computing node
269 public int getPower()
273 return ( nb_cores * mflops ) ;
275 return ( nb_cores * frequency ) ;
281 * Set the uniq identifier of the computing node.
282 * @param _id The identifier of the node
284 public void setId( long _id )
291 * Return the uniq identifier of the computing node.
292 * @return The identifier of the node
301 * Return the name of the node for the use of the node in a string.
302 * @return The name of the node
304 public String toString()
311 * Return the IP address of the GNode.
312 * @return The IP address
314 public String getIP()
321 * Set the IP address of the GNode.
322 * @param _ip The IP address
324 public void setIP( String _ip )
331 * Construct and return a copy of the current GNode.
332 * @return A copy of this node
336 GNode copy = new GNode() ;
338 copy.setName( name ) ;
339 copy.setNb_cores( nb_cores ) ;
340 copy.setFrequency( frequency ) ;
341 copy.setMFlops( mflops ) ;
342 copy.setMemory( memory ) ;
343 copy.setNode( node ) ;
345 copy.setMapped( mapped ) ;
346 copy.setInCluster( inCluster ) ;
347 copy.setClusterName( clusterName ) ;
348 copy.setSiteName( siteName ) ;
356 /** La programmation est un art, respectons ceux qui la pratiquent !! **/