Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mark all of simix.h as deprecated.
[simgrid.git] / include / simgrid / simix.h
1 /* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_SIMIX_H
7 #define SIMGRID_SIMIX_H
8
9 #include <simgrid/forward.h>
10 #include <xbt/parmap.h>
11
12 #ifndef SIMIX_H_NO_DEPRECATED_WARNING
13 #warning simgrid/simix.h is deprecated and will be removed in v3.35.
14 #endif
15
16 /******************************* Networking ***********************************/
17 SG_BEGIN_DECL
18
19 /* parallelism */
20 XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::is_parallel()") XBT_PUBLIC int SIMIX_context_is_parallel();
21 XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::get_nthreads()") XBT_PUBLIC int SIMIX_context_get_nthreads();
22 XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::set_nthreads()") XBT_PUBLIC
23     void SIMIX_context_set_nthreads(int nb_threads);
24 XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::get_parallel_mode()") XBT_PUBLIC e_xbt_parmap_mode_t
25     SIMIX_context_get_parallel_mode();
26 XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::set_parallel_mode()") XBT_PUBLIC
27     void SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode);
28 XBT_ATTRIB_DEPRECATED_v333("Please use Actor::is_maestro()") XBT_PUBLIC int SIMIX_is_maestro();
29
30 /********************************** Global ************************************/
31 /* Set some code to execute in the maestro (must be used before the engine creation)
32  *
33  * If no maestro code is registered (the default), the main thread
34  * is assumed to be the maestro. */
35 XBT_ATTRIB_DEPRECATED_v333("Please use simgrid_set_maestro()") XBT_PUBLIC
36     void SIMIX_set_maestro(void (*code)(void*), void* data);
37
38 /* Simulation execution */
39 XBT_ATTRIB_DEPRECATED_v332("Please use EngineImpl:run()") XBT_PUBLIC void SIMIX_run();
40 XBT_ATTRIB_DEPRECATED_v332("Please use simgrid_get_clock() or Engine::get_clock()") XBT_PUBLIC double SIMIX_get_clock();
41
42 SG_END_DECL
43
44 /********************************* Process ************************************/
45 SG_BEGIN_DECL
46 XBT_ATTRIB_DEPRECATED_v333("Please use kernel::actor::ActorImpl::self()") XBT_PUBLIC smx_actor_t SIMIX_process_self();
47 XBT_ATTRIB_DEPRECATED_v333("Please use xbt_procname()") XBT_PUBLIC const char* SIMIX_process_self_get_name();
48 SG_END_DECL
49
50 /****************************** Communication *********************************/
51 #ifdef __cplusplus
52 XBT_ATTRIB_DEPRECATED_v333("Please use Engine::set_default_comm_data_copy_callback()") XBT_PUBLIC
53     void SIMIX_comm_set_copy_data_callback(void (*callback)(simgrid::kernel::activity::CommImpl*, void*, size_t));
54
55 XBT_ATTRIB_DEPRECATED_v333("Please use Comm::copy_buffer_callback()") XBT_PUBLIC
56     void SIMIX_comm_copy_pointer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size);
57 XBT_ATTRIB_DEPRECATED_v333("Please use Comm::copy_pointer_callback()") XBT_PUBLIC
58     void SIMIX_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size);
59
60 /******************************************************************************/
61 /*                            SIMIX simcalls                                  */
62 /******************************************************************************/
63 /* These functions are a system call-like interface to the simulation kernel. */
64 /* They can also be called from maestro's context, and they are thread safe.  */
65 /******************************************************************************/
66
67 /************************** Communication simcalls ****************************/
68
69 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::send()") XBT_PUBLIC
70     void simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
71                            size_t src_buff_size, bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
72                            void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data,
73                            double timeout);
74
75 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::isend()") XBT_PUBLIC simgrid::kernel::activity::ActivityImplPtr
76     simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
77                        size_t src_buff_size, bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
78                        void (*clean_fun)(void*),
79                        void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data,
80                        bool detached);
81
82 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::recv()") XBT_PUBLIC
83     void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
84                            bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
85                            void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data,
86                            double timeout, double rate);
87
88 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::irecv()") XBT_PUBLIC simgrid::kernel::activity::ActivityImplPtr
89     simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
90                        bool (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
91                        void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), void* data,
92                        double rate);
93
94 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::wait_any_for()") XBT_PUBLIC ssize_t
95     simcall_comm_waitany(simgrid::kernel::activity::CommImpl* comms[], size_t count, double timeout);
96 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::wait_for()") XBT_PUBLIC
97     void simcall_comm_wait(simgrid::kernel::activity::ActivityImpl* comm, double timeout);
98 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::test()") XBT_PUBLIC
99     bool simcall_comm_test(simgrid::kernel::activity::ActivityImpl* comm);
100 XBT_ATTRIB_DEPRECATED_v335("Please use s4u::Comm::test_any()") XBT_PUBLIC ssize_t
101     simcall_comm_testany(simgrid::kernel::activity::CommImpl* comms[], size_t count);
102
103 #endif
104 #endif