Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix VM params once for all - Adrien
authoralebre <adrien.lebre@inria.fr>
Mon, 1 Jul 2013 15:58:22 +0000 (17:58 +0200)
committeralebre <adrien.lebre@inria.fr>
Mon, 1 Jul 2013 15:58:22 +0000 (17:58 +0200)
.cproject
examples/java/cloud/Cloud.java
examples/java/cloud/Slave.java
include/msg/msg.h
src/bindings/java/jmsg_vm.c
src/bindings/java/jmsg_vm.h
src/bindings/java/org/simgrid/msg/VM.java
src/msg/msg_vm.c
src/surf/surf.c
src/surf/workstation.c

index 2d167a8..7722fbd 100644 (file)
--- a/.cproject
+++ b/.cproject
@@ -3,99 +3,19 @@
 
 <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage2">
        <storageModule moduleId="org.eclipse.cdt.core.settings">
 
 <cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage2">
        <storageModule moduleId="org.eclipse.cdt.core.settings">
-               <cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1353180652">
-                       <storageModule externalCElementFile="cdt.managedbuild.toolchain.gnu.base.1353180652_org.eclipse.cdt.core.settings" id="cdt.managedbuild.toolchain.gnu.base.1353180652" name="Default"/>
-                       <storageModule externalCElementFile="cdt.managedbuild.toolchain.gnu.base.1353180652_cdtBuildSystem" version="4.0.0"/>
-                       <storageModule externalCElementFile="cdt.managedbuild.toolchain.gnu.base.1353180652_org.eclipse.cdt.core.externalSettings"/>
+               <cconfiguration id="0.1454192080">
+                       <storageModule externalCElementFile="0.1454192080_org.eclipse.cdt.core.settings" id="0.1454192080" name="Default"/>
+                       <storageModule externalCElementFile="0.1454192080_cdtBuildSystem" version="4.0.0"/>
+                       <storageModule externalCElementFile="0.1454192080_org.eclipse.cdt.core.externalSettings"/>
                </cconfiguration>
        </storageModule>
                </cconfiguration>
        </storageModule>
-       <storageModule moduleId="org.eclipse.cdt.core.pathentry">
-               <pathentry kind="mac" name="main" path="" value="smpi_simulated_main"/>
-               <pathentry include="/usr/include/lua5.1" kind="inc" path="" system="true"/>
-               <pathentry include="/usr/include" kind="inc" path="" system="true"/>
-               <pathentry base-path="simgrid" include="include" kind="inc" path="" system="true"/>
-               <pathentry base-path="simgrid" include="src/include" kind="inc" path="" system="true"/>
-               <pathentry base-path="simgrid" include="src" kind="inc" path="" system="true"/>
-               <pathentry excluding="**/CMakeFiles/" kind="out" path=""/>
-               <pathentry kind="src" path=""/>
-       </storageModule>
        <storageModule moduleId="cdtBuildSystem" version="4.0.0">
        <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-               <project id="simgrid.null.697056024" name="simgrid"/>
-       </storageModule>
-       <storageModule moduleId="refreshScope" versionNumber="2">
-               <configuration configurationName="Default">
-                       <resource resourceType="PROJECT" workspacePath="/simgrid"/>
-               </configuration>
+               <project id="simgrid.null.1424519849" name="simgrid"/>
        </storageModule>
        </storageModule>
-       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
-       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
        <storageModule moduleId="scannerConfiguration">
        <storageModule moduleId="scannerConfiguration">
