XBT_PRIVATE= \
XBT_ATTRIB_NORETURN= \
XBT_ATTRIB_UNUSED= \
- XBT_ATTRIB_DEPRECATED_v323(m)= \
XBT_ATTRIB_DEPRECATED_v324(m)= \
XBT_ATTRIB_DEPRECATED_v325(m)= \
XBT_ATTRIB_DEPRECATED_v326(m)=
XBT_PRIVATE= \
XBT_ATTRIB_NORETURN= \
XBT_ATTRIB_UNUSED= \
- XBT_ATTRIB_DEPRECATED_v323(m)= \
XBT_ATTRIB_DEPRECATED_v324(m)= \
XBT_ATTRIB_DEPRECATED_v325(m)= \
XBT_ATTRIB_DEPRECATED_v326(m)=
typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
typedef simgrid::simix::Timer* smx_timer_t;
-typedef simgrid::kernel::context::Context* smx_context_t;
typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
typedef struct s_smx_timer* smx_timer_t;
typedef struct s_smx_actor* smx_actor_t;
typedef struct s_smx_cond_t* smx_cond_t;
-typedef struct s_smx_context* smx_context_t;
typedef struct s_smx_mailbox* smx_mailbox_t;
typedef struct s_smx_mutex* smx_mutex_t;
typedef struct s_smx_sem* smx_sem_t;
void cleanup_output();
void write_output(FILE* file);
- // deprecated
- XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::add_meta_info()") void addMetaInfo(char* key, char* value)
- {
- add_meta_info(key, value);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::cleanup_output()") void cleanupOutput() { cleanup_output(); }
- XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::write_output()") void writeOutput(FILE* file) { write_output(file); }
-
private:
std::unordered_map<char*, char*> meta_info_;
};
void add_info(char* key, char* value);
void print(FILE* file);
- // deprecated
- XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_characteristic()") void addCharacteristic(char* characteristic)
- {
- add_characteristic(characteristic);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_resources()") void addResources(
- std::vector<sg_host_t>* host_selection)
- {
- add_resources(host_selection);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_info()") void addInfo(char* key, char* value)
- {
- add_info(key, value);
- }
-
private:
std::string name_;
double start_time_;
std::string get_hierarchy_as_string();
void print(FILE *file);
void print_resources(FILE* file);
-
- // deprecated
- XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_child()") void addChild(Container* child) { add_child(child); }
- XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_resources()") void addResources(std::vector<sg_host_t> hosts)
- {
- add_resources(hosts);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Container::create_hierarchy()") void createHierarchy(sg_netzone_t from_as)
- {
- create_hierarchy(from_as);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy()") std::vector<int> getHierarchy()
- {
- return get_hierarchy();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy_as_string()") std::string getHierarchyAsString()
- {
- return get_hierarchy_as_string();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Container::print_resources()") void printResources(FILE* file)
- {
- print_resources(file);
- }
};
class XBT_PUBLIC Subset {
template <class T> Future<T> unwrap_future(Future<Future<T>> future);
-template <class T>
-XBT_ATTRIB_DEPRECATED_v323("Please use bind_promise") void bindPromise(Promise<T> promise, Future<T> future)
-{
- bind_promise(promise, future);
-}
-template <class T>
-XBT_ATTRIB_DEPRECATED_v323("Please use unwrap_future") Future<T> unwrapFuture(Future<Future<T>> future)
-{
- unwrap_future(future);
-}
-
/** Result of some (probably) asynchronous operation in the SimGrid kernel
*
* @ref simgrid::simix::Future and @ref simgrid::simix::Future provide an
return future;
}
- template <class F>
- XBT_ATTRIB_DEPRECATED_v323("Please use then_no_unwrap") auto thenNoUnwrap(F continuation)
- -> Future<decltype(continuation(std::move(*this)))>
- {
- then_no_unwrap(continuation);
- }
-
/** Attach a continuation to this future
*
* The future must be valid in order to make this call.
void get_route_check_params(NetPoint* src, NetPoint* dst);
void add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
std::vector<resource::LinkImpl*>& link_list, bool symmetrical);
-
- // deprecated
- XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::new_extended_route()") virtual RouteCreationArgs* newExtendedRoute(
- RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- std::vector<resource::LinkImpl*>& link_list, bool symmetrical, bool change_order)
- {
- return new_extended_route(hierarchy, src, dst, gw_src, gw_dst, link_list, symmetrical, change_order);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::get_route_check_params()") void getRouteCheckParams(NetPoint* src,
- NetPoint* dst)
- {
- get_route_check_params(src, dst);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::add_route_check_params()") void addRouteCheckParams(
- NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, std::vector<resource::LinkImpl*>& link_list,
- bool symmetrical)
- {
- add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);
- }
};
} // namespace routing
} // namespace kernel
void set_peer_link(NetPoint* netpoint, double bw_in, double bw_out, const std::string& coord);
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
-
- // deprecated
- XBT_ATTRIB_DEPRECATED_v323("Please use VivaldiZone::set_peer_link()") void setPeerLink(NetPoint* netpoint,
- double bw_in, double bw_out,
- std::string coord)
- {
- set_peer_link(netpoint, bw_in, bw_out, coord);
- }
};
namespace vivaldi {
/* ****************************************************************************************** */
/* DO NOT USE this nasty pimple (unless if you're writing a binding) */
-XBT_ATTRIB_DEPRECATED_v323("MSG_process_get_smx_ctx is deprecated. Please contact us if you need it.")
- XBT_PUBLIC smx_context_t MSG_process_get_smx_ctx(msg_process_t process);
XBT_ATTRIB_DEPRECATED_v325("MSG_process_set_copy_callback is deprecated. Please contact us if you need it.") XBT_PUBLIC
void MSG_task_set_copy_callback(void (*callback)(msg_task_t task, msg_process_t src, msg_process_t dst));
#ifndef DOXYGEN
XBT_ATTRIB_DEPRECATED_v324("Please use Activity::wait_for()") virtual void wait(double timeout) = 0;
- XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
- XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_remaining()") double getRemains() { return get_remaining(); }
- XBT_ATTRIB_DEPRECATED_v323("Please use Activity::set_remaining()") Activity* setRemains(double remains)
- {
- return set_remaining(remains);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Activity::set_user_data()") Activity* setUserData(void* data)
- {
- return set_user_data(data);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_user_data()") void* getUserData() { return user_data_; }
#endif
private:
const std::function<void(int, void*)>& fun, void* data);
XBT_ATTRIB_DEPRECATED_v325("Please use Actor::by_pid(pid).kill() instead") static void kill(aid_t pid);
-
- /** @deprecated See Actor::create() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr
- createActor(const char* name, s4u::Host* host, const std::function<void()>& code)
- {
- return create(name, host, code);
- }
- /** @deprecated See Actor::create() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr
- createActor(const char* name, s4u::Host* host, const std::function<void(std::vector<std::string>*)>& code,
- std::vector<std::string>* args)
- {
- return create(name, host, code, args);
- }
- /** @deprecated See Actor::create() */
- template <class F, class... Args, typename = typename std::result_of<F(Args...)>::type>
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr createActor(
- const char* name, s4u::Host* host, F code, Args... args)
- {
- return create(name, host, code, std::move(args)...);
- }
- /** @deprecated See Actor::create() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr createActor(
- const char* name, s4u::Host* host, const char* function, std::vector<std::string> args)
- {
- return create(name, host, function, args);
- }
- /** @deprecated See Actor::is_daemon() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::is_daemon()") bool isDaemon() const;
- /** @deprecated See Actor::get_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_name()") const simgrid::xbt::string& getName() const
- {
- return get_name();
- }
- /** @deprecated See Actor::get_cname() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_cname()") const char* getCname() const { return get_cname(); }
- /** @deprecated See Actor::get_host() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_host()") Host* getHost() { return get_host(); }
- /** @deprecated See Actor::get_pid() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_pid()") aid_t getPid() { return get_pid(); }
- /** @deprecated See Actor::get_ppid() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_ppid()") aid_t getPpid() { return get_ppid(); }
- /** @deprecated See Actor::is_suspended() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::is_suspended()") int isSuspended() { return is_suspended(); }
- /** @deprecated See Actor::set_auto_restart() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_auto_restart()") void setAutoRestart(bool a)
- {
- set_auto_restart(a);
- }
- /** @deprecated Please use a std::function<void(int, void*)> for first parameter */
- XBT_ATTRIB_DEPRECATED_v323("Please use a std::function<void(int, void*)> for first parameter.") void on_exit(
- int_f_pvoid_pvoid_t fun, void* data);
- /** @deprecated See Actor::on_exit() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::on_exit()") void onExit(int_f_pvoid_pvoid_t fun, void* data)
- {
- on_exit([fun, data](bool a) { fun((void*)(uintptr_t)a, data); });
- }
- /** @deprecated See Actor::set_kill_time() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_kill_time()") void setKillTime(double time) { set_kill_time(time); }
- /** @deprecated See Actor::get_kill_time() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_kill_time()") double getKillTime() { return get_kill_time(); }
- /** @deprecated See Actor::by_pid() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::by_pid()") static ActorPtr byPid(aid_t pid) { return by_pid(pid); }
- /** @deprecated See Actor::kill_all() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::kill_all()") static void killAll() { kill_all(); }
- /** @deprecated See Actor::kill_all() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::kill_all() with no parameter") static void killAll(
- int XBT_ATTRIB_UNUSED resetPid)
- {
- kill_all();
- }
- /** @deprecated See Actor::get_impl() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_impl()") kernel::actor::ActorImpl* getImpl() { return get_impl(); }
- /** @deprecated See Actor::get_property() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_property()") const char* getProperty(const char* key)
- {
- return get_property(key);
- }
- /** @deprecated See Actor::get_properties() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_properties()") std::map<std::string, std::string>* getProperties()
- {
- std::map<std::string, std::string>* res = new std::map<std::string, std::string>();
- std::unordered_map<std::string, std::string>* props = get_properties();
- for (auto const& kv : *props)
- res->insert(kv);
- return res;
- }
- /** @deprecated See Actor::get_properties() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_property()") void setProperty(const char* key, const char* value)
- {
- set_property(key, value);
- }
#endif
};
XBT_ATTRIB_DEPRECATED_v325("Please use std::function<void(bool)> for first parameter.") XBT_PUBLIC
void on_exit(const std::function<void(int, void*)>& fun, void* data);
-/** @deprecated Please use std::function<void(int, void*)> for first parameter */
-XBT_ATTRIB_DEPRECATED_v323("Please use std::function<void(bool)> for first parameter.") XBT_PUBLIC
- void on_exit(int_f_pvoid_pvoid_t fun, void* data);
-/** @deprecated See this_actor::get_name() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_name()") XBT_PUBLIC std::string getName();
-/** @deprecated See this_actor::get_cname() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_cname()") XBT_PUBLIC const char* getCname();
-/** @deprecated See this_actor::is_maestro() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::is_maestro()") XBT_PUBLIC bool isMaestro();
-/** @deprecated See this_actor::get_pid() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_pid()") XBT_PUBLIC aid_t getPid();
-/** @deprecated See this_actor::get_ppid() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_ppid()") XBT_PUBLIC aid_t getPpid();
-/** @deprecated See this_actor::get_host() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_host()") XBT_PUBLIC Host* getHost();
-/** @deprecated See this_actor::on_exit() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::on_exit()") XBT_PUBLIC void onExit(int_f_pvoid_pvoid_t fun, void* data);
/** @deprecated See this_actor::exit() */
XBT_ATTRIB_DEPRECATED_v324("Please use this_actor::exit()") XBT_PUBLIC void kill();
#endif
#ifndef DOXYGEN
XBT_ATTRIB_DEPRECATED_v324("Please use Comm::wait_for()") void wait(double t) override { wait_for(t); }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_rate()") Activity* setRate(double rate)
- {
- return set_rate(rate).get();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff)
- {
- return set_src_data(buff).get();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff, size_t size)
- {
- return set_src_data(buff, size).get();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data_size()") Activity* setSrcDataSize(size_t size)
- {
- return set_src_data_size(size).get();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff)
- {
- return set_dst_data(buff).get();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff, size_t size)
- {
- return set_dst_data(buff, size).get();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_dst_data_size()") size_t getDstDataSize()
- {
- return get_dst_data_size();
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") Mailbox* getMailbox() { return get_mailbox(); }
#endif
};
} // namespace s4u
static ConditionVariablePtr create();
-#ifndef DOXYGEN
- /** @deprecated See Comm::get_mailbox() */
- XBT_ATTRIB_DEPRECATED_v323("Please use ConditionVariableImpl::create()") ConditionVariablePtr
- createConditionVariable()
- {
- return create();
- }
-#endif
-
// Wait functions without time:
void wait(MutexPtr lock);
private:
kernel::EngineImpl* const pimpl;
static Engine* instance_;
-
- //////////////// Deprecated functions
-#ifndef DOXYGEN
-public:
- /** @deprecated See Engine::load_platform() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_platform()") void loadPlatform(const std::string& platf)
- {
- load_platform(platf);
- }
- /** @deprecated See Engine::register_function() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_function()") void registerFunction(const std::string& name,
- int (*code)(int, char**))
- {
- register_function(name, code);
- }
- /** @deprecated See Engine::register_default() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_default()") void registerDefault(int (*code)(int, char**))
- {
- register_default(code);
- }
- /** @deprecated See Engine::register_actor() */
- template <class F>
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(const std::string& name)
- {
- register_actor<F>(name);
- }
- /** @deprecated See Engine::register_actor() */
- template <class F>
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(const std::string& name,
- F code)
- {
- register_actor<F>(name, code);
- }
-
- /** @deprecated See Engine::load_deployment() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_deployment()") void loadDeployment(const std::string& deploy)
- {
- load_deployment(deploy);
- }
- /** @deprecated See Engine::host_by_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name()") simgrid::s4u::Host* hostByName(
- const std::string& name)
- {
- return host_by_name(name);
- }
- /** @deprecated See Engine::host_by_name_or_null() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name_or_null()") simgrid::s4u::Host* hostByNameOrNull(
- const std::string& name)
- {
- return host_by_name_or_null(name);
- }
- /** @deprecated See Engine::storage_by_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name()") simgrid::s4u::Storage* storageByName(
- const std::string& name)
- {
- return storage_by_name(name);
- }
- /** @deprecated See Engine::storage_by_name_or_null() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name_or_null()") simgrid::s4u::Storage* storageByNameOrNull(
- const std::string& name)
- {
- return storage_by_name_or_null(name);
- }
-
- /** @deprecated See Engine::get_host_count() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_host_count()") size_t getHostCount() { return get_host_count(); }
- /** @deprecated See Engine::get_all_hosts() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_hosts()") std::vector<Host*> getAllHosts()
- {
- return get_all_hosts();
- }
- /** @deprecated See Engine::get_link_count() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_link_count()") size_t getLinkCount() { return get_link_count(); }
- /** @deprecated See Engine::get_link_list() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_link_list()") std::vector<Link*> getAllLinks()
- {
- return get_all_links();
- }
- /** @deprecated See Engine::get_all_storages() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_storages()") std::vector<Storage*> getAllStorages()
- {
- return get_all_storages();
- }
- /** @deprecated See Engine::get_clock() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_clock()") static double getClock() { return get_clock(); }
- /** @deprecated See Engine::get_all_netpoints() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_netpoints()") void getNetpointList(
- std::vector<simgrid::kernel::routing::NetPoint*>* list);
- /** @deprecated See Engine::netpoint_by_name_or_null() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::netpoint_by_name_or_null()")
- simgrid::kernel::routing::NetPoint* getNetpointByNameOrNull(const std::string& name)
- {
- return netpoint_by_name_or_null(name);
- }
- /** @deprecated See Engine::get_netzone_root() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_netzone_root()") simgrid::s4u::NetZone* getNetRoot()
- {
- return get_netzone_root();
- }
- /** @deprecated See Engine::netzone_by_name_or_null() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::netzone_by_name_or_null()")
- simgrid::s4u::NetZone* getNetzoneByNameOrNull(const std::string& name)
- {
- return netzone_by_name_or_null(name);
- }
- /** @deprecated See Engine::filter_netzones_by_type() */
- template <class T>
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::filter_netzones_by_type()") void getNetzoneByType(
- std::vector<T*>* whereto)
- {
- get_filtered_netzones_recursive(get_netzone_root(), whereto);
- }
-
- /** @deprecated See Engine::get_instance() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_instance()") static s4u::Engine* getInstance()
- {
- return get_instance();
- }
- /** @deprecated See Engine::is_initialized() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::is_initialized()") static bool isInitialized()
- {
- return is_initialized();
- }
- /** @deprecated See Engine::set_config() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Engine::set_config()") void setConfig(const std::string& str)
- {
- set_config(str);
- }
-#endif
};
/** Callback fired when the platform is created (ie, the xml file parsed),
ExecPtr set_timeout(double timeout);
Exec* cancel() override;
- XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_priority()") ExecPtr setPriority(double priority)
- {
- return set_priority(priority);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_bound()") ExecPtr setBound(double bound) { return set_bound(bound); }
XBT_ATTRIB_DEPRECATED_v324("Please use Exec::wait_for()") void wait(double t) override { wait_for(t); }
};
double get_remaining() override;
double get_remaining_ratio() override;
-
-#ifndef DOXYGEN
- //////////////// Deprecated functions
- XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_host()") ExecPtr setHost(Host* host) { return set_host(host); }
- XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_host()") Host* getHost() { return get_host(); }
- XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_remaining_ratio()") double getRemainingRatio()
- {
- return get_remaining_ratio();
- }
-#endif
};
class XBT_PUBLIC ExecPar : public Exec {
void set_state_profile(kernel::profile::Profile* p);
void set_speed_profile(kernel::profile::Profile* p);
-#ifndef DOXYGEN
- /** @deprecated See Host::get_properties() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_properties()") std::map<std::string, std::string>* getProperties()
- {
- std::map<std::string, std::string>* res = new std::map<std::string, std::string>();
- std::unordered_map<std::string, std::string>* props = get_properties();
- for (auto const& kv : *props)
- res->insert(kv);
- return res;
- }
-#endif
-
double get_speed() const;
double get_available_speed() const;
int get_core_count() const;
std::vector<const char*> get_attached_storages() const;
-#ifndef DOXYGEN
- /** @deprecated See Host::get_speed() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_speed() instead.") double getSpeed() { return get_speed(); }
- /** @deprecated See Host::get_pstate_speed() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate_speed() instead.") double getPstateSpeed(int pstate_index)
- {
- return get_pstate_speed(pstate_index);
- }
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_attached_storages() instead.") void getAttachedStorages(
- std::vector<const char*>* storages);
-#endif
-
/** Get an associative list [mount point]->[Storage] of all local mount points.
*
* This is defined in the platform file, and cannot be modified programatically (yet).
*/
std::unordered_map<std::string, Storage*> const& get_mounted_storages();
-#ifndef DOXYGEN
- /** @deprecated See Host::get_mounted_storages() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_mounted_storages() instead.") std::unordered_map<std::string, Storage*> const& getMountedStorages()
- {
- return get_mounted_storages();
- }
-#endif
void route_to(Host* dest, std::vector<Link*>& links, double* latency);
void route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency);
/** Block the calling actor on an execution located on the called host (with explicit priority) */
void execute(double flops, double priority);
- // Deprecated functions
-#ifndef DOXYGEN
- /** @deprecated See Host::get_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_name()") simgrid::xbt::string const& getName() const
- {
- return name_;
- }
- /** @deprecated See Host::get_cname() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_cname()") const char* getCname() const { return name_.c_str(); }
- /** @deprecated See Host::get_all_actors() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_all_actors()") void actorList(std::vector<ActorPtr>* whereto);
- /** @deprecated See Host::get_all_actors() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_all_actors()") void getProcesses(std::vector<ActorPtr>* list);
- /** @deprecated See Host::turn_on() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::turn_on()") void turnOn() { turn_on(); }
- /** @deprecated See Host::turn_off() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::turn_off()") void turnOff() { turn_off(); }
- /** @deprecated See Host::is_on() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_on()") bool isOn() { return is_on(); }
- /** @deprecated See Host::is_off() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_off()") bool isOff() { return not is_on(); }
- /** @deprecated See Host::get_property() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_property()") const char* getProperty(const char* key)
- {
- return get_property(key);
- }
- /** @deprecated See Host::set_property() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_property()") void setProperty(const std::string& key,
- const std::string& value)
- {
- set_property(key, value);
- }
- /** @deprecated See Host::set_pstate() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_pstate()") void setPstate(int idx) { set_pstate(idx); }
- /** @deprecated See Host::get_pstate() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate()") int getPstate() { return get_pstate(); }
- /** @deprecated See Host::route_to() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::route_to()") void routeTo(Host* dest, std::vector<Link*>& links,
- double* latency)
- {
- route_to(dest, links, latency);
- }
- /** @deprecated See Host::route_to() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::route_to()") void routeTo(
- Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency)
- {
- route_to(dest, links, latency);
- }
- /** @deprecated See Host::get_core_count() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_core_count()") int getCoreCount() { return get_core_count(); }
- /** @deprecated See Host::get_pstate_count() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate_count()") int getPstatesCount() const
- {
- return get_pstate_count();
- }
-#endif /* !DOXYGEN */
-
private:
xbt::string name_{"noname"};
std::unordered_map<std::string, Storage*>* mounts_ = nullptr; // caching
/** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
static xbt::signal<void(kernel::resource::NetworkAction&, kernel::resource::Action::State)>
on_communication_state_change;
-
-#ifndef DOXYGEN
- // Deprecated methods
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::by_name()") static Link* byName(const char* name) { return by_name(name); }
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_name()") const std::string& getName() const { return get_name(); }
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_cname()") const char* getCname() const { return get_cname(); }
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_sharing_policy()") SharingPolicy sharingPolicy() {return get_sharing_policy();}
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_usage()") double getUsage() {return get_usage();}
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::is_used()") bool isUsed() {return is_used();}
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_bandwidth()") double bandwidth() {return get_bandwidth();}
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_latency()") double latency() {return get_latency();}
-
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::turn_on()") void turnOn() {turn_on();}
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::turn_off()") void turnOff() {turn_off();}
-
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_property()") const char* getProperty(const char* key) {return get_property(key);}
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::set_property()") void setProperty(const std::string& key,
- const std::string& value)
- {
- set_property(key, value);
- }
-
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_data()") void* getData() {return get_data();}
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::set_data()") void setData(void* d) {set_data(d);}
-
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_state_profile()") void setStateTrace(
- kernel::profile::Profile* profile)
- {
- set_state_profile(profile);
- }
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_bandwidth_profile()") void setBandwidthTrace(
- kernel::profile::Profile* profile)
- {
- set_bandwidth_profile(profile);
- }
- /** @deprecated */
- XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_latency_profile()") void setLatencyTrace(
- kernel::profile::Profile* profile)
- {
- set_latency_profile(profile);
- }
-#endif
};
} // namespace s4u
} // namespace simgrid
void* get(); // FIXME: make a typed template version
/** Blocking data reception with timeout */
void* get(double timeout);
-
- // Deprecated functions
-#ifndef DOXYGEN
- /** @deprecated Mailbox::set_receiver() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::set_receiver()") void setReceiver(ActorPtr actor)
- {
- set_receiver(actor);
- }
- /** @deprecated Mailbox::get_receiver() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_receiver()") ActorPtr getReceiver() { return get_receiver(); }
- /** @deprecated Mailbox::get_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_name()") const xbt::string& getName() const { return get_name(); }
- /** @deprecated Mailbox::get_cname() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_cname()") const char* getCname() const { return get_cname(); }
- /** @deprecated Mailbox::get_impl() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_impl()") kernel::activity::MailboxImpl* getImpl()
- {
- return get_impl();
- }
- /** @deprecated Mailbox::by_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::by_name()") static Mailbox* byName(const char* name)
- {
- return by_name(name);
- }
- /** @deprecated Mailbox::by_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::by_name()") static Mailbox* byName(const std::string& name)
- {
- return by_name(name);
- }
-#endif
};
} // namespace s4u
void lock();
void unlock();
bool try_lock();
-
-#ifndef DOXYGEN
- // deprecated
- /** @deprecated Mutex::create() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Mutex::create()") static MutexPtr createMutex() { return create(); }
-#endif
};
} // namespace s4u
on_route_creation;
static xbt::signal<void(NetZone const&)> on_creation;
static xbt::signal<void(NetZone const&)> on_seal;
-
-#ifndef DOXYGEN
- // Deprecation wrappers
- /** @deprecated NetZone::get_father() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_father()") NetZone* getFather() { return get_father(); }
- /** @deprecated NetZone::get_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_name()") const std::string& getName() const { return get_name(); }
- /** @deprecated NetZone::get_cname() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_cname()") const char* getCname() const { return get_cname(); }
- /** @deprecated NetZone::add_route() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_route()") void addRoute(
- kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
- kernel::routing::NetPoint* gw_dst, std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical)
- {
- add_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
- }
- /** @deprecated NetZone::add_bypass_route() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_bypass_route()") void addBypassRoute(
- kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
- kernel::routing::NetPoint* gw_dst, std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical)
- {
- add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
- }
- /** @deprecated NetZone::get_properties() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_properties()") std::unordered_map<std::string, std::string>* getProperties()
- {
- return get_properties();
- }
- /** @deprecated NetZone::get_property() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_property()") const char* getProperty(const char* key)
- {
- return get_property(key);
- }
- /** @deprecated NetZone::set_property() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::set_property()") void setProperty(const char* key, const char* value)
- {
- set_property(key, value);
- }
- /** @deprecated NetZone::add_component() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_component()") int addComponent(kernel::routing::NetPoint* elm)
- {
- return add_component(elm);
- }
- /** @deprecated NetZone::get_vertices() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_vertices()") std::vector<kernel::routing::NetPoint*> getVertices();
- /** @deprecated NetZone::get_host_count() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_host_count()") int getHostCount() { return get_host_count(); }
- /** @deprecated NetZone::get_all_hosts() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_all_hosts()") void getHosts(
- std::vector<s4u::Host*>* whereto); // retrieve my content as a vector of hosts
- /** @deprecated NetZone::get_children() */
- XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_children()") std::vector<NetZone*>* getChildren()
- {
- std::vector<NetZone*>* res = new std::vector<NetZone*>();
- for (auto child : get_children())
- res->push_back(child);
- return res;
- }
-#endif
};
} // namespace s4u
sg_size_t write(sg_size_t size);
kernel::resource::StorageImpl* get_impl() { return pimpl_; }
- // Deprecated functions
-#ifndef DOXYGEN
- /** @deprecated Storage::by_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::by_name()") Storage* byName(const std::string& name)
- {
- return by_name(name);
- }
- /** @deprecated Storage::get_name() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_name()") std::string const& getName() const { return get_name(); }
- /** @deprecated Storage::get_cname() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_cname()") const char* getCname() const { return get_cname(); }
- /** @deprecated Storage::get_type() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_type()") const char* getType() { return get_type(); }
- /** @deprecated Storage::get_host() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_host()") Host* getHost() { return get_host(); }
- /** @deprecated Storage::get_properties() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_properties()") std::map<std::string, std::string>* getProperties()
- {
- std::map<std::string, std::string>* res = new std::map<std::string, std::string>();
- std::unordered_map<std::string, std::string>* props = get_properties();
- for (auto const& kv : *props)
- res->insert(kv);
- return res;
- }
- /** @deprecated Storage::get_property() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_property()") const char* getProperty(const char* key)
- {
- return get_property(key);
- }
- /** @deprecated Storage::set_property() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::set_property()") void setProperty(const std::string& key,
- const std::string& value)
- {
- set_property(key, value);
- }
- /** @deprecated Storage::set_data() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::set_data()") void setUserdata(void* data) { set_data(data); }
- /** @deprecated Storage::get_data() */
- XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_data()") void* getUserdata() { return get_data(); }
-#endif
-
private:
Host* attached_to_ = nullptr;
kernel::resource::StorageImpl* const pimpl_;
static xbt::signal<void(VirtualMachine const&)> on_resume;
static xbt::signal<void(VirtualMachine const&)> on_migration_start;
static xbt::signal<void(VirtualMachine const&)> on_migration_end;
-
-#ifndef DOXYGEN
- // Deprecated methods
- /** @deprecated See VirtualMachine::get_state() */
- XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_state()") VirtualMachine::state getState()
- {
- return get_state();
- }
- /** @deprecated See VirtualMachine::get_impl() */
- XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_impl()") vm::VirtualMachineImpl* getImpl()
- {
- return pimpl_vm_;
- }
- /** @deprecated See VirtualMachine::get_pm() */
- XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_pm()") Host* getPm() { return get_pm(); }
- /** @deprecated See VirtualMachine::set_pm() */
- XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_pm()") void setPm(Host* pm) { set_pm(pm); }
- /** @deprecated See VirtualMachine::get_ramsize() */
- XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_ramsize()") size_t getRamsize() { return get_ramsize(); }
- /** @deprecated See VirtualMachine::set_ramsize() */
- XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_ramsize()") void setRamsize(size_t ramsize)
- {
- set_ramsize(ramsize);
- }
- /** @deprecated See VirtualMachine::set_bound() */
- XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_bound()") void setBound(double bound) { set_bound(bound); }
-#endif
};
} // namespace s4u
} // namespace simgrid
});
return result.get();
}
-template <class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use simix::kernel_sync()") auto kernelSync(F code) -> decltype(code().get())
-{
- return kernel_sync(code);
-}
/** A blocking (`wait()`-based) future for SIMIX processes */
// TODO, .wait_for()
// Wrap the kernel future in a actor future:
return simgrid::simix::Future<T>(std::move(future));
}
-template <class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use simix::kernel_sync()") auto kernelAsync(F code) -> Future<decltype(code().get())>
-{
- return kernel_async(code);
-}
}
}
#define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg)))
#endif
-#define XBT_ATTRIB_DEPRECATED_v323(mesg) \
- XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.23)") /* Will be dropped in v3.23 */
#define XBT_ATTRIB_DEPRECATED_v324(mesg) \
XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.24)") /* Will be dropped in v3.24 */
#define XBT_ATTRIB_DEPRECATED_v325(mesg) \
SG_BEGIN_DECL()
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_parse") XBT_PUBLIC
- void xbt_cfg_set_parse(const char* options);
-
/* Set the value of the cell @a name in @a cfg with the provided value.*/
XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<int>") XBT_PUBLIC
void xbt_cfg_set_int(const char* name, int val);
void xbt_cfg_set_boolean(const char* name, const char* val);
XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<std::string>") XBT_PUBLIC
void xbt_cfg_set_string(const char* name, const char* val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_as_string") XBT_PUBLIC
- void xbt_cfg_set_as_string(const char* name, const char* val);
-
-/*
- Set the default value of the cell @a name in @a cfg with the provided value.
- If it was already set to something (possibly from the command line), do nothing.
- */
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<int>") XBT_PUBLIC
- void xbt_cfg_setdefault_int(const char* name, int val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<double>") XBT_PUBLIC
- void xbt_cfg_setdefault_double(const char* name, double val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<bool>") XBT_PUBLIC
- void xbt_cfg_setdefault_boolean(const char* name, const char* val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<std::string>") XBT_PUBLIC
- void xbt_cfg_setdefault_string(const char* name, const char* val);
-
-/** @brief Return if configuration is set by default*/
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::is_default") XBT_PUBLIC
- int xbt_cfg_is_default_value(const char* name);
/* @} */
/** @brief Callback types. They get the name of the modified entry, and the position of the changed value */
typedef void (*xbt_cfg_cb_t)(const char* name);
-XBT_ATTRIB_DEPRECATED_v323("Please don't use it") XBT_PUBLIC xbt_cfg_t xbt_cfg_new();
-XBT_ATTRIB_DEPRECATED_v323("Please don't use it") XBT_PUBLIC void xbt_cfg_free(xbt_cfg_t* cfg);
-XBT_ATTRIB_DEPRECATED_v323("Please don't use it") XBT_PUBLIC
- void xbt_cfg_dump(const char* name, const char* indent, xbt_cfg_t cfg);
-
/** @} */
-/** @defgroup XBT_cfg_register Registering stuff
- * @ingroup XBT_config
- *
- * This how to add new variables to an existing configuration set. Use it to make your code configurable.
- *
- * @{
- */
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<double>") XBT_PUBLIC
- void xbt_cfg_register_double(const char* name, double default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<int>") XBT_PUBLIC
- void xbt_cfg_register_int(const char* name, int default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<std::string>") XBT_PUBLIC
- void xbt_cfg_register_string(const char* name, const char* default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<bool>") XBT_PUBLIC
- void xbt_cfg_register_boolean(const char* name, const char* default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::alias") XBT_PUBLIC
- void xbt_cfg_register_alias(const char* newname, const char* oldname);
-
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::show_aliases") XBT_PUBLIC void xbt_cfg_aliases();
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::help") XBT_PUBLIC void xbt_cfg_help();
-
-/* @} */
/** @defgroup XBT_cfg_get Getting the stored values
* @ingroup XBT_config
*
XBT_PUBLIC void help();
}
}
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_value<std::string>") XBT_PUBLIC std::string
- xbt_cfg_get_string(const char* name);
#endif
return Task<decltype(code(std::move(args)...))()>(std::move(task));
}
-// Deprecated
-template <class F, class... Args>
-XBT_ATTRIB_DEPRECATED_v323("Please use make_task()") auto makeTask(F code, Args... args)
- -> Task<decltype(code(std::move(args)...))()>
-{
- TaskImpl<F, Args...> task(std::move(code), std::make_tuple(std::move(args)...));
- return Task<decltype(code(std::move(args)...))()>(std::move(task));
-}
-
} // namespace xbt
} // namespace simgrid
#endif
promise.set_exception(std::current_exception());
}
}
-template <class R, class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use xbt::fulfill_promise()") auto fulfillPromise(R& promise, F&& code)
- -> decltype(promise.set_value(code()))
-{
- try {
- promise.set_value(std::forward<F>(code)());
- }
- catch(...) {
- promise.set_exception(std::current_exception());
- }
-}
template <class P, class F> auto fulfill_promise(P& promise, F&& code) -> decltype(promise.set_value())
{
promise.set_exception(std::current_exception());
}
}
-template <class P, class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use xbt::fulfill_promise()") auto fulfillPromise(P& promise, F&& code)
- -> decltype(promise.set_value())
-{
- try {
- std::forward<F>(code)();
- promise.set_value();
- }
- catch(...) {
- promise.set_exception(std::current_exception());
- }
-}
/** Set a promise/result from a future/result
*
XBT_PUBLIC void log_exception(e_xbt_log_priority_t priority, const char* context, std::exception const& exception);
XBT_PUBLIC void install_exception_handler();
-
-// deprecated
-XBT_ATTRIB_DEPRECATED_v323("xbt::log_exception()") XBT_PUBLIC void logException(e_xbt_log_priority_t priority, const char* context, std::exception const& exception);
-XBT_ATTRIB_DEPRECATED_v323("xbt::install_exception_handler()") XBT_PUBLIC void installExceptionHandler();
}
}
}
void disconnect_slots() { handlers_.clear(); }
int get_slot_count() { return handlers_.size(); }
- // deprecated
- XBT_ATTRIB_DEPRECATED_v323("Please use xbt::disconnect_slots)") void disconnectSlots() { disconnect_slots(); }
- XBT_ATTRIB_DEPRECATED_v323("Please use xbt::get_slot_count)") int getSlotsAmount() { return get_slot_count(); }
};
}
return SIMIX_process_self()->ciface();
}
-smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { // deprecated -- smx_context_t should die afterward
- return process->get_impl()->context_.get();
-}
/** @brief Add a function to the list of "on_exit" functions for the current process.
* The on_exit functions are the functions executed when your process is killed.
* You should use them to free the data used by your process.
});
}
-void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
-{
- on_exit([fun, data](bool failed) {
- intptr_t status = failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
- fun(reinterpret_cast<void*>(status), data);
- });
-}
-
void Actor::on_exit(const std::function<void(int, void*)>& fun, void* data) /* deprecated */
{
on_exit([fun, data](bool failed) { fun(failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS, data); });
SIMIX_process_self()->iface()->migrate(new_host);
}
-std::string getName() /* deprecated */
-{
- return get_name();
-}
-const char* getCname() /* deprecated */
-{
- return get_cname();
-}
-bool isMaestro() /* deprecated */
-{
- return is_maestro();
-}
-aid_t getPid() /* deprecated */
-{
- return get_pid();
-}
-aid_t getPpid() /* deprecated */
-{
- return get_ppid();
-}
-Host* getHost() /* deprecated */
-{
- return get_host();
-}
-void on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
-{
- SIMIX_process_self()->iface()->on_exit([fun, data](int a) { fun((void*)(intptr_t)a, data); });
-}
-void onExit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
-{
- on_exit([fun, data](int a) { fun((void*)(intptr_t)a, data); });
-}
void kill() /* deprecated */
{
exit();
return netp == pimpl->netpoints_.end() ? nullptr : netp->second;
}
-/** @brief Fill the provided vector with all existing netpoints */
-void Engine::getNetpointList(std::vector<kernel::routing::NetPoint*>* list)
-{
- for (auto const& kv : pimpl->netpoints_)
- list->push_back(kv.second);
-}
std::vector<kernel::routing::NetPoint*> Engine::get_all_netpoints()
{
std::vector<kernel::routing::NetPoint*> res;
return pimpl_->get_actor_count();
}
-/** @deprecated */
-void Host::getProcesses(std::vector<ActorPtr>* list)
-{
- auto actors = get_all_actors();
- for (auto& actor : actors)
- list->push_back(actor);
-}
-
-/** @deprecated */
-void Host::actorList(std::vector<ActorPtr>* whereto)
-{
- auto actors = get_all_actors();
- for (auto& actor : actors)
- whereto->push_back(actor);
-}
-
/**
* @brief Find a route toward another host
*
return simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
}
-void Host::getAttachedStorages(std::vector<const char*>* storages)
-{
- std::vector<const char*> local_storages = simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
- for (auto elm : local_storages)
- storages->push_back(elm);
-}
-
std::unordered_map<std::string, Storage*> const& Host::get_mounted_storages()
{
if (mounts_ == nullptr) {
return pimpl_->get_all_hosts();
}
-void NetZone::getHosts(std::vector<Host*>* whereto)
-{
- for (auto const& card : pimpl_->get_vertices()) {
- Host* host = Host::by_name_or_null(card->get_name());
- if (host != nullptr)
- whereto->push_back(host);
- }
-}
-
int NetZone::get_host_count()
{
return pimpl_->get_host_count();
{
pimpl_->add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
}
-std::vector<kernel::routing::NetPoint*> NetZone::getVertices()
-{
- return pimpl_->get_vertices();
-}
} // namespace s4u
} // namespace simgrid
}
}
-// ***** C bindings *****
-
-xbt_cfg_t xbt_cfg_new()
-{
- return new simgrid::config::Config();
-}
-void xbt_cfg_free(xbt_cfg_t * cfg) { delete *cfg; }
-
-void xbt_cfg_dump(const char *name, const char *indent, xbt_cfg_t cfg)
-{
- cfg->dump(name, indent);
-}
-
-/*----[ Registering stuff ]-----------------------------------------------*/
-
-void xbt_cfg_register_double(const char *name, double default_value,
- xbt_cfg_cb_t cb_set, const char *desc)
-{
- if (simgrid_config == nullptr)
- simgrid_config = new simgrid::config::Config();
- simgrid_config->register_option<double>(name, desc, default_value, cb_set);
-}
-
-void xbt_cfg_register_int(const char *name, int default_value,xbt_cfg_cb_t cb_set, const char *desc)
-{
- if (simgrid_config == nullptr)
- simgrid_config = new simgrid::config::Config();
- simgrid_config->register_option<int>(name, desc, default_value, cb_set);
-}
-
-void xbt_cfg_register_string(const char *name, const char *default_value, xbt_cfg_cb_t cb_set, const char *desc)
-{
- if (simgrid_config == nullptr)
- simgrid_config = new simgrid::config::Config();
- simgrid_config->register_option<std::string>(name, desc, default_value ? default_value : "", cb_set);
-}
-
-void xbt_cfg_register_boolean(const char *name, const char*default_value,xbt_cfg_cb_t cb_set, const char *desc)
-{
- if (simgrid_config == nullptr)
- simgrid_config = new simgrid::config::Config();
- simgrid_config->register_option<bool>(name, desc, simgrid::config::parse_bool(default_value), cb_set);
-}
-
-void xbt_cfg_register_alias(const char *realname, const char *aliasname)
-{
- if (simgrid_config == nullptr)
- simgrid_config = new simgrid::config::Config();
- simgrid_config->alias(realname, aliasname);
-}
-
-void xbt_cfg_aliases()
-{
- simgrid_config->show_aliases();
-}
-void xbt_cfg_help()
-{
- simgrid_config->help();
-}
-
/*----[ Setting ]---------------------------------------------------------*/
-/** @brief Add values parsed from a string into a config set
- *
- * @param options a string containing the content to add to the config set. This is a '\\t',' ' or '\\n' or ','
- * separated list of variables. Each individual variable is like "[name]:[value]" where [name] is the name of an
- * already registered variable, and [value] conforms to the data type under which this variable was registered.
- *
- * @todo This is a crude manual parser, it should be a proper lexer.
- */
-void xbt_cfg_set_parse(const char *options)
-{
- if (options && strlen(options) > 0)
- simgrid::config::set_parse(std::string(options));
-}
-
-/** @brief Set the value of a variable, using the string representation of that value
- *
- * @param key name of the variable to modify
- * @param value string representation of the value to set
- */
-
-void xbt_cfg_set_as_string(const char *key, const char *value)
-{
- (*simgrid_config)[key].set_string_value(value);
-}
-
-/** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_int(const char *key, int value)
-{
- (*simgrid_config)[key].set_default_value<int>(value);
-}
-
-/** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_double(const char *key, double value)
-{
- (*simgrid_config)[key].set_default_value<double>(value);
-}
-
-/** @brief Set a string value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_string(const char *key, const char *value)
-{
- (*simgrid_config)[key].set_default_value<std::string>(value ? value : "");
-}
-
-/** @brief Set an boolean value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_boolean(const char *key, const char *value)
-{
- (*simgrid_config)[key].set_default_value<bool>(simgrid::config::parse_bool(value));
-}
-
/** @brief Set an integer value to \a name within \a cfg
*
* @param key the name of the variable
(*simgrid_config)[key].set_value<bool>(simgrid::config::parse_bool(value));
}
-
-/* Say if the value is the default value */
-int xbt_cfg_is_default_value(const char *key)
-{
- return (*simgrid_config)[key].is_default() ? 1 : 0;
-}
-
/*----[ Getting ]---------------------------------------------------------*/
/** @brief Retrieve an integer value of a variable (get a warning if not uniq)
*
return (*simgrid_config)[key].get_value<double>();
}
-/** @brief Retrieve a string value of a variable (get a warning if not uniq)
- *
- * @param key the name of the variable
- *
- * Returns the first value from the config set under the given name.
- * If there is more than one value, it will issue a warning.
- * Returns nullptr if there is no value.
- *
- * \warning the returned value is the actual content of the config set
- */
-std::string xbt_cfg_get_string(const char* key)
-{
- return (*simgrid_config)[key].get_value<std::string>();
-}
-
/** @brief Retrieve a boolean value of a variable (get a warning if not uniq)
*
* @param key the name of the variable
previous_terminate_handler = std::set_terminate(handler);
});
}
-// deprecated
-void logException(e_xbt_log_priority_t priority, const char* context, std::exception const& exception)
-{
- log_exception(priority, context, exception);
-}
-void installExceptionHandler()
-{
- install_exception_handler();
-}
} // namespace xbt
} // namespace simgrid