Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make the NS3 network model more visible
[simgrid.git] / src / surf / surf_interface.cpp
index 56845e3..ac574f2 100644 (file)
@@ -33,7 +33,7 @@ xbt_dynar_t model_list_invoke = nullptr;  /* to invoke callbacks */
 
 simgrid::trace_mgr::future_evt_set *future_evt_set = nullptr;
 xbt_dynar_t surf_path = nullptr;
-std::vector<sg_host_t> host_that_restart;
+std::vector<simgrid::s4u::Host*> host_that_restart;
 xbt_dict_t watched_hosts_lib;
 
 namespace simgrid {
@@ -64,9 +64,7 @@ s_surf_model_description_t surf_network_model_description[] = {
    surf_network_model_init_IB},
   {"CM02", "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of small messages are thus poorly modeled).",
    surf_network_model_init_CM02},
-#if HAVE_NS3
   {"NS3", "Network pseudo-model using the NS3 tcp model instead of an analytic model", surf_network_model_init_NS3},
-#endif
   {"Reno",  "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
    surf_network_model_init_Reno},
   {"Reno2", "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
@@ -76,6 +74,20 @@ s_surf_model_description_t surf_network_model_description[] = {
   {nullptr, nullptr, nullptr}      /* this array must be nullptr terminated */
 };
 
+#if ! HAVE_SMPI
+void surf_network_model_init_SMPI() {
+  xbt_die("Please activate SMPI support in cmake to use the SMPI network model.");
+}
+void surf_network_model_init_IB() {
+  xbt_die("Please activate SMPI support in cmake to use the IB network model.");
+}
+#endif
+#if !HAVE_NS3
+void surf_network_model_init_NS3() {
+  xbt_die("Please activate NS3 support in cmake and install the dependencies to use the NS3 network model.");
+}
+#endif
+
 s_surf_model_description_t surf_cpu_model_description[] = {
   {"Cas01", "Simplistic CPU model (time=size/power).", surf_cpu_model_init_Cas01},
   {nullptr, nullptr,  nullptr}      /* this array must be nullptr terminated */
@@ -301,7 +313,6 @@ void surf_init(int *argc, char **argv)
   });
 
   XBT_DEBUG("Add SURF levels");
-  simgrid::surf::HostImpl::classInit();
   SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free);
 
   xbt_init(argc, argv);