Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
continue to mess up with simdag
[simgrid.git] / include / simgrid / simdag.h
index 0ca0928..466be70 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -6,6 +6,7 @@
 #ifndef SIMGRID_SIMDAG_H
 #define SIMGRID_SIMDAG_H
 
+#include <simgrid/engine.h>
 #include <simgrid/host.h>
 #include <simgrid/link.h>
 #include <simgrid/version.h>
 
 #ifdef __cplusplus
 #include <set>
+
+namespace simgrid {
+namespace sd {
+class Task;
+XBT_PUBLIC std::set<Task*>* simulate(double how_long);
+} // namespace sd
+} // namespace simgrid
+
+using sg_sd_Task = simgrid::sd::Task;
+#else
+typedef struct sd_Task sg_sd_Task;
 #endif
 
-SG_BEGIN_DECL
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /** @brief Link opaque datatype
     @ingroup SD_link_api
@@ -34,8 +48,8 @@ typedef sg_link_t SD_link_t;
     Each task has a <em>@ref e_SD_task_state_t "state"</em> indicating whether the task is scheduled, running, done, ...
 
     */
-typedef struct s_SD_task_t* SD_task_t;
-typedef const struct s_SD_task_t* const_SD_task_t;
+typedef sg_sd_Task* SD_task_t;
+typedef const sg_sd_Task* const_SD_task_t;
 
 /** @brief Task states
     @ingroup SD_task_api */
@@ -154,8 +168,6 @@ XBT_PUBLIC void SD_config(const char* key, const char* value);
 XBT_PUBLIC void SD_create_environment(const char* platform_file);
 XBT_PUBLIC void SD_simulate(double how_long);
 XBT_PUBLIC void SD_simulate_with_update(double how_long, xbt_dynar_t changed_tasks_dynar);
-XBT_PUBLIC double SD_get_clock();
-XBT_PUBLIC void SD_exit();
 XBT_PUBLIC xbt_dynar_t SD_daxload(const char* filename);
 XBT_PUBLIC xbt_dynar_t SD_dotload(const char* filename);
 XBT_PUBLIC xbt_dynar_t SD_dotload_with_sched(const char* filename);
@@ -163,11 +175,12 @@ XBT_PUBLIC xbt_dynar_t SD_PTG_dotload(const char* filename);
 /** @} */
 
 /* Support some backward compatibility */
+#define SD_get_clock simgrid_get_clock
 #define SD_workstation_t sg_host_t
 
-#define SD_link_get_name sg_link_name
-#define SD_link_get_current_latency sg_link_latency
-#define SD_link_get_current_bandwidth sg_link_bandwidth
+#define SD_link_get_name sg_link_get_name
+#define SD_link_get_current_latency sg_link_get_latency
+#define SD_link_get_current_bandwidth sg_link_get_bandwidth
 
 #define SD_route_get_current_latency SD_route_get_latency
 #define SD_route_get_current_bandwidth SD_route_get_bandwidth
@@ -178,32 +191,25 @@ XBT_PUBLIC xbt_dynar_t SD_PTG_dotload(const char* filename);
 #define SD_workstation_get_name sg_host_get_name
 #define SD_workstation_get_by_name sg_host_by_name
 #define SD_workstation_dump sg_host_dump
-#define SD_workstation_get_data sg_host_user
-#define SD_workstation_set_data sg_host_user_set
+#define SD_workstation_get_data sg_host_get_data
+#define SD_workstation_set_data sg_host_set_data
 #define SD_workstation_get_properties sg_host_get_properties
 #define SD_workstation_get_property_value sg_host_get_property_value
-#define SD_workstation_get_power sg_host_speed
+#define SD_workstation_get_power sg_host_get_speed
 #define SD_workstation_get_available_power sg_host_get_available_speed
-#define SD_route_get_latency sg_host_route_latency
-#define SD_route_get_bandwidth sg_host_route_bandwidth
+#define SD_route_get_latency sg_host_get_route_latency
+#define SD_route_get_bandwidth sg_host_get_route_bandwidth
 
-#define SD_workstation_get_mounted_storage_list sg_host_get_mounted_storage_list // XBT_ATTRIB_DEPRECATED_v330
 // Lost functions
 //SD_workstation_get_access_mode
 //SD_workstation_set_access_mode
 //SD_workstation_get_current_task
-//SD_route_get_communication_time => SG_route_get_latency() + amount / SD_route_get_bandwidth()
-//SD_workstation_get_computation_time => amount / sg_host_speed()
+//SD_route_get_communication_time => SD_route_get_latency() + amount / SD_route_get_bandwidth()
+//SD_workstation_get_computation_time => amount / sg_host_get_speed()
 //SD_route_get_size
 //SD_route_get_list
 //TRACE_sd_set_task_category
-SG_END_DECL
-
 #ifdef __cplusplus
-namespace simgrid {
-namespace sd {
-XBT_PUBLIC std::set<SD_task_t>* simulate(double how_long);
-}
 }
 #endif