mybench->output = fopen(tracefile, "a+");
if (mybench->output == NULL)
printf("Error while opening the tracefile");
-
}
/* Initializing StarPU benchmarking */
mybench->output = fopen(tracefile, "a+");
if (mybench->output == NULL)
printf("Error while opening the tracefile");
-
}
/* Start benchmarking using macros */
if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
simgrid::s4u::this_actor::execute(compute_cost);
-
} while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
XBT_INFO("Exiting now.");
if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
simgrid::s4u::this_actor::execute(compute_cost);
-
} while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
XBT_INFO("Exiting now.");
char mailbox[MAILBOX_NAME_SIZE]; //node mailbox
unsigned int find_node_success; //Number of find_node which have succeeded.
unsigned int find_node_failed; //Number of find_node which have failed.
-
} s_node_t;
typedef s_node_t *node_t;
/* This actor just sleeps until termination */
class sleeper {
-
public:
explicit sleeper(std::vector<std::string> /*args*/)
{
simgrid::s4u::CommPtr comm_received = nullptr; // current comm
Message* message = nullptr; // current message being received
+
public:
explicit Peer(std::vector<std::string> args);
Peer(const Peer&) = delete;
if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
simgrid::s4u::this_actor::execute(compute_cost);
-
} while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
XBT_INFO("Exiting now.");
/* Start dispatching all messages to receivers, in a round robin fashion */
for (int i = 0; i < messages_count; i++) {
-
std::string mboxName = std::string("receiver-") + std::to_string(i % receivers_count);
simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName);
std::string msgName = std::string("Message ") + std::to_string(i);
std::string* payload = new std::string(msgName); // copy the data we send:
+
// 'msgName' is not a stable storage location
XBT_INFO("Send '%s' to '%s'", msgName.c_str(), mboxName.c_str());
/* Create a communication representing the ongoing communication */
if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
simgrid::s4u::this_actor::execute(compute_cost);
-
} while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
XBT_INFO("Exiting now.");
* @details This represents a position in the network. One can send information between two netpoints
*/
class NetPoint : public simgrid::xbt::Extendable<NetPoint> {
-
public:
enum class Type { Host, Router, NetZone };
}
friend void intrusive_ptr_add_ref(Activity* a) { a->refcount_.fetch_add(1, std::memory_order_relaxed); }
#endif
+
private:
kernel::activity::ActivityImplPtr pimpl_ = nullptr;
Activity::State state_ = Activity::State::INITED;
protected:
virtual ~Storage() = default;
+
public:
/** @brief Callback signal fired when a new Storage is created */
static xbt::signal<void(Storage&)> on_creation;
},
nullptr);
}
+
private:
// We wrap an event-based kernel future:
simgrid::kernel::Future<T> future_;
throw std::future_error(std::future_errc::no_state);
}
}
+
private:
boost::variant<boost::blank, T, std::exception_ptr> value_;
};
*/
const char* sglua_tostring(lua_State* L, int index)
{
-
static char buff[64];
switch (lua_type(L, index)) {
-
case LUA_TNIL:
snprintf(buff, 4, "nil");
break;
*/
const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index)
{
-
static char buff[64];
/* value_tostring also always returns the same pointer */
int len = snprintf(buff, 63, "[%s] -> ", sglua_tostring(L, key_index));
*
* - Argument 1 (string): the text to print
*/
-static int debug(lua_State* L) {
-
+static int debug(lua_State* L)
+{
const char* str = luaL_checkstring(L, 1);
XBT_DEBUG("%s", str);
return 0;
class Container {
long long int id_;
std::string name_; /* Unique name of this container */
+
public:
Container(const std::string& name, const std::string& type_name, Container* father);
Container(const Container&) = delete;
BoostContext::BoostContext(std::function<void()>&& code, actor::ActorImpl* actor, SwappedContextFactory* factory)
: SwappedContext(std::move(code), actor, factory)
{
-
/* if the user provided a function for the process then use it, otherwise it is the context for maestro */
if (has_code()) {
#if BOOST_VERSION < 106100
TEST_CASE("kernel::profile: Resource profiles, defining the external load", "kernel::profile")
{
-
SECTION("No event, no loop")
{
std::vector<simgrid::kernel::profile::DatedValue> got = trace2vector("");
SECTION("Three events, no loop")
{
-
std::vector<simgrid::kernel::profile::DatedValue> got = trace2vector("3.0 1.0\n"
"5.0 2.0\n"
"9.0 3.0\n");
}
if (not dst->is_router()) { // No specific link for router
-
std::pair<resource::LinkImpl*, resource::LinkImpl*> info =
private_links_.at(node_pos_with_loopback_limiter(dst->id()));
+
if (info.second) { // link down
route->link_list.push_back(info.second);
if (lat)
class ReadOptions {
std::uint32_t value_ = 0;
constexpr explicit ReadOptions(std::uint32_t value) : value_(value) {}
+
public:
constexpr ReadOptions() {}
this->read_bytes(&res[0], len, address);
return res;
}
-
};
}
PageStore page_store_{500};
std::unique_ptr<RemoteClient> process_;
Checker* checker_ = nullptr;
-public:
+public:
ModelChecker(ModelChecker const&) = delete;
ModelChecker& operator=(ModelChecker const&) = delete;
explicit ModelChecker(std::unique_ptr<RemoteClient> process);
// abstract
class Checker {
Session* session_;
+
public:
explicit Checker(Session& session);
void log_state() override;
void deterministic_comm_pattern(int process, const simgrid::mc::PatternCommunication* comm, int backtracking);
void restoreState();
+
public:
// These are used by functions which should be moved in CommunicationDeterminismChecker:
void get_comm_pattern(smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
default:
xbt_die("Unexpected call type %i", (int)call_type);
}
-
}
fprintf(dot_output,
"digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node [fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n");
-
}
/******************************* Core of MC *******************************/
const char* current = data;
while (*current) {
-
simgrid::mc::Transition item;
int count = sscanf(current, "%d/%d", &item.pid_, &item.argument_);
+
if(count != 2 && count != 1)
throw std::invalid_argument("Could not parse record path");
res.push_back(item);
// Load each element of the vector from the MCed process:
for (unsigned int i = 0; i < dynar.used; ++i) {
-
simgrid::mc::ActorInformation info;
+
info.address = simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl>(data[i]);
info.hostname = nullptr;
process->read_bytes(&info.copy, sizeof(info.copy), remote(data[i]));
std::vector<char> buffer(xbt_pagesize);
for (size_t i = 0; i != page_count; ++i) {
-
RemotePtr<void> page = remote((void*)simgrid::mc::mmu::join(i, addr.address()));
xbt_assert(simgrid::mc::mmu::split(page.address()).second == 0, "Not at the beginning of a page");
void snap_test_helper::compare_whole_region()
{
for (int n = 1; n != 32; ++n) {
-
prologue_return ret = prologue(n);
INFO("Unexpected match in MC_snapshot_region_memcmp() with previous snapshot");
* @brief Initialize MSG with less verifications
* You should use the MSG_init() function instead. Failing to do so may turn into PEBKAC some day. You've been warned.
*/
-void MSG_init_nocheck(int *argc, char **argv) {
-
+void MSG_init_nocheck(int* argc, char** argv)
+{
TRACE_global_init();
if (not msg_global) {
atexit(MSG_exit);
}
-void MSG_config(const char *key, const char *value){
+void MSG_config(const char* key, const char* value)
+{
xbt_assert(msg_global,"ERROR: Please call MSG_init() before using MSG_config()");
simgrid::config::set_as_string(key, value);
}
-static void MSG_exit() {
+static void MSG_exit()
+{
delete msg_global;
msg_global = nullptr;
}
std::unordered_map<std::string, IBNode> active_nodes;
std::unordered_map<NetworkAction*, std::pair<IBNode*, IBNode*>> active_comms;
-
};
} // namespace resource
} // namespace kernel
/* While not all is buffered and there remain space in the buffers */
while (flow->buffered_bytes_ < flow->total_bytes_ && sock->GetTxAvailable() > 0) {
-
// Send at most 1040 bytes (data size in a TCP packet), as ns-3 seems to not split correctly by itself
uint32_t toWrite = std::min({flow->remaining_, sock->GetTxAvailable(), std::uint32_t(1040)});
+
if (toWrite == 0) { // buffer full
XBT_DEBUG("%f: buffer full on flow %p (still %u to go)", ns3::Simulator::Now().GetSeconds(), flow,
flow->remaining_);
TEST_CASE("xbt::config: Configuration support", "config")
{
-
SECTION("Alloc and free a config set")
{
auto temp = simgrid_config;
* if such a file exists.
* */
struct mdesc {
-
/** @brief Mutex locking the access to the heap */
pthread_mutex_t mutex;
/* @brief Instrumentation */
struct mstats heapstats;
-
};
/* Bits to look at in the malloc descriptor flags word */
TEST_CASE("xbt::str: String Handling", "xbt_str")
{
-
SECTION("Test the function xbt_str_split_quoted")
{
test_split_quoted("Empty", "", {});
XBT_DEBUG("\t * Done : %p", &action);
action.unref();
}
-
} while (
(surf_network_model->get_started_action_set()->size() || surf_cpu_model_pm->get_started_action_set()->size()) &&
surf_solve(-1.0) >= 0.0);