XBT_PUBLIC void simgrid_load_deployment(const char* filename);
XBT_PUBLIC void simgrid_run();
XBT_PUBLIC void simgrid_register_function(const char* name, int (*code)(int, char**));
-XBT_PUBLIC void sg_engine_register_default(int (*code)(int, char**));
+XBT_PUBLIC void simgrid_register_default(int (*code)(int, char**));
XBT_PUBLIC double simgrid_get_clock();
SG_END_DECL()
/******************************* Environment **********************************/
SG_BEGIN_DECL()
-XBT_PUBLIC void SIMIX_create_environment(const char* file);
+XBT_ATTRIB_DEPRECATED_v324("Please use simgrid_load_platform()") XBT_PUBLIC
+ void SIMIX_create_environment(const char* file);
SG_END_DECL()
#ifdef __cplusplus
/******************************** Deployment **********************************/
SG_BEGIN_DECL()
-XBT_PUBLIC void SIMIX_function_register(const char* name, xbt_main_func_t code);
+XBT_ATTRIB_DEPRECATED_v324("Please use simgrid_register_function()") XBT_PUBLIC
+ void SIMIX_function_register(const char* name, xbt_main_func_t code);
+XBT_ATTRIB_DEPRECATED_v324("Please use simgrid_load_deployment()") XBT_PUBLIC
+ void SIMIX_launch_application(const char* file);
XBT_PUBLIC void SIMIX_function_register_default(xbt_main_func_t code);
-XBT_PUBLIC void SIMIX_init_application();
-XBT_PUBLIC void SIMIX_launch_application(const char* file);
+XBT_PUBLIC void SIMIX_init_application();
XBT_PUBLIC void SIMIX_process_set_function(const char* process_host, const char* process_function,
xbt_dynar_t arguments, double process_start_time, double process_kill_time);
SG_END_DECL()
}
void MSG_function_register_default(xbt_main_func_t code)
{
- sg_engine_register_default(code);
+ simgrid_register_default(code);
}
double MSG_get_clock()
{
{
simgrid::s4u::Engine::get_instance()->register_function(name, code);
}
-void sg_engine_register_default(int (*code)(int, char**))
+void simgrid_register_default(int (*code)(int, char**))
{
simgrid::s4u::Engine::get_instance()->register_default(code);
}
#include "simgrid/s4u/Host.hpp"
#include "smx_private.hpp"
#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
+#include <simgrid/engine.h>
#include <xbt/ex.hpp>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_deployment, simix, "Logging specific to SIMIX (deployment)");
}
}
-void SIMIX_launch_application(const char* file)
+void SIMIX_launch_application(const char* file) // deprecated
{
- SIMIX_launch_application(std::string(file));
+ simgrid_load_deployment(file);
}
// Wrap a main() function into a ActorCodeFactory:
simix_global->registered_functions[name] = toActorCodeFactory(code);
}
-void SIMIX_function_register(const char* name, xbt_main_func_t code)
+void SIMIX_function_register(const char* name, xbt_main_func_t code) // deprecated
{
- SIMIX_function_register(std::string(name), code);
+ simgrid_register_function(name, code);
}
/**
#include "smx_private.hpp"
#include "src/include/surf/surf.hpp"
#include "xbt/xbt_os_time.h"
+
+#include <simgrid/engine.h>
#include <xbt/ex.hpp>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, "Logging specific to SIMIX (environment)");
XBT_DEBUG("PARSE TIME: %g", (end - start));
}
-void SIMIX_create_environment(const char* file)
+void SIMIX_create_environment(const char* file) // deprecated
{
- SIMIX_create_environment(std::string(file));
+ simgrid_load_platform(file);
}
void SIMIX_post_create_environment()
void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_processes)
{
if (code != nullptr) { // When started with smpirun, we will not execute a function
- SIMIX_function_register(name, code);
+ simgrid::s4u::Engine::get_instance()->register_function(name, code);
}
static int already_called = 0;
// TODO This will not be executed in the case where smpi_main is not called,
// e.g., not for smpi_msg_masterslave. This should be moved to another location
- // that is always called -- maybe close to Actor::onCreation?
+ // that is always called -- maybe close to Actor::on_creation?
simgrid::s4u::Host::on_creation.connect(
[](simgrid::s4u::Host& host) { host.extension_set(new simgrid::smpi::Host(&host)); });
// parse the platform file: get the host list
- SIMIX_create_environment(argv[1]);
+ simgrid::s4u::Engine::get_instance()->load_platform(argv[1]);
SIMIX_comm_set_copy_data_callback(smpi_comm_copy_buffer_callback);
smpi_init_options();
smpi_init_privatization_no_dlopen(executable);
SMPI_init();
- SIMIX_launch_application(argv[2]);
+ simgrid::s4u::Engine::get_instance()->load_deployment(argv[2]);
SMPI_app_instance_register(smpi_default_instance_name.c_str(), nullptr,
process_data.size()); // This call has a side effect on process_count...
MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name);
#include <xbt/future.hpp>
+#include <simgrid/engine.h>
#include <simgrid/kernel/future.hpp>
#include <simgrid/simix.hpp>
#include <simgrid/simix/blocking_simcall.hpp>
{
SIMIX_global_init(&argc, argv);
xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
- SIMIX_function_register("master", example::master);
- SIMIX_create_environment(argv[1]);
+ simgrid_register_function("master", example::master);
+ simgrid_load_platform(argv[1]);
simcall_process_create("master", example::master, NULL, sg_host_by_name("Tremblay"), 0, NULL, NULL);
SIMIX_run();
return 0;
#include "simgrid/simix.h"
#include "xbt/log.h"
+#include <simgrid/engine.h>
#include <string>
xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]);
- SIMIX_function_register("master", master);
- SIMIX_create_environment(argv[1]);
+ simgrid_register_function("master", master);
+ simgrid_load_platform(argv[1]);
simcall_process_create("master", master, NULL, sg_host_by_name("Tremblay"), 0, NULL, NULL);
SIMIX_run();