Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Many modifications in order to make a more efficient library for GNode creation
[mapping.git] / src / and / Mapping / GNode.java
index 5e6dcaf..c8bdb0d 100644 (file)
@@ -15,6 +15,7 @@ public class GNode implements Serializable
        private String name ;
        private int nb_cores ;
        private int frequency ;
+       private int mflops ;
        private int memory ;
        private Object node ;
        private long id ;
@@ -34,6 +35,7 @@ public class GNode implements Serializable
                site = "" ;
                nb_cores = 0 ;
                frequency = 0 ;
+               mflops = 0 ;
                memory = 0 ;
                node = null ;
                id = -1 ;
@@ -205,6 +207,25 @@ public class GNode implements Serializable
                return frequency ;
        }
 
+       
+       /**
+        * Set the MFlops of each computing core of the computing node.
+        * @param _freq The MFlops of cores
+        */
+       public void setMFlops( int _mflops ) 
+       {
+               mflops = _mflops ;
+       }
+
+
+       /**
+        * Return the MFlops of each computing core of the computing node.
+        * @return The MFlops of cores
+        */
+       public int getMFlops() 
+       {
+               return mflops ;
+       }
 
        /**
         * Set the amount of available memory of the computing node.
@@ -234,7 +255,12 @@ public class GNode implements Serializable
         */
        public int getPower()
        {
-               return ( nb_cores * frequency ) ;
+               if( frequency != 0 )
+               {
+                       return ( nb_cores * frequency ) ;
+               } else {
+                       return ( nb_cores * mflops ) ;
+               }
        }