-               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
-               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-                       <buildOutputProvider>
-                               <openAction enabled="true" filePath=""/>
-                               <parser enabled="true"/>
-                       </buildOutputProvider>
-                       <scannerInfoProvider id="specsFile">
-                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="/usr/bin/gcc" useDefault="true"/>
-                               <parser enabled="true"/>
-                       </scannerInfoProvider>
-               </profile>
-               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-                       <buildOutputProvider>
-                               <openAction enabled="true" filePath=""/>
-                               <parser enabled="true"/>
-                       </buildOutputProvider>
-                       <scannerInfoProvider id="makefileGenerator">
-                               <runAction arguments="-f ${project_name}_scd.mk" command="/usr/bin/make" useDefault="true"/>
-                               <parser enabled="true"/>
-                       </scannerInfoProvider>
-               </profile>
-               <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1353180652;cdt.managedbuild.toolchain.gnu.base.1353180652.1797514135;cdt.managedbuild.tool.gnu.c.compiler.base.2037544368;cdt.managedbuild.tool.gnu.c.compiler.input.1851803849">
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-                               <buildOutputProvider>
-                                       <openAction enabled="true" filePath=""/>
-                                       <parser enabled="true"/>
-                               </buildOutputProvider>
-                               <scannerInfoProvider id="specsFile">
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="/usr/bin/gcc" useDefault="true"/>
-                                       <parser enabled="true"/>
-                               </scannerInfoProvider>
-                       </profile>
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-                               <buildOutputProvider>
-                                       <openAction enabled="true" filePath=""/>
-                                       <parser enabled="true"/>
-                               </buildOutputProvider>
-                               <scannerInfoProvider id="makefileGenerator">
-                                       <runAction arguments="-f ${project_name}_scd.mk" command="/usr/bin/make" useDefault="true"/>
-                                       <parser enabled="true"/>
-                               </scannerInfoProvider>
-                       </profile>
-               </scannerConfigBuildInfo>
-               <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.1353180652;cdt.managedbuild.toolchain.gnu.base.1353180652.1797514135;cdt.managedbuild.tool.gnu.cpp.compiler.base.1129818443;cdt.managedbuild.tool.gnu.cpp.compiler.input.500761747">
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-                               <buildOutputProvider>
-                                       <openAction enabled="true" filePath=""/>
-                                       <parser enabled="true"/>
-                               </buildOutputProvider>
-                               <scannerInfoProvider id="specsFile">
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="/usr/bin/gcc" useDefault="true"/>
-                                       <parser enabled="true"/>
-                               </scannerInfoProvider>
-                       </profile>
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-                               <buildOutputProvider>
-                                       <openAction enabled="true" filePath=""/>
-                                       <parser enabled="true"/>
-                               </buildOutputProvider>
-                               <scannerInfoProvider id="makefileGenerator">
-                                       <runAction arguments="-f ${project_name}_scd.mk" command="/usr/bin/make" useDefault="true"/>
-                                       <parser enabled="true"/>
-                               </scannerInfoProvider>
-                       </profile>
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               <scannerConfigBuildInfo instanceId="0.1454192080">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
                </scannerConfigBuildInfo>
        </storageModule>
 </cproject>
                </scannerConfigBuildInfo>
        </storageModule>
 </cproject>
index eba9d07..c4067bf 100644 (file)
@@ -16,7 +16,7 @@ import org.simgrid.msg.MsgException;
 public class Cloud {
        public static final double task_comp_size = 10;
        public static final double task_comm_size = 10;
 public class Cloud {
        public static final double task_comp_size = 10;
        public static final double task_comm_size = 10;
-       public static final int hostNB = 3 ; 
+       public static final int hostNB = 500 ; 
        public static void main(String[] args) throws MsgException {       
            Msg.init(args); 
            
        public static void main(String[] args) throws MsgException {       
            Msg.init(args); 
            
@@ -38,4 +38,4 @@ public class Cloud {
                Msg.run();
                
     }
                Msg.run();
                
     }
-}
\ No newline at end of file
+}
index 527f989..68f003a 100644 (file)
@@ -43,4 +43,4 @@ public class Slave extends Process {
 
                
        }
 
                
        }
-}
\ No newline at end of file
+}
index 0dc3be4..1c9f81e 100644 (file)
@@ -404,7 +404,7 @@ XBT_PUBLIC(const char*) MSG_vm_get_name(msg_vm_t);
 // TODO add VDI later
 XBT_PUBLIC(msg_vm_t) MSG_vm_create_core(msg_host_t location, const char *name);
 XBT_PUBLIC(msg_vm_t) MSG_vm_create(msg_host_t ind_pm, const char *name,
 // TODO add VDI later
 XBT_PUBLIC(msg_vm_t) MSG_vm_create_core(msg_host_t location, const char *name);
 XBT_PUBLIC(msg_vm_t) MSG_vm_create(msg_host_t ind_pm, const char *name,
-    int core_nb, long mem_cap, long net_cap, char *disk_path, long disk_size);
+    int core_nb, long mem_cap, long net_cap, char *disk_path, long disk_size, long dp_rate, long mig_netspeed);
 
 XBT_PUBLIC(void) MSG_vm_destroy(msg_vm_t vm);
 
 
 XBT_PUBLIC(void) MSG_vm_destroy(msg_vm_t vm);
 
