From c5b6984a0236437d46945ee28731a6a072f6a2fb Mon Sep 17 00:00:00 2001 From: alegrand Date: Tue, 9 Aug 2005 00:26:42 +0000 Subject: [PATCH] getting rid of deprecated functions git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1642 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/msg/msg_test.c | 2 +- include/msg/datatypes.h | 29 ------------------------- include/msg/msg.h | 31 ++------------------------ src/msg/deployment.c | 43 ++----------------------------------- src/msg/global.c | 38 +++----------------------------- tools/gras/stub_generator.c | 2 +- 6 files changed, 9 insertions(+), 136 deletions(-) diff --git a/examples/msg/msg_test.c b/examples/msg/msg_test.c index 6970cb447f..388e0878ec 100644 --- a/examples/msg/msg_test.c +++ b/examples/msg/msg_test.c @@ -201,7 +201,7 @@ void test_all(const char *platform_file,const char *application_file) /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init_args(&argc,argv); + MSG_global_init(&argc,argv); if (argc < 3) { printf ("Usage: %s platform_file deployment_file\n",argv[0]); printf ("example: %s msg_platform.xml msg_deployment.xml\n",argv[0]); diff --git a/include/msg/datatypes.h b/include/msg/datatypes.h index 9a49c4a2cc..8034f9fece 100644 --- a/include/msg/datatypes.h +++ b/include/msg/datatypes.h @@ -124,34 +124,5 @@ typedef enum { } MSG_error_t; /** @} */ - -/** @deprecated MSG verbosity - @ingroup m_datatypes_management -*/ -typedef enum { - MSG_SILENT = 0, - MSG_SOME, - MSG_VERBOSE -} MSG_outputmode_t; - - -/** @deprecated Network sharing mechanism - @ingroup m_datatypes_management - @brief Sharing policy : 0 means uninitialized value -*/ -typedef enum { - MSG_STORE_AND_FORWARD = 1, /**< Packet level simulation of communications. Bad */ - MSG_TCP /**< Continuous model of network communications. Good */ -} MSG_sharing_t; - -/** @deprecated Link datatype - * @ingroup m_datatypes_management - * The notion of link was present in the earliest versions of MSG. - * It was an agglomeration of communicating resources representing a set of - * physical network links. This abstraction a disappeared because in real-life, - * it is generally not possible to interact directly with a link... - */ -typedef struct m_link *m_link_t; - END_DECL() #endif diff --git a/include/msg/msg.h b/include/msg/msg.h index 5a83058d5c..cf0009b1ee 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -16,11 +16,9 @@ BEGIN_DECL() /************************** Global ******************************************/ void MSG_config(const char *name, ...); -void MSG_global_init(void); +void MSG_global_init(int *argc, char **argv); void MSG_global_init_args(int *argc, char **argv); -void MSG_set_verbosity(MSG_outputmode_t mode); MSG_error_t MSG_set_channel_number(int number); -MSG_error_t MSG_set_sharing_policy(MSG_sharing_t mode, double param); int MSG_get_channel_number(void); MSG_error_t MSG_main(void); MSG_error_t MSG_clean(void); @@ -55,8 +53,6 @@ m_process_t MSG_process_create_with_arguments(const char *name, m_host_t host, int argc, char **argv); void MSG_process_kill(m_process_t process); int MSG_process_killall(int reset_PIDs); -MSG_error_t MSG_get_arguments(int *argc, char ***argv); -MSG_error_t MSG_set_arguments(m_process_t process,int argc, char *argv[]); MSG_error_t MSG_process_change_host(m_process_t process, m_host_t host); @@ -75,8 +71,6 @@ MSG_error_t MSG_process_suspend(m_process_t process); MSG_error_t MSG_process_resume(m_process_t process); int MSG_process_is_suspended(m_process_t process); -MSG_error_t MSG_process_start(m_process_t process); - /************************** Task handling ************************************/ m_task_t MSG_task_create(const char *name, double compute_duration, @@ -103,6 +97,7 @@ MSG_error_t MSG_task_put_bounded(m_task_t task, double max_rate); MSG_error_t MSG_task_execute(m_task_t task); MSG_error_t MSG_parallel_task_execute(m_task_t task); +void MSG_task_set_priority(m_task_t task, double priority); int MSG_task_Iprobe(m_channel_t channel); int MSG_task_probe_from(m_channel_t channel); @@ -115,27 +110,5 @@ double MSG_task_get_compute_duration(m_task_t task); double MSG_task_get_remaining_computation(m_task_t task); double MSG_task_get_data_size(m_task_t task); -/************************** Deprecated ***************************************/ -/* MSG_error_t MSG_routing_table_init(void); */ -/* MSG_error_t MSG_routing_table_set(m_host_t host1, m_host_t host2, */ -/* m_link_t link); */ -/* m_link_t MSG_routing_table_get(m_host_t host1, m_host_t host2); */ -/* m_host_t MSG_host_create(const char *name, */ -/* char *trace_file, */ -/* long double fixed_cpu, */ -/* char* failure_trace, */ -/* long double fixed_failure, */ -/* void *data); */ -/* m_host_t MSG_host_from_PID(int PID); */ -/* MSG_error_t MSG_host_destroy(m_host_t host); */ - -/* void MSG_link_set_sharing_value(long double alpha); */ -/* m_link_t MSG_link_create(const char *name, */ -/* char *lat_trace_file, long double fixed_latency, */ -/* char *bw_trace_file, long double fixed_bandwidth); */ -/* MSG_error_t MSG_link_destroy(m_link_t link); */ -/* m_link_t MSG_link_merge(const char *name, m_link_t src1, m_link_t src2); */ -/* m_link_t MSG_get_link_by_name(const char *name); */ -/* void MSG_tracelink(m_host_t dest, const char* **names, int *count); */ END_DECL() #endif diff --git a/src/msg/deployment.c b/src/msg/deployment.c index d9f32eef02..70e47f13da 100644 --- a/src/msg/deployment.c +++ b/src/msg/deployment.c @@ -106,7 +106,7 @@ void MSG_launch_application(const char *file) */ void MSG_function_register(const char *name,m_process_code_t code) { - xbt_assert0(msg_global,"MSG_global_init_args has to be called before MSG_function_register."); + xbt_assert0(msg_global,"MSG_global_init has to be called before MSG_function_register."); xbt_dict_set(msg_global->registered_functions,name,code,NULL); } @@ -122,49 +122,10 @@ m_process_code_t MSG_get_registered_function(const char *name) { m_process_code_t code = NULL; - xbt_assert0(msg_global,"MSG_global_init_args has to be called before MSG_get_registered_function."); + xbt_assert0(msg_global,"MSG_global_init has to be called before MSG_get_registered_function."); code = xbt_dict_get(msg_global->registered_functions,name); return code; } -/** \ingroup msg_easier_life - * \brief Get the arguments of the current process. - * \deprecated{Not useful since #m_process_code_t is int (*)(int argc, char *argv[])} - * - * This functions returns the values set for the current process - * using #MSG_set_arguments or #MSG_launch_application. - * \param argc the number of arguments - * \param argv the arguments table - */ -MSG_error_t MSG_get_arguments(int *argc, char ***argv) -{ - m_process_t process = MSG_process_self(); - simdata_process_t simdata = NULL; - - xbt_assert0((argc) && (argv), "Invalid parameters"); - simdata = process->simdata; - *argc = simdata->argc; - *argv = simdata->argv; - - return MSG_OK; -} - -/* \ingroup msg_easier_life - * \brief Set the arguments of a process. - * - * This functions sets the argument number and the arguments table for a - * proces. - * \param process is the process you want to modify - * \param argc the number of arguments - * \param argv the arguments table - */ -MSG_error_t MSG_set_arguments(m_process_t process,int argc, char *argv[]) -{ - xbt_assert0(0,"Deprecated ! Do not use anymore. " - "Use MSG_process_create_with_arguments instead.\n"); - - return MSG_OK; -} - diff --git a/src/msg/global.c b/src/msg/global.c index b0c7eae29e..6bf0f87a9a 100644 --- a/src/msg/global.c +++ b/src/msg/global.c @@ -29,19 +29,15 @@ MSG_Global_t msg_global = NULL; /** \ingroup msg_simulation * \brief Initialize some MSG internal data. */ -void MSG_global_init(void) +void MSG_global_init_args(int *argc, char **argv) { - int argc=0; - char **argv=NULL; - - CRITICAL0("Function MSG_global_init() is deprecated by MSG_global_init_args()."); - MSG_global_init_args(&argc,argv); + MSG_global_init(argc,argv); } /** \ingroup msg_simulation * \brief Initialize some MSG internal data. */ -void MSG_global_init_args(int *argc, char **argv) +void MSG_global_init(int *argc, char **argv) { if (!msg_global) { surf_init(argc, argv); /* Initialize some common structures. Warning, it sets msg_global=NULL */ @@ -237,14 +233,6 @@ void MSG_paje_output(const char *filename) } } -/** @deprecated Defines the verbosity of the simulation. - * @ingroup msg_simulation - */ -void MSG_set_verbosity(MSG_outputmode_t mode) -{ - CRITICAL0("MSG_set_verbosity : Deprecated function. Use the XBT logging interface."); -} - /** \defgroup m_channel_management Understanding channels * \brief This section briefly describes the channel notion of MSG * (#m_channel_t). @@ -275,26 +263,6 @@ MSG_error_t MSG_set_channel_number(int number) return MSG_OK; } -/** \ingroup m_simulation - * \brief Set the sharing policy used for the links - * - * This function can be called to change the sharing policy used for the links - (see \ref paper_tcp). By default the store and forward mechanism is used - with a parameter equal to 0.1. This function has to be called before creating - any link. - * \param mode the sharing policy used for the links: can be either - MSG_STORE_AND_FORWARD or MSG_TCP. - * \param param a parameter for the sharing policy. It has to be >0. It is - currently used only for the MSG_STORE_AND_FORWARD flavor and represents the - granularity of the communications (i.e. the packet size). - */ -MSG_error_t MSG_set_sharing_policy(MSG_sharing_t mode, double param) -{ - CRITICAL0("MSG_set_sharing_policy: this function is now deprecated and useless. Store and forward does not exist anymore. Please stop using it."); - - return MSG_OK; -} - /** \ingroup m_channel_management * \brief Return the number of channel in the simulation. * diff --git a/tools/gras/stub_generator.c b/tools/gras/stub_generator.c index aab8cd0e82..c82f089197 100644 --- a/tools/gras/stub_generator.c +++ b/tools/gras/stub_generator.c @@ -165,7 +165,7 @@ static void generate_sim(char *project) fprintf(OUT, "%s", "int main (int argc,char *argv[]) {\n" "\n" " /* Simulation setup */\n" - " MSG_global_init_args(&argc,argv);\n" + " MSG_global_init(&argc,argv);\n" " if (argc != 3) {\n" " fprintf(stderr, \"Usage: %s platform_file application_description.txt [--gras-log=...]\\n\",argv[0]);\n" " exit(1);\n" -- 2.20.1