val_t value = PJ_value_get (mark_value, type);
XBT_DEBUG("MARK %s %s", mark_type, mark_value);
- NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value);
+ new NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value);
}
/** \ingroup TRACE_mark
type_t type = PJ_type_get (variable, container->type);
switch (what){
case INSTR_US_SET:
- SetVariableEvent(time, container, type, value);
+ new SetVariableEvent(time, container, type, value);
break;
case INSTR_US_ADD:
- AddVariableEvent(time, container, type, value);
+ new AddVariableEvent(time, container, type, value);
break;
case INSTR_US_SUB:
- SubVariableEvent(time, container, type, value);
+ new SubVariableEvent(time, container, type, value);
break;
default:
THROW_IMPOSSIBLE;
container_t container = PJ_container_get(host);
type_t type = PJ_type_get (state, container->type);
val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
- SetStateEvent(MSG_get_clock(), container, type, val);
+ new SetStateEvent(MSG_get_clock(), container, type, val);
}
/** \ingroup TRACE_user_variables
container_t container = PJ_container_get(host);
type_t type = PJ_type_get (state, container->type);
val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
- PushStateEvent(MSG_get_clock(), container, type, val);
+ new PushStateEvent(MSG_get_clock(), container, type, val);
}
/** \ingroup TRACE_user_variables
{
container_t container = PJ_container_get(host);
type_t type = PJ_type_get (state, container->type);
- PopStateEvent(MSG_get_clock(), container, type);
+ new PopStateEvent(MSG_get_clock(), container, type);
}
/** \ingroup TRACE_user_variables
{
container_t container = PJ_container_get(host);
type_t type = PJ_type_get (state, container->type);
- ResetStateEvent(MSG_get_clock(), container, type);
+ new ResetStateEvent(MSG_get_clock(), container, type);
}
/** \ingroup TRACE_API
void buffer_debug(std::vector<PajeEvent*> *buf);
void buffer_debug(std::vector<PajeEvent*> *buf) {
+ return;
XBT_DEBUG(">>>>>> Dump the state of the buffer. %zu events", buf->size());
for (auto event :*buf){
event->print();
- XBT_DEBUG("%s", stream.str().c_str());
+ XBT_DEBUG("%p %s", event, stream.str().c_str());
stream.str("");
stream.clear();
}
static void print_row() {
stream << std::endl;
fprintf(tracing_file, "%s", stream.str().c_str());
+ XBT_DEBUG("Dump %s", stream.str().c_str());
stream.str("");
stream.clear();
}
ret = newType (name, key, nullptr, TYPE_LINK, father);
XBT_DEBUG("LinkType %s(%s), child of %s(%s) %s(%s)->%s(%s)", ret->name, ret->id, father->name, father->id,
source->name, source->id, dest->name, dest->id);
- DefineLinkTypeEvent(ret, source, dest);
+ new DefineLinkTypeEvent(ret, source, dest);
return ret;
}
XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
new DefineStateTypeEvent(ret);
return ret;
-}
\ No newline at end of file
+}
typedef s_container s_container_t;
//--------------------------------------------------
-class PajeEvent;
-
class PajeEvent {
public:
double timestamp;
e_event_type event_type;
- virtual void print(){};
+ virtual void print() = 0;
void *data;
virtual ~PajeEvent();
};
type_t type;
public:
DefineStateTypeEvent(type_t type);
- void print();// override;
+ void print() override;
};
class DefineEventTypeEvent : public PajeEvent {
if (!xbt_dict_get_or_null(platform_variables, key)) {
container_t container = PJ_container_get (resource);
type_t type = PJ_type_get (variable, container->type);
- SetVariableEvent (now, container, type, 0);
+ new SetVariableEvent (now, container, type, 0);
xbt_dict_set(platform_variables, key, (char*)"", nullptr);
}
xbt_free(key);
static void instr_event (double now, double delta, type_t variable, container_t resource, double value)
{
__TRACE_surf_check_variable_set_to_zero(now, variable->name, resource->name);
- AddVariableEvent(now, resource, variable, value);
- SubVariableEvent(now + delta, resource, variable, value);
+ new AddVariableEvent(now, resource, variable, value);
+ new SubVariableEvent(now + delta, resource, variable, value);
}
/* TRACE_surf_link_set_utilization: entry point from SimGrid */
if (!TRACE_is_enabled()) return;
XBT_DEBUG("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
if (force){
- for (auto event :buffer){
+ for (auto event : buffer){
event->print();
delete event;
}
else
XBT_DEBUG("%s: inserted at pos= %zd from its end", __FUNCTION__,
std::distance(buffer.rbegin(),i));
+
+ buffer_debug(&buffer);
}
PajeEvent:: ~PajeEvent()
{
- XBT_DEBUG("%s not implemented: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, timestamp);
-
+ XBT_DEBUG("%s not implemented for %p: event_type=%d, timestamp=%f", __FUNCTION__,
+ this, (int)event_type, timestamp);
+// xbt_backtrace_display_current();
+
/* switch (event->event_type){
case PAJE_StartLink:
xbt_free (((startLink_t)(event->data))->value);
XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
- //print it
print();
}
insert_into_buffer (this);
}
-
AddVariableEvent::AddVariableEvent (double timestamp, container_t container, type_t type, double value)
{
this->event_type = PAJE_AddVariable;
PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value)
-{
- new PushStateEvent(timestamp, container, type, value, nullptr);
-}
+ : PushStateEvent(timestamp, container, type, value, nullptr)
+{}
PopStateEvent::PopStateEvent (double timestamp, container_t container, type_t type)
{
insert_into_buffer (this);
}
-StartLinkEvent::StartLinkEvent (double timestamp, container_t container, type_t type, container_t sourceContainer,
- const char *value, const char *key)
-{
- StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1);
-}
+StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
+ type_t type, container_t sourceContainer, const char *value, const char *key)
+ : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
+{}
StartLinkEvent::StartLinkEvent (double timestamp, container_t container, type_t type, container_t sourceContainer,
const char *value, const char *key, int size)
{
event_type = PAJE_StartLink;
- timestamp = timestamp;
+ this->timestamp = timestamp;
this->type = type;
this->container = container;
this->sourceContainer = sourceContainer;
- value = xbt_strdup(value);
- key = xbt_strdup(key);
+ this->value = xbt_strdup(value);
+ this->key = xbt_strdup(key);
this->size = size;
- XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%f, value:%s", __FUNCTION__,
+ (int)event_type, this->timestamp, this->value);
insert_into_buffer (this);
}
//start link
container_t msg = PJ_container_get (instr_process_id(process, str, len));
type_t type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
- StartLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new StartLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
//destroy existing container of this process
TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process));
//end link
msg = PJ_container_get(instr_process_id(process, str, len));
type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
- EndLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new EndLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
}
}
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
val_t value = PJ_value_get ("suspend", type);
- PushStateEvent (MSG_get_clock(), process_container, type, value);
+ new PushStateEvent (MSG_get_clock(), process_container, type, value);
}
}
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- PopStateEvent (MSG_get_clock(), process_container, type);
+ new PopStateEvent (MSG_get_clock(), process_container, type);
}
}
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
val_t value = PJ_value_get ("sleep", type);
- PushStateEvent (MSG_get_clock(), process_container, type, value);
+ new PushStateEvent (MSG_get_clock(), process_container, type, value);
}
}
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- PopStateEvent (MSG_get_clock(), process_container, type);
+ new PopStateEvent (MSG_get_clock(), process_container, type);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
val_t value = PJ_value_get ("task_execute", type);
- PushStateEvent (MSG_get_clock(), process_container, type, value);
+ new PushStateEvent (MSG_get_clock(), process_container, type, value);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- PopStateEvent (MSG_get_clock(), process_container, type);
+ new PopStateEvent (MSG_get_clock(), process_container, type);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
val_t value = PJ_value_get ("receive", type);
- PushStateEvent (MSG_get_clock(), process_container, type, value);
+ new PushStateEvent (MSG_get_clock(), process_container, type, value);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- PopStateEvent (MSG_get_clock(), process_container, type);
+ new PopStateEvent (MSG_get_clock(), process_container, type);
char key[INSTR_DEFAULT_STR_SIZE];
snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
- EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+ new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
}
}
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
val_t value = PJ_value_get ("send", type);
- PushStateEvent (MSG_get_clock(), process_container, type, value);
+ new PushStateEvent (MSG_get_clock(), process_container, type, value);
char key[INSTR_DEFAULT_STR_SIZE];
snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
- StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+ new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
}
return 1;
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- PopStateEvent (MSG_get_clock(), process_container, type);
+ new PopStateEvent (MSG_get_clock(), process_container, type);
}
}
container_t vm_container = PJ_container_get(vm->cname());
type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type);
val_t value = PJ_value_get_or_new("start", "0 0 1", type); // start is blue
- PushStateEvent(MSG_get_clock(), vm_container, type, value);
+ new PushStateEvent(MSG_get_clock(), vm_container, type, value);
}
}
// start link
container_t msg = PJ_container_get(vm->cname());
type_t type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
- StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
// destroy existing container of this vm
container_t existing_container = PJ_container_get(vm->cname());
// end link
msg = PJ_container_get(vm->cname());
type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
- EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
}
// Inform the SRC that the migration has been correctly performed
container_t vm_container = PJ_container_get(vm->cname());
type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type);
val_t value = PJ_value_get_or_new("suspend", "1 0 0", type); // suspend is red
- PushStateEvent(MSG_get_clock(), vm_container, type, value);
+ new PushStateEvent(MSG_get_clock(), vm_container, type, value);
}
}
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = PJ_container_get(vm->cname());
type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type);
- PopStateEvent(MSG_get_clock(), vm_container, type);
+ new PopStateEvent(MSG_get_clock(), vm_container, type);
}
}
char cont_name[25];\
snprintf(cont_name,25, "rank-%d", smpi_process()->index());\
val_t value = PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\
- NewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
+ new NewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
}
#define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)\
type_t type = PJ_type_get ("MPI_STATE", container->type);
const char *color = instr_find_color (operation);
val_t value = PJ_value_get_or_new (operation, color, type);
- PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+ new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
}
void TRACE_smpi_collective_out(int rank, int root, const char *operation)
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
- PopStateEvent (SIMIX_get_clock(), container, type);
+ new PopStateEvent (SIMIX_get_clock(), container, type);
}
void TRACE_smpi_computing_init(int rank)
type_t type = PJ_type_get ("MPI_STATE", container->type);
const char *color = instr_find_color ("computing");
val_t value = PJ_value_get_or_new ("computing", color, type);
- PushStateEvent (SIMIX_get_clock(), container, type, value);
+ new PushStateEvent (SIMIX_get_clock(), container, type, value);
}
void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
val_t value = PJ_value_get_or_new ("computing", nullptr, type);
- PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+ new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
}
void TRACE_smpi_computing_out(int rank)
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
- PopStateEvent (SIMIX_get_clock(), container, type);
+ new PopStateEvent (SIMIX_get_clock(), container, type);
}
void TRACE_smpi_sleeping_init(int rank)
type_t type = PJ_type_get ("MPI_STATE", container->type);
const char *color = instr_find_color ("sleeping");
val_t value = PJ_value_get_or_new ("sleeping", color, type);
- PushStateEvent (SIMIX_get_clock(), container, type, value);
+ new PushStateEvent (SIMIX_get_clock(), container, type, value);
}
void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
val_t value = PJ_value_get_or_new ("sleeping", nullptr, type);
- PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+ new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
}
void TRACE_smpi_sleeping_out(int rank)
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
- PopStateEvent (SIMIX_get_clock(), container, type);
+ new PopStateEvent (SIMIX_get_clock(), container, type);
}
void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
val_t value = PJ_value_get_or_new ("test", nullptr, type);
- PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+ new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
}
void TRACE_smpi_testing_out(int rank)
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
- PopStateEvent (SIMIX_get_clock(), container, type);
+ new PopStateEvent (SIMIX_get_clock(), container, type);
}
void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra)
type_t type = PJ_type_get ("MPI_STATE", container->type);
const char *color = instr_find_color (operation);
val_t value = PJ_value_get_or_new (operation, color, type);
- PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+ new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
}
void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_STATE", container->type);
- PopStateEvent (SIMIX_get_clock(), container, type);
+ new PopStateEvent (SIMIX_get_clock(), container, type);
}
void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
- StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
+ new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
}
void TRACE_smpi_recv(int rank, int src, int dst, int tag)
container_t container = PJ_container_get (str);
type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
- EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
+ new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
}
snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
counter++;
- StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key);
- EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key);
+ new StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key);
+ new EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key);
XBT_DEBUG (" linkContainers %s <-> %s", src->name, dst->name);
}
if (latency == nullptr) {
latency = PJ_type_variable_new("latency", nullptr, container->type);
}
- SetVariableEvent(0, container, bandwidth, bandwidth_value);
- SetVariableEvent(0, container, latency, latency_value);
+ new SetVariableEvent(0, container, bandwidth, bandwidth_value);
+ new SetVariableEvent(0, container, latency, latency_value);
}
if (TRACE_uncategorized()) {
type_t bandwidth_used = PJ_type_get_or_null("bandwidth_used", container->type);
}
double current_speed_state = host.speed();
- SetVariableEvent (0, container, speed, current_speed_state);
+ new SetVariableEvent (0, container, speed, current_speed_state);
}
if (TRACE_uncategorized()){
type_t speed_used = PJ_type_get_or_null ("power_used", container->type);
if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
container_t container = PJ_container_get(resource);
type_t type = PJ_type_get ("power", container->type);
- SetVariableEvent(date, container, type, speed);
+ new SetVariableEvent(date, container, type, speed);
}
}
if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
container_t container = PJ_container_get(resource);
type_t type = PJ_type_get ("bandwidth", container->type);
- SetVariableEvent(date, container, type, bandwidth);
+ new SetVariableEvent(date, container, type, bandwidth);
}
}