~TimeoutException() override;
};
-XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::TimeoutException") typedef TimeoutException TimeoutError;
+using TimeoutError XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::TimeoutException") = TimeoutException;
/** Exception raised when a host fails */
class HostFailureException : public Exception {
} // namespace simgrid
-XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::Exception") typedef simgrid::Exception xbt_ex;
+using xbt_ex XBT_ATTRIB_DEPRECATED_v328("Please use simgrid::Exception") = simgrid::Exception;
#endif
class EngineImpl;
namespace actor {
class ActorImpl;
-typedef boost::intrusive_ptr<ActorImpl> ActorImplPtr;
+using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
// What's executed as an actor code:
-typedef std::function<void()> ActorCode;
+using ActorCode = std::function<void()>;
// Create an ActorCode from the parameters parsed in the XML file (or elsewhere)
-typedef std::function<ActorCode(std::vector<std::string> args)> ActorCodeFactory;
+using ActorCodeFactory = std::function<ActorCode(std::vector<std::string> args)>;
} // namespace actor
namespace activity {
class ActivityImpl;
enum class State;
- typedef boost::intrusive_ptr<ActivityImpl> ActivityImplPtr;
+ using ActivityImplPtr = boost::intrusive_ptr<ActivityImpl>;
XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
class ConditionVariableImpl;
class CommImpl;
- typedef boost::intrusive_ptr<CommImpl> CommImplPtr;
+ using CommImplPtr = boost::intrusive_ptr<CommImpl>;
class ExecImpl;
- typedef boost::intrusive_ptr<ExecImpl> ExecImplPtr;
+ using ExecImplPtr = boost::intrusive_ptr<ExecImpl>;
class IoImpl;
- typedef boost::intrusive_ptr<IoImpl> IoImplPtr;
+ using IoImplPtr = boost::intrusive_ptr<IoImpl>;
class MutexImpl;
- typedef boost::intrusive_ptr<MutexImpl> MutexImplPtr;
+ using MutexImplPtr = boost::intrusive_ptr<MutexImpl>;
class RawImpl;
- typedef boost::intrusive_ptr<RawImpl> RawImplPtr;
+ using RawImplPtr = boost::intrusive_ptr<RawImpl>;
class SemaphoreImpl;
- typedef boost::intrusive_ptr<SemaphoreImpl> SemaphoreImplPtr;
+ using SemaphoreImplPtr = boost::intrusive_ptr<SemaphoreImpl>;
class SleepImpl;
- typedef boost::intrusive_ptr<SleepImpl> SleepImplPtr;
+ using SleepImplPtr = boost::intrusive_ptr<SleepImpl>;
class MailboxImpl;
}
} // namespace vm
} // namespace simgrid
-typedef simgrid::s4u::Actor s4u_Actor;
-typedef simgrid::s4u::Barrier s4u_Barrier;
-typedef simgrid::s4u::Comm s4u_Comm;
-typedef simgrid::s4u::Exec s4u_Exec;
-typedef simgrid::s4u::Host s4u_Host;
-typedef simgrid::s4u::Link s4u_Link;
-typedef simgrid::s4u::File s4u_File;
-typedef simgrid::s4u::ConditionVariable s4u_ConditionVariable;
-typedef simgrid::s4u::Mailbox s4u_Mailbox;
-typedef simgrid::s4u::Mutex s4u_Mutex;
-typedef simgrid::s4u::Semaphore s4u_Semaphore;
-typedef simgrid::s4u::Disk s4u_Disk;
-typedef simgrid::s4u::Storage s4u_Storage;
-typedef simgrid::s4u::NetZone s4u_NetZone;
-typedef simgrid::s4u::VirtualMachine s4u_VM;
-
-typedef simgrid::simix::Timer* smx_timer_t;
-typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
-typedef simgrid::kernel::activity::ActivityImpl* smx_activity_t;
-typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
-typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
-typedef simgrid::kernel::activity::MutexImpl* smx_mutex_t;
-typedef simgrid::kernel::activity::SemaphoreImpl* smx_sem_t;
-XBT_ATTRIB_DEPRECATED_v330("Please use kernel::activity::State") typedef simgrid::kernel::activity::State e_smx_state_t;
+using s4u_Actor = simgrid::s4u::Actor;
+using s4u_Barrier = simgrid::s4u::Barrier;
+using s4u_Comm = simgrid::s4u::Comm;
+using s4u_Exec = simgrid::s4u::Exec;
+using s4u_Host = simgrid::s4u::Host;
+using s4u_Link = simgrid::s4u::Link;
+using s4u_File = simgrid::s4u::File;
+using s4u_ConditionVariable = simgrid::s4u::ConditionVariable;
+using s4u_Mailbox = simgrid::s4u::Mailbox;
+using s4u_Mutex = simgrid::s4u::Mutex;
+using s4u_Semaphore = simgrid::s4u::Semaphore;
+using s4u_Disk = simgrid::s4u::Disk;
+using s4u_Storage = simgrid::s4u::Storage;
+using s4u_NetZone = simgrid::s4u::NetZone;
+using s4u_VM = simgrid::s4u::VirtualMachine;
+
+using smx_timer_t = simgrid::simix::Timer*;
+using smx_actor_t = simgrid::kernel::actor::ActorImpl*;
+using smx_activity_t = simgrid::kernel::activity::ActivityImpl*;
+using smx_cond_t = simgrid::kernel::activity::ConditionVariableImpl*;
+using smx_mailbox_t = simgrid::kernel::activity::MailboxImpl*;
+using smx_mutex_t = simgrid::kernel::activity::MutexImpl*;
+using smx_sem_t = simgrid::kernel::activity::SemaphoreImpl*;
+using e_smx_state_t XBT_ATTRIB_DEPRECATED_v330("Please use kernel::activity::State") = simgrid::kernel::activity::State;
#else
typedef struct s4u_Actor s4u_Actor;
} // namespace jedule
} // namespace simgrid
-typedef simgrid::jedule::Jedule *jedule_t;
+using jedule_t = simgrid::jedule::Jedule*;
#endif /* JEDULE_HPP_ */
}
}
-typedef simgrid::jedule::Event* jed_event_t;
+using jed_event_t = simgrid::jedule::Event*;
#endif /* JEDULE_EVENTS_H_ */
} // namespace jedule
} // namespace simgrid
-typedef simgrid::jedule::Container * jed_container_t;
+using jed_container_t = simgrid::jedule::Container*;
void get_resource_selection_by_hosts(std::vector<simgrid::jedule::Subset>& subset_list,
const std::vector<sg_host_t>& host_list);
*/
template <class F> auto then_no_unwrap(F continuation) -> Future<decltype(continuation(std::move(*this)))>
{
- typedef decltype(continuation(std::move(*this))) R;
+ using R = decltype(continuation(std::move(*this)));
if (state_ == nullptr)
throw std::future_error(std::future_errc::no_state);
auto state = std::move(state_);
namespace kernel {
namespace resource {
-typedef std::pair<double, Action*> heap_element_type;
-typedef boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_size<false>, boost::heap::stable<true>,
- boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>
- heap_type;
+using heap_element_type = std::pair<double, Action*>;
+using heap_type =
+ boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_size<false>, boost::heap::stable<true>,
+ boost::heap::compare<simgrid::xbt::HeapComparator<heap_element_type>>>;
-typedef std::pair<double, Action*> heap_element_type;
class XBT_PUBLIC ActionHeap : public heap_type {
friend Action;
/* Lazy update needs this Set hook to maintain a list of the tracked actions */
boost::intrusive::list_member_hook<> modified_set_hook_;
bool is_within_modified_set() const { return modified_set_hook_.is_linked(); }
- typedef boost::intrusive::list<
- Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>
- ModifiedSet;
+ using ModifiedSet = boost::intrusive::list<
+ Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_>>;
boost::intrusive::list_member_hook<> state_set_hook_;
- typedef boost::intrusive::list<
- Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>
- StateSet;
+ using StateSet = boost::intrusive::list<
+ Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_>>;
enum class State {
INITED, /**< Created, but not started yet */
class Task;
}
}
-typedef simgrid::msg::Comm sg_msg_Comm;
-typedef simgrid::msg::Task sg_msg_Task;
+using sg_msg_Comm = simgrid::msg::Comm;
+using sg_msg_Task = simgrid::msg::Task;
#else
typedef struct msg_Comm sg_msg_Comm;
typedef struct msg_Task sg_msg_Task;
// If we are in the application, pass the code to the maestro which
// executes it for us and reports the result. We use a std::future which
// conveniently handles the success/failure value for us.
- typedef typename std::result_of<F()>::type R;
+ using R = typename std::result_of<F()>::type;
simgrid::xbt::Result<R> result;
simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); }, t);
return result.get();
namespace simgrid {
namespace simix {
-
-typedef std::pair<double, Timer*> TimerQelt;
+using TimerQelt = std::pair<double, Timer*>;
static boost::heap::fibonacci_heap<TimerQelt, boost::heap::compare<xbt::HeapComparator<TimerQelt>>> simix_timers;
/** @brief Timer datatype */
*/
template <class F> auto kernel_sync(F code) -> decltype(code().get())
{
- typedef decltype(code().get()) T;
+ using T = decltype(code().get());
if (SIMIX_is_maestro())
xbt_die("Can't execute blocking call in kernel mode");
*/
template <class F> auto kernel_async(F code) -> Future<decltype(code().get())>
{
- typedef decltype(code().get()) T;
+ using T = decltype(code().get());
// Execute the code in the kernel and get the kernel future:
simgrid::kernel::Future<T> future = simgrid::kernel::actor::simcall(std::move(code));
}
}
-typedef simgrid::smpi::Comm SMPI_Comm;
-typedef simgrid::smpi::Datatype SMPI_Datatype;
-typedef simgrid::smpi::Errhandler SMPI_Errhandler;
-typedef simgrid::smpi::File SMPI_File;
-typedef simgrid::smpi::Group SMPI_Group;
-typedef simgrid::smpi::Info SMPI_Info;
-typedef simgrid::smpi::Op SMPI_Op;
-typedef simgrid::smpi::Request SMPI_Request;
-typedef simgrid::smpi::Topo SMPI_Topology;
-typedef simgrid::smpi::Topo_Cart SMPI_Cart_topology;
-typedef simgrid::smpi::Topo_Dist_Graph SMPI_Dist_Graph_topology;
-typedef simgrid::smpi::Topo_Graph SMPI_Graph_topology;
-typedef simgrid::smpi::Win SMPI_Win;
+using SMPI_Comm = simgrid::smpi::Comm;
+using SMPI_Datatype = simgrid::smpi::Datatype;
+using SMPI_Errhandler = simgrid::smpi::Errhandler;
+using SMPI_File = simgrid::smpi::File;
+using SMPI_Group = simgrid::smpi::Group;
+using SMPI_Info = simgrid::smpi::Info;
+using SMPI_Op = simgrid::smpi::Op;
+using SMPI_Request = simgrid::smpi::Request;
+using SMPI_Topology = simgrid::smpi::Topo;
+using SMPI_Cart_topology = simgrid::smpi::Topo_Cart;
+using SMPI_Dist_Graph_topology = simgrid::smpi::Topo_Dist_Graph;
+using SMPI_Graph_topology = simgrid::smpi::Topo_Graph;
+using SMPI_Win = simgrid::smpi::Win;
#else
/** @brief Configuration set's data type is opaque. */
#ifdef __cplusplus
#include <xbt/config.hpp>
-typedef simgrid::config::Config* xbt_cfg_t;
+using xbt_cfg_t = simgrid::config::Config*;
#else
typedef void* xbt_cfg_t;
#endif
struct whatever {};
// Union used for storage:
- typedef typename std::aligned_union<0,
- void*,
- std::pair<void(*)(),void*>,
- std::pair<void(whatever::*)(), whatever*>
- >::type TaskUnion;
+ using TaskUnion = typename std::aligned_union<0, void*, std::pair<void (*)(), void*>,
+ std::pair<void (whatever::*)(), whatever*>>::type;
// Is F suitable for small buffer optimization?
template<class F>
"SBO not working for reference_wrapper");
// Call (and possibly destroy) the function:
- typedef R (*call_function)(TaskUnion&, Args...);
+ using call_function = R (*)(TaskUnion&, Args...);
// Destroy the function (of needed):
- typedef void (*destroy_function)(TaskUnion&);
+ using destroy_function = void (*)(TaskUnion&);
// Move the function (otherwise memcpy):
- typedef void (*move_function)(TaskUnion& dest, TaskUnion& src);
+ using move_function = void (*)(TaskUnion& dest, TaskUnion& src);
// Vtable of functions for manipulating whatever is in the TaskUnion:
struct TaskVtable {
class TaskImpl {
F code_;
std::tuple<Args...> args_;
- typedef decltype(simgrid::xbt::apply(std::move(code_), std::move(args_))) result_type;
+ using result_type = decltype(simgrid::xbt::apply(std::move(code_), std::move(args_)));
+
public:
TaskImpl(F code, std::tuple<Args...> args) :
code_(std::move(code)),
namespace simgrid {
namespace xbt {
/* To split the file if a unique one is given (specific variable for the other case live in runner()) */
-typedef std::vector<std::string> ReplayAction;
+using ReplayAction = std::vector<std::string>;
XBT_PUBLIC_DATA std::ifstream* action_fs;
XBT_PUBLIC int replay_runner(const char* actor_name, const char* trace_filename);
}
}
-typedef std::function<void(simgrid::xbt::ReplayAction&)> action_fun;
+using action_fun = std::function<void(simgrid::xbt::ReplayAction&)>;
XBT_PUBLIC void xbt_replay_action_register(const char* action_name, const action_fun& function);
XBT_PUBLIC action_fun xbt_replay_action_get(const char* action_name);
*/
template<class R, class... P>
class signal<R(P...)> {
- typedef std::function<R(P...)> callback_type;
+ using callback_type = std::function<R(P...)>;
std::map<unsigned int, callback_type> handlers_;
unsigned int callback_sequence_id = 0;
public:
// Types
- typedef std::size_t size_type;
- typedef char& reference;
- typedef const char& const_reference;
- typedef char* iterator;
- typedef const char* const_iterator;
+ using size_type = std::size_t;
+ using reference = char&;
+ using const_reference = const char&;
+ using iterator = char*;
+ using const_iterator = const char*;
// Dtor
~string()
};
/* Used to keep the list of actors blocked on a synchro */
-typedef boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImpl, boost::intrusive::list_member_hook<>,
- &ActorImpl::smx_synchro_hook>>
- SynchroList;
+using SynchroList =
+ boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImpl, boost::intrusive::list_member_hook<>,
+ &ActorImpl::smx_synchro_hook>>;
XBT_PUBLIC void create_maestro(const std::function<void()>& code);
XBT_PUBLIC int get_maxpid();
/* This allows Java to hijack the context factory (Java induces factories of factory :) */
-typedef ContextFactory* (*ContextFactoryInitializer)();
+using ContextFactoryInitializer = ContextFactory* (*)();
XBT_PUBLIC_DATA ContextFactoryInitializer factory_initializer;
XBT_PRIVATE ContextFactory* thread_factory();
private:
#if BOOST_VERSION < 106100
boost::context::fcontext_t fc_;
- typedef intptr_t arg_type;
+ using arg_type = intptr_t;
#else
boost::context::detail::fcontext_t fc_;
- typedef boost::context::detail::transfer_t arg_type;
+ using arg_type = boost::context::detail::transfer_t;
#endif
XBT_ATTRIB_NORETURN static void wrapper(arg_type arg);
// Raw context routines
-typedef void (*rawctx_entry_point_t)(simgrid::kernel::context::SwappedContext*);
+using rawctx_entry_point_t = void (*)(simgrid::kernel::context::SwappedContext*);
-typedef void* raw_stack_t;
+using raw_stack_t = void*;
extern "C" raw_stack_t raw_makecontext(void* malloced_stack, int stack_size, rawctx_entry_point_t entry_point,
simgrid::kernel::context::SwappedContext* arg);
extern "C" void raw_swapcontext(raw_stack_t* old, raw_stack_t new_context);
namespace kernel {
namespace lmm {
-typedef std::vector<int> dyn_light_t;
+using dyn_light_t = std::vector<int>;
int Variable::next_rank_ = 1;
int Constraint::next_rank_ = 1;
resource::Action::ModifiedSet* modified_set_ = nullptr;
private:
- typedef std::vector<int> dyn_light_t;
-
+ using dyn_light_t = std::vector<int>;
+
//Data used in lmm::solve
std::vector<ConstraintLight> cnst_light_vec;
dyn_light_t saturated_constraints;
void add_event(double date, Event* evt);
private:
- typedef std::pair<double, Event*> Qelt;
+ using Qelt = std::pair<double, Event*>;
std::priority_queue<Qelt, std::vector<Qelt>, std::greater<>> heap_;
};
int nr_nodes = xbt_dynar_length(nodes);
std::vector<double> cost_arr(nr_nodes); /* link cost from src to other hosts */
pred_arr.resize(nr_nodes); /* predecessors in path from src */
- typedef std::pair<double, int> Qelt;
+ using Qelt = std::pair<double, int>;
std::priority_queue<Qelt, std::vector<Qelt>, std::greater<>> pqueue;
/* initialize */
}
};
-typedef std::array<HeapLocation, 2> HeapLocationPair;
-typedef std::set<HeapLocationPair> HeapLocationPairs;
+using HeapLocationPair = std::array<HeapLocation, 2>;
+using HeapLocationPairs = std::set<HeapLocationPair>;
class HeapArea : public HeapLocation {
public:
* just a sequence of dwarf instructions. We currently directly use
* `Dwarf_Op` from `dwarf.h` for dwarf instructions.
*/
-typedef std::vector<Dwarf_Op> DwarfExpression;
+using DwarfExpression = std::vector<Dwarf_Op>;
/** Context of evaluation of a DWARF expression
*
*/
class ExpressionStack {
public:
- typedef std::uintptr_t value_type;
+ using value_type = std::uintptr_t;
static const std::size_t max_size = 64;
private:
/** A DWARF expression with optional validity constraints */
class LocationListEntry {
public:
- typedef simgrid::xbt::Range<std::uint64_t> range_type;
+ using range_type = simgrid::xbt::Range<std::uint64_t>;
private:
DwarfExpression expression_;
bool valid_for_ip(unw_word_t ip) const { return range_.contain(ip); }
};
-typedef std::vector<LocationListEntry> LocationList;
+using LocationList = std::vector<LocationListEntry>;
/** Location of some variable in memory
*
void ObjectInformation::remove_global_variable(const char* name)
{
- typedef std::vector<Variable>::size_type size_type;
+ using size_type = std::vector<Variable>::size_type;
if (this->global_variables.empty())
return;
static void remove_local_variable(Frame& scope, const char* var_name, const char* subprogram_name,
Frame const& subprogram)
{
- typedef std::vector<Variable>::size_type size_type;
+ using size_type = std::vector<Variable>::size_type;
// If the current subprogram matches the given name:
if ((subprogram_name == nullptr || (not subprogram.name.empty() && subprogram.name == subprogram_name)) &&
*/
class Member {
public:
- typedef int flags_type;
+ using flags_type = int;
static constexpr flags_type INHERITANCE_FLAG = 1;
static constexpr flags_type VIRTUAL_POINTER_FLAG = 2;
namespace simgrid {
namespace mc {
-typedef std::uint64_t hash_type;
+using hash_type = std::uint64_t;
XBT_PRIVATE hash_type hash(simgrid::mc::Snapshot const& snapshot);
namespace simgrid {
namespace mc {
-typedef std::vector<Transition> RecordTrace;
+using RecordTrace = std::vector<Transition>;
/** Convert a string representation of the path into an array of `simgrid::mc::Transition`
*/
return;
}
- typedef std::vector<IgnoredHeapRegion>::size_type size_type;
+ using size_type = std::vector<IgnoredHeapRegion>::size_type;
size_type start = 0;
size_type end = ignored_heap_.size() - 1;
void RemoteSimulation::unignore_heap(void* address, size_t size)
{
- typedef std::vector<IgnoredHeapRegion>::size_type size_type;
+ using size_type = std::vector<IgnoredHeapRegion>::size_type;
size_type start = 0;
size_type end = ignored_heap_.size() - 1;
*/
class PageStore {
public: // Types
- typedef std::uint64_t hash_type;
+ using hash_type = std::uint64_t;
private:
// Types
// We are using a cheap hash to index a page.
// We should expect collision and we need to associate multiple page indices
// to the same hash.
- typedef std::unordered_set<std::size_t> page_set_type;
- typedef std::unordered_map<hash_type, page_set_type> pages_map_type;
+ using page_set_type = std::unordered_set<std::size_t>;
+ using pages_map_type = std::unordered_map<hash_type, page_set_type>;
// Fields:
/** First page */
std::string frame_name;
unw_cursor_t unw_cursor;
};
-typedef s_mc_stack_frame_t* mc_stack_frame_t;
+using mc_stack_frame_t = s_mc_stack_frame_t*;
struct s_local_variable_t {
simgrid::mc::Frame* subprogram;
simgrid::mc::Type* type;
void* address;
};
-typedef s_local_variable_t* local_variable_t;
-typedef const s_local_variable_t* const_local_variable_t;
+using local_variable_t = s_local_variable_t*;
+using const_local_variable_t = const s_local_variable_t*;
struct XBT_PRIVATE s_mc_snapshot_stack_t {
std::vector<s_local_variable_t> local_variables;
simgrid::mc::UnwindContext context;
std::vector<s_mc_stack_frame_t> stack_frames;
};
-typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t;
-typedef const s_mc_snapshot_stack_t* const_mc_snapshot_stack_t;
+using mc_snapshot_stack_t = s_mc_snapshot_stack_t*;
+using const_mc_snapshot_stack_t = const s_mc_snapshot_stack_t*;
namespace simgrid {
namespace mc {
XBT_PUBLIC_DATA const std::array<const char*, NUM_SIMCALLS> simcall_names; /* Name of each simcall */
-typedef bool (*simix_match_func_t)(void*, void*, simgrid::kernel::activity::CommImpl*);
-typedef void (*simix_copy_data_func_t)(simgrid::kernel::activity::CommImpl*, void*, size_t);
-typedef void (*simix_clean_func_t)(void*);
-typedef void (*FPtr)(); // Hide the ugliness
+using simix_match_func_t = bool (*)(void*, void*, simgrid::kernel::activity::CommImpl*);
+using simix_copy_data_func_t = void (*)(simgrid::kernel::activity::CommImpl*, void*, size_t);
+using simix_clean_func_t = void (*)(void*);
+using FPtr = void (*)(); // Hide the ugliness
/* Pack all possible scalar types in an union */
union u_smx_scalar {
extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;
-typedef SMPI_Cart_topology* MPIR_Cart_Topology;
-
-typedef SMPI_Graph_topology* MPIR_Graph_Topology;
-
-typedef SMPI_Dist_Graph_topology* MPIR_Dist_Graph_Topology;
+using MPIR_Cart_Topology = SMPI_Cart_topology*;
+using MPIR_Graph_Topology = SMPI_Graph_topology*;
+using MPIR_Dist_Graph_Topology = SMPI_Dist_Graph_topology*;
XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process();
XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor);
void* address;
int file_descriptor;
};
-typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
+using smpi_privatization_region_t = s_smpi_privatization_region_t*;
extern XBT_PRIVATE int smpi_loaded_page;
XBT_PRIVATE smpi_privatization_region_t smpi_init_global_memory_segment_process();
#define TOPAGE(addr) (void*)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
/** Used only if PAPI is compiled in, but integrated anyway so that this file does not depend on internal_config.h (to speed builds) */
-typedef std::vector<std::pair</* counter name */ std::string, /* counter value */ long long>> papi_counter_t;
+using papi_counter_t = std::vector<std::pair</* counter name */ std::string, /* counter value */ long long>>;
struct papi_process_data {
papi_counter_t counter_data;
int event_set;
int refcount;
};
-typedef s_smpi_key_elem_t* smpi_key_elem;
+using smpi_key_elem = s_smpi_key_elem_t*;
namespace simgrid{
namespace smpi{
namespace simgrid{
namespace smpi{
-typedef struct s_smpi_mpi_generalized_request_funcs {
+struct smpi_mpi_generalized_request_funcs_t {
MPI_Grequest_query_function *query_fn;
MPI_Grequest_free_function *free_fn;
MPI_Grequest_cancel_function *cancel_fn;
void* extra_state;
s4u::ConditionVariablePtr cond;
s4u::MutexPtr mutex;
-} s_smpi_mpi_generalized_request_funcs_t;
-typedef struct s_smpi_mpi_generalized_request_funcs *smpi_mpi_generalized_request_funcs;
+};
class Request : public F2C {
void* buf_;
int refcount_;
MPI_Op op_;
int cancelled_; // tri-state
- smpi_mpi_generalized_request_funcs generalized_funcs;
+ smpi_mpi_generalized_request_funcs_t* generalized_funcs;
MPI_Request* nbc_requests_;
int nbc_requests_size_;
static bool match_common(MPI_Request req, MPI_Request sender, MPI_Request receiver);
#include "smpi_status.hpp"
#include <memory>
-typedef std::shared_ptr<SMPI_Topology> MPI_Topology;
+using MPI_Topology = std::shared_ptr<SMPI_Topology>;
namespace simgrid{
namespace smpi{
std::ifstream fstream(filename);
xbt_assert(fstream.is_open(), "Could not open file %s. Does it exist?", filename.c_str());
std::string line;
- typedef boost::tokenizer<boost::escaped_list_separator<char>> Tokenizer;
+ using Tokenizer = boost::tokenizer<boost::escaped_list_separator<char>>;
std::getline(fstream, line); // Skip the header line
while (std::getline(fstream, line)) {
Tokenizer tok(line);
XBT_ERROR("Could not initialize PAPI library; is it correctly installed and linked?"
" Expected version is %u", PAPI_VER_CURRENT);
- typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
+ using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
boost::char_separator<char> separator_units(";");
std::string str = smpi_cfg_papi_events_file();
Tokenizer tokens(str, separator_units);
#endif
}
-
-
-typedef std::function<int(int argc, char *argv[])> smpi_entry_point_type;
-typedef int (* smpi_c_entry_point_type)(int argc, char **argv);
-typedef void (*smpi_fortran_entry_point_type)();
+using smpi_entry_point_type = std::function<int(int argc, char* argv[])>;
+using smpi_c_entry_point_type = int (*)(int argc, char** argv);
+using smpi_fortran_entry_point_type = void (*)();
template <typename F>
static int smpi_run_entry_point(const F& entry_point, const std::string& executable_path, std::vector<std::string> args)
};
}
-typedef std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int> req_key_t;
-typedef std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int,int,int>>> req_storage_t;
+using req_key_t = std::tuple</*sender*/ int, /* receiver */ int, /* tag */ int>;
+using req_storage_t = std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int, int, int>>>;
void log_timed_action(const simgrid::xbt::ReplayAction& action, double clock)
{
};
std::unordered_map<smpi_source_location, shared_data_t, std::hash<std::string>> allocs;
-typedef decltype(allocs)::value_type shared_data_key_type;
+using shared_data_key_type = decltype(allocs)::value_type;
struct shared_metadata_t {
size_t size;
std::vector<s_smpi_factor_t> smpi_factor;
/** Setup the tokenizer that parses the string **/
- typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
+ using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
boost::char_separator<char> sep(";");
boost::char_separator<char> factor_separator(":");
Tokenizer tokens(smpi_coef_string, sep);
(*request)->flags_ |= MPI_REQ_GENERALIZED;
(*request)->flags_ |= MPI_REQ_PERSISTENT;
(*request)->refcount_ = 1;
- ((*request)->generalized_funcs) = new s_smpi_mpi_generalized_request_funcs_t;
+ ((*request)->generalized_funcs) = new smpi_mpi_generalized_request_funcs_t;
((*request)->generalized_funcs)->query_fn=query_fn;
((*request)->generalized_funcs)->free_fn=free_fn;
((*request)->generalized_funcs)->cancel_fn=cancel_fn;
bool operator()(s4u::Host* const a, s4u::Host* const b) const;
};
-typedef boost::heap::fibonacci_heap<s4u::Host*, boost::heap::compare<compare_hosts>>::handle_type heap_handle;
+using heap_handle = boost::heap::fibonacci_heap<s4u::Host*, boost::heap::compare<compare_hosts>>::handle_type;
/** Structure that imitates a std::pair, but it allows us to use meaningful names instead of .first and .second */
struct XBT_PRIVATE pair_handle_load
class XBT_PRIVATE Mapping {
public:
/** Each host can have an arbitrary number of actors -> multimap **/
- typedef std::unordered_multimap<s4u::Host*, s4u::ActorPtr> host_to_actors_map_t;
+ using host_to_actors_map_t = std::unordered_multimap<s4u::Host*, s4u::ActorPtr>;
host_to_actors_map_t host_to_actors;
/** Each actor gets assigned to exactly one host -> map **/
void remove_actor(kernel::actor::ActorImpl* actor) { xbt::intrusive_erase(actor_list_, *actor); }
void add_actor_at_boot(kernel::actor::ProcessArg* arg) { actors_at_boot_.emplace_back(arg); }
- typedef boost::intrusive::list<
+ using ActorList = boost::intrusive::list<
kernel::actor::ActorImpl,
boost::intrusive::member_hook<kernel::actor::ActorImpl, boost::intrusive::list_member_hook<>,
- &kernel::actor::ActorImpl::host_actor_list_hook>>
- ActorList;
+ &kernel::actor::ActorImpl::host_actor_list_hook>>;
// FIXME: make these private
ActorList actor_list_;
boost::intrusive::list_member_hook<> action_ti_hook;
};
-typedef boost::intrusive::member_hook<CpuTiAction, boost::intrusive::list_member_hook<>, &CpuTiAction::action_ti_hook> ActionTiListOptions;
-typedef boost::intrusive::list<CpuTiAction, ActionTiListOptions > ActionTiList;
+using ActionTiListOptions =
+ boost::intrusive::member_hook<CpuTiAction, boost::intrusive::list_member_hook<>, &CpuTiAction::action_ti_hook>;
+using ActionTiList = boost::intrusive::list<CpuTiAction, ActionTiListOptions>;
/************
* Resource *
boost::intrusive::list_member_hook<> cpu_ti_hook;
};
-typedef boost::intrusive::member_hook<CpuTi, boost::intrusive::list_member_hook<>, &CpuTi::cpu_ti_hook> CpuTiListOptions;
-typedef boost::intrusive::list<CpuTi, CpuTiListOptions> CpuTiList;
+using CpuTiListOptions =
+ boost::intrusive::member_hook<CpuTi, boost::intrusive::list_member_hook<>, &CpuTi::cpu_ti_hook>;
+using CpuTiList = boost::intrusive::list<CpuTi, CpuTiListOptions>;
/*********
* Model *
int count; //negative for roll
long int limit;
};
-typedef struct xbt_log_append2_file_s* xbt_log_append2_file_t;
+using xbt_log_append2_file_t = xbt_log_append2_file_s*;
static constexpr const char* APPEND2_END_TOKEN = "\n[End of log]\n";
static constexpr const char* APPEND2_END_TOKEN_CLEAR = "\n ";