index 395b8d2..b19223a 100644 (file)
@@ -72,7 +72,8 @@ Java_org_simgrid_msg_VM_isRestoring(JNIEnv * env, jobject jvm) {
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
-                              jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize) {
+                              jint jncore, jlong jramsize, jlong jnetcap, jstring jdiskpath, jlong jdisksize, jlong jdprate, jlong jmig_netspeed) {
+
   msg_host_t host = jhost_get_native(env, jhost);
 
   const char *name;
   msg_host_t host = jhost_get_native(env, jhost);
 
   const char *name;
@@ -84,8 +85,8 @@ Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring
   // disk_path = (*env)->GetStringUTFChars(env, jdiskpath, 0);
   // disk_path = xbt_strdup(disk_path);
 
   // disk_path = (*env)->GetStringUTFChars(env, jdiskpath, 0);
   // disk_path = xbt_strdup(disk_path);
 
-  msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize,
-                 (int) jnetcap, NULL, (int) jdisksize);
+  msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (long) jramsize,
+                 (long) jnetcap, NULL, (long) jdisksize, (long) jdprate, (long) jmig_netspeed);
 
   jvm_bind(env,jvm,vm);
 }
 
   jvm_bind(env,jvm,vm);
 }
index 7bfe807..7a0ae66 100644 (file)
@@ -87,7 +87,7 @@ Java_org_simgrid_msg_VM_isRestoring(JNIEnv *env, jobject jvm);
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
  */
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
-                              jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize);
+                              jint jncore, jlong jramsize, jlong jnetcap, jstring jdiskpath, jlong jdisksize, jlong dprate, jlong mig_netspeed);
 
 /**
  * Class            org_simgrid_msg_VM
 
 /**
  * Class            org_simgrid_msg_VM
index 675da0b..7083889 100644 (file)
@@ -29,18 +29,28 @@ public class VM extends Host{
         * Create a `basic' VM (i.e. 1 core, 1GB of RAM, other values are not taken into account).
         */
        public VM(Host host, String name) {
         * Create a `basic' VM (i.e. 1 core, 1GB of RAM, other values are not taken into account).
         */
        public VM(Host host, String name) {
-               this(host,name,1,1024*1024*1024, -1, null, -1);
+               this(host,name,1,1024, -1, null, -1,0 , 0);
        }
 
        /**
        }
 
        /**
-        * Create a `basic' VM (i.e. 1 core, 1GB of RAM, other values are not taken into account).
+        * Create a  VM
+        * @param host, Host node
+        * @param name, name of the machine
+        * @param nCore, number of core
+        * @param ramSize, size of the RAM that should be allocated (in MBytes) 
+        * @param netCap (not used for the moment)
+        * @param diskPath (not used for the moment)
+        * @param diskSize (not used for the moment)
+        * @param dpRate (dirty page rate MB/flop, if you don't know put zero ;))
+        * @param migNetSpeed (network bandwith allocated for migrations in MB/s, if you don't know put zero ;))
         */
         */
+       
        public VM(Host host, String name, int nCore,  long ramSize, 
        public VM(Host host, String name, int nCore,  long ramSize, 
-                        long netCap, String diskPath, long diskSize){
+                       long netCap, String diskPath, long diskSize, long  dpRate,long migNetSpeed){
                super();
                super.name = name; 
                this.currentHost = host; 
                super();
                super.name = name; 
                this.currentHost = host; 
-               create(host, name, nCore, ramSize, netCap, diskPath, diskSize);
+               create(host, name, nCore, ramSize, netCap, diskPath, diskSize, dpRate, migNetSpeed);
                VM.addVM(this);
        }
 
                VM.addVM(this);
        }
 
@@ -107,13 +117,15 @@ public class VM extends Host{
        /**
         * Natively implemented method create the VM.
         * @param nCore, number of core
        /**
         * Natively implemented method create the VM.
         * @param nCore, number of core
-        * @param ramSize, size of the RAM that should be allocated 
+        * @param ramSize, size of the RAM that should be allocated (in MB) 
         * @param netCap (not used for the moment)
         * @param diskPath (not used for the moment)
         * @param diskSize (not used for the moment)
         * @param netCap (not used for the moment)
         * @param diskPath (not used for the moment)
         * @param diskSize (not used for the moment)
+        * @param dpRate (dirty page rate in MB/flop, if you don't know put zero ;))
+        * @param migNetSpeed (network bandwith allocated for migrations in MB/s, if you don't know put zero ;))
         */
        private native void create(Host host, String name, int nCore, long ramSize, 
         */
        private native void create(Host host, String name, int nCore, long ramSize, 
-                        long netCap, String diskPath, long diskSize);
+                        long netCap, String diskPath, long diskSize, long dpRate, long migNetSpeed);
        
        /**
         * start the VM
        
        /**
         * start the VM
index 8055867..0c99ccf 100644 (file)
@@ -166,24 +166,28 @@ int MSG_vm_is_restoring(msg_vm_t vm)
 
 /** @brief Create a new VM with specified parameters.
  *  @ingroup msg_VMs*
 
 /** @brief Create a new VM with specified parameters.
  *  @ingroup msg_VMs*
+ *  All parameters are in MBytes
  *
  */
  *
  */
-msg_vm_t MSG_vm_create(msg_host_t ind_pm, const char *name,
-                                            int ncpus, long ramsize, long net_cap, char *disk_path, long disksize)
+msg_vm_t MSG_vm_create(msg_host_t ind_pm, const char *name, int ncpus, long ramsize,
+                                            long net_cap, char *disk_path, long disksize,
+                                                long dp_rate, long mig_netspeed)
 {
 {
-  msg_vm_t vm = MSG_vm_create_core(ind_pm, name);
-
-  {
-    s_ws_params_t params;
-    memset(&params, 0, sizeof(params));
-    params.ramsize = ramsize;
-    //params.overcommit = 0;
-    simcall_host_set_params(vm, &params);
-  }
-
-  /* TODO: Limit net capability, take into account disk considerations. */
-
-  return vm;
+       msg_vm_t vm = MSG_vm_create_core(ind_pm, name);
+       s_ws_params_t params;
+       memset(&params, 0, sizeof(params));
+       params.ramsize = 1L * 1024 * 1024 * ramsize;
+       //params.overcommit = 0;
+       params.devsize = 0;
+       params.skip_stage2 = 0;
+       params.max_downtime = 0.03;
+       params.dp_rate = 1L * 1024 * 1024 * dp_rate;
+       params.dp_cap = params.ramsize / 0.9; // working set memory is 90%
+       params.mig_speed = 1L * 1024 * 1024 * mig_netspeed; // mig_speed
+
+       simcall_host_set_params(vm, &params);
+
+       return vm;
 }
 
 
 }
 
 
index 2cc050d..19b3039 100644 (file)
@@ -546,6 +546,7 @@ void surf_presolve(void)
 
 double surf_solve(double max_date)
 {
 
 double surf_solve(double max_date)
 {
+                 
   min = -1.0; /* duration */
   double next_event_date = -1.0;
   double model_next_action_end = -1.0;
   min = -1.0; /* duration */
   double next_event_date = -1.0;
   double model_next_action_end = -1.0;
@@ -567,10 +568,17 @@ double surf_solve(double max_date)
   surf_min_index = 0;
 
   /* sequential version */
   surf_min_index = 0;
 
   /* sequential version */
+  struct timeval bla;
+  gettimeofday(&bla, NULL);
+  //unsigned int t = end.tv_usec - begin.tv_usec;
+  XBT_INFO("Surf_solve : bla.before iteration:%lu/%lu",bla.tv_sec, bla.tv_usec);
   xbt_dynar_foreach(model_list_invoke, iter, model) {
   xbt_dynar_foreach(model_list_invoke, iter, model) {
+       gettimeofday(&bla, NULL);
+        XBT_INFO("Surf_solve : iteration:%lu/%lu",bla.tv_sec, bla.tv_usec);
     surf_share_resources(model);
   }
     surf_share_resources(model);
   }
-
+  gettimeofday(&bla, NULL);
+  XBT_INFO("Surf_solve : end before iteration:%lu/%lu",bla.tv_sec, bla.tv_usec);
   unsigned i;
   for (i = 0; i < xbt_dynar_length(model_list_invoke); i++) {
     if ((min < 0.0 || surf_mins[i] < min)
   unsigned i;
   for (i = 0; i < xbt_dynar_length(model_list_invoke); i++) {
     if ((min < 0.0 || surf_mins[i] < min)
index dbaf9ae..aa5b387 100644 (file)
@@ -165,8 +165,8 @@ static void adjust_weight_of_dummy_cpu_actions(void)
 
 double ws_share_resources(surf_model_t workstation_model, double now)
 {
 
 double ws_share_resources(surf_model_t workstation_model, double now)
 {
 if (workstation_model->type == SURF_MODEL_TYPE_WORKSTATION)
-    adjust_weight_of_dummy_cpu_actions();
+ if (workstation_model->type == SURF_MODEL_TYPE_WORKSTATION)
+   adjust_weight_of_dummy_cpu_actions();
 
   /* Invoke the share_resources() callback of the physical cpu model object and
    * the network model objects. */
 
   /* Invoke the share_resources() callback of the physical cpu model object and
    * the network model objects. */