#surf_host_model_init_current_default() (which will give you a
CLM03 model), or similar (see @ref SURF_models).
- To initialize SURF, call #surf_init(). Then
+ To initialize SURF, call
#surf_host_model_init_current_default() or #surf_host_model_init_ptask_L07()
to create the platform.
/*** SURF Globals **************************/
-/** @ingroup SURF_simulation
- * @brief Initialize SURF
- * @param argc argument number
- * @param argv arguments
- *
- * This function has to be called to initialize the common structures. Then you will have to create the environment by
- * calling e.g. surf_host_model_init_CM02()
- *
- * @see surf_host_model_init_CM02(), surf_host_model_init_compound()
- */
-XBT_PUBLIC void surf_init(int* argc, char** argv); /* initialize common structures */
-
/** @ingroup SURF_simulation
* @brief Finish simulation initialization
*
#include "src/smpi/include/smpi_actor.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/xml/platf.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
+#include "xbt/xbt_modinter.h" /* whether initialization was already done */
#include <boost/algorithm/string/predicate.hpp>
#ifndef _WIN32
simgrid::mc::AppSide::initialize();
#endif
- surf_init(argc, argv); /* Initialize SURF structures */
+ if (xbt_initialized == 0) {
+ xbt_init(argc, argv);
+
+ sg_config_init(argc, argv);
+ }
instance_->context_mod_init();
}
xbt_die("Model '%s' is invalid! Valid models are: %s.", name.c_str(), name_list.c_str());
}
-
-void surf_init(int* argc, char** argv)
-{
- if (xbt_initialized > 0)
- return;
-
- xbt_init(argc, argv);
-
- sg_config_init(argc, argv);
-}