XBT_DEBUG("Filename %s is closed", filename);
}
- void print_TICreateContainer(paje_event_t event)
+ void print_TICreateContainer(PajeEvent* event)
{
//if we are in the mode with only one file
static FILE *temp = nullptr;
if (!xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || temp == nullptr) {
char *folder_name = bprintf("%s_files", TRACE_get_filename());
- char *filename = bprintf("%s/%f_%s.txt", folder_name, prefix, ((createContainer_t) event->data)->container->name);
+ char *filename = bprintf("%s/%f_%s.txt", folder_name, prefix,
+ static_cast<CreateContainerEvent*>(event)->container->name);
#ifdef WIN32
_mkdir(folder_name);
#else
xbt_free(filename);
}
- xbt_dict_set(tracing_files, ((createContainer_t) event->data)->container->name, (void *) temp, nullptr);
+ xbt_dict_set(tracing_files, ((CreateContainerEvent*) event)->container->name, (void *) temp, nullptr);
}
- void print_TIDestroyContainer(paje_event_t event)
+ void print_TIDestroyContainer(PajeEvent* event)
{
if (!xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file")|| xbt_dict_length(tracing_files) == 1) {
- FILE* f = (FILE*)xbt_dict_get_or_null(tracing_files, ((destroyContainer_t) event->data)->container->name);
+ FILE* f = (FILE*)xbt_dict_get_or_null(tracing_files, ((DestroyContainerEvent *) event)->container->name);
fclose(f);
}
- xbt_dict_remove(tracing_files, ((destroyContainer_t) event->data)->container->name);
+ xbt_dict_remove(tracing_files, ((DestroyContainerEvent*) event)->container->name);
}
- void print_TIPushState(paje_event_t event)
+ void print_TIPushState(PajeEvent* event)
{
int i;
//char* function=nullptr;
- if (((pushState_t) event->data)->extra == nullptr)
+ if (((PushStateEvent*) event->data)->extra == nullptr)
return;
- instr_extra_data extra = (instr_extra_data) (((pushState_t) event->data)->extra);
+ instr_extra_data extra = (instr_extra_data) (((PushStateEvent*) event->data)->extra);
char *process_id = nullptr;
//FIXME: dirty extract "rank-" from the name, as we want the bare process id here
- if (strstr(((pushState_t) event->data)->container->name, "rank-") == nullptr)
- process_id = xbt_strdup(((pushState_t) event->data)->container->name);
+ if (strstr(((PushStateEvent*) event->data)->container->name, "rank-") == nullptr)
+ process_id = xbt_strdup(((PushStateEvent*) event->data)->container->name);
else
- process_id = xbt_strdup(((pushState_t) event->data)->container->name + 5);
+ process_id = xbt_strdup(((PushStateEvent*) event->data)->container->name + 5);
- FILE* trace_file = (FILE* )xbt_dict_get(tracing_files, ((pushState_t) event->data)->container->name);
+ FILE* trace_file = (FILE* )xbt_dict_get(tracing_files, ((PushStateEvent*) event)->container->name);
switch (extra->type) {
case TRACING_INIT:
fprintf(trace_file, "%s send %d %d %s\n", process_id, extra->dst, extra->send_size, extra->datatype1);
break;
case TRACING_ISEND:
- fprintf(trace_file, "%s isend %d %d %s\n", process_id, extra->dst, extra->send_size, extra->datatype1);
+ fprintf(trace_file, "%s Isend %d %d %s\n", process_id, extra->dst, extra->send_size, extra->datatype1);
break;
case TRACING_RECV:
fprintf(trace_file, "%s recv %d %d %s\n", process_id, extra->src, extra->send_size, extra->datatype1);
break;
case TRACING_IRECV:
- fprintf(trace_file, "%s irecv %d %d %s\n", process_id, extra->src, extra->send_size, extra->datatype1);
+ fprintf(trace_file, "%s Irecv %d %d %s\n", process_id, extra->src, extra->send_size, extra->datatype1);
break;
case TRACING_TEST:
fprintf(trace_file, "%s test\n", process_id);
fprintf(trace_file, "%s wait\n", process_id);
break;
case TRACING_WAITALL:
- fprintf(trace_file, "%s waitall\n", process_id);
+ fprintf(trace_file, "%s waitAll\n", process_id);
break;
case TRACING_BARRIER:
fprintf(trace_file, "%s barrier\n", process_id);
fprintf(trace_file, "\n");
break;
case TRACING_ALLREDUCE: // rank allreduce comm_size comp_size (datatype)
- fprintf(trace_file, "%s allreduce %d %f %s\n", process_id, extra->send_size, extra->comp_size, extra->datatype1);
+ fprintf(trace_file, "%s allReduce %d %f %s\n", process_id, extra->send_size, extra->comp_size, extra->datatype1);
break;
case TRACING_ALLTOALL: // rank alltoall send_size recv_size (sendtype) (recvtype)
- fprintf(trace_file, "%s alltoall %d %d %s %s\n", process_id, extra->send_size, extra->recv_size, extra->datatype1,
+ fprintf(trace_file, "%s allToAll %d %d %s %s\n", process_id, extra->send_size, extra->recv_size, extra->datatype1,
extra->datatype2);
break;
case TRACING_ALLTOALLV: // rank alltoallv send_size [sendcounts] recv_size [recvcounts] (sendtype) (recvtype)
- fprintf(trace_file, "%s alltoallv %d ", process_id, extra->send_size);
+ fprintf(trace_file, "%s allToAllV %d ", process_id, extra->send_size);
for (i = 0; i < extra->num_processes; i++)
fprintf(trace_file, "%d ", extra->sendcounts[i]);
fprintf(trace_file, "%d ", extra->recv_size);
extra->datatype1, extra->datatype2);
break;
case TRACING_ALLGATHERV: // rank allgatherv send_size [recvcounts] (sendtype) (recvtype)
- fprintf(trace_file, "%s allgatherv %d ", process_id, extra->send_size);
+ fprintf(trace_file, "%s allGatherV %d ", process_id, extra->send_size);
for (i = 0; i < extra->num_processes; i++)
fprintf(trace_file, "%d ", extra->recvcounts[i]);
fprintf(trace_file, "%s %s \n", extra->datatype1, extra->datatype2);
break;
case TRACING_REDUCE_SCATTER: // rank reducescatter [recvcounts] comp_size (sendtype)
- fprintf(trace_file, "%s reducescatter ", process_id);
+ fprintf(trace_file, "%s reduceScatter ", process_id);
for (i = 0; i < extra->num_processes; i++)
fprintf(trace_file, "%d ", extra->recvcounts[i]);
fprintf(trace_file, "%f %s\n", extra->comp_size, extra->datatype1);
fprintf(trace_file, "%s sleep %f\n", process_id, extra->sleep_duration);
break;
case TRACING_GATHERV: // rank gatherv send_size [recvcounts] root (sendtype) (recvtype)
- fprintf(trace_file, "%s gatherv %d ", process_id, extra->send_size);
+ fprintf(trace_file, "%s gatherV %d ", process_id, extra->send_size);
for (i = 0; i < extra->num_processes; i++)
fprintf(trace_file, "%d ", extra->recvcounts[i]);
fprintf(trace_file, "%d %s %s\n", extra->root, extra->datatype1, extra->datatype2);
case TRACING_ISSEND:
default:
XBT_WARN ("Call from %s impossible to translate into replay command : Not implemented (yet)",
- ((pushState_t) event->data)->value->name);
+ ((PushStateEvent*) event->data)->value->name);
break;
}
trace_precision = xbt_cfg_get_int(OPT_TRACING_PRECISION);
}
-static std::vector<std::function<void()>> TRACE_start_functions;
-
-void TRACE_add_start_function(void (*func) ())
-{
- TRACE_start_functions.push_back(func);
-}
-
int TRACE_start()
{
if (TRACE_is_configured())
const char* format = xbt_cfg_get_string(OPT_TRACING_FORMAT);
XBT_DEBUG("Tracing format %s\n", format);
if(!strcmp(format, "Paje")){
- TRACE_paje_init();
TRACE_paje_start();
}else if (!strcmp(format, "TI")){
TRACE_TI_init();
user_host_variables = xbt_dict_new_homogeneous(xbt_free_f);
user_vm_variables = xbt_dict_new_homogeneous(xbt_free_f);
user_link_variables = xbt_dict_new_homogeneous(xbt_free_f);
-
- for (auto func: TRACE_start_functions)
- func();
}
- TRACE_start_functions.clear();
return 0;
}
-static std::vector<std::function<void()>> TRACE_end_functions;
-void TRACE_add_end_function(void (*func) (void))
-{
- TRACE_end_functions.push_back(func);
-}
-
int TRACE_end()
{
int retval;
PJ_container_release();
PJ_type_release();
- for (auto func: TRACE_end_functions)
- func();
- TRACE_start_functions.clear();
-
xbt_dict_free(&user_link_variables);
xbt_dict_free(&user_host_variables);
xbt_dict_free(&user_vm_variables);
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
-#include <xbt/dict.h>
-#include <xbt/lib.h>
-#include <xbt/log.h>
-
-#include <surf/surf.h>
-#include <surf/surf_routing.h>
+#include "surf/surf.h"
#include "src/instr/instr_private.h"
newContainer->children = xbt_dict_new_homogeneous(nullptr);
if (newContainer->father){
xbt_dict_set(newContainer->father->children, newContainer->name, newContainer, nullptr);
- new_pajeCreateContainer (newContainer);
+ new CreateContainerEvent(newContainer);
}
//register all kinds by name
if (!TRACE_disable_destroy() && container != PJ_container_get_root()){
//do not trace the container destruction if user requests
//or if the container is root
- new_pajeDestroyContainer(container);
+ new DestroyContainerEvent(container);
}
//remove it from allContainers data structure
-/* Copyright (c) 2010, 2012-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Host.hpp"
#include "src/instr/instr_private.h"
#include "src/msg/msg_private.h"
#include "src/simix/ActorImpl.hpp"
//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());
- new_pajeStartLink (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());
- new_pajeEndLink (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);
- new_pajePushState (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);
- new_pajePopState (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);
- new_pajePushState (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);
- new_pajePopState (MSG_get_clock(), process_container, type);
+ new PopStateEvent (MSG_get_clock(), process_container, type);
}
}
if (MSG_vm_is_running(vm))
MSG_vm_shutdown(vm);
- xbt_assert(MSG_vm_is_created(vm), "shutdown the given VM before destroying it");
+ xbt_assert(MSG_vm_is_created(vm) || __MSG_vm_is_state(vm, SURF_VM_STATE_DESTROYED),
+ "shutdown the given VM before destroying it");
/* Then, destroy the VM object */
simgrid::simix::kernelImmediate([vm]() {
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
- new_pajePushState(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());
- new_pajeStartLink(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());
- new_pajeEndLink(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
- new_pajePushState(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);
- new_pajePopState(MSG_get_clock(), vm_container, type);
+ new PopStateEvent(MSG_get_clock(), vm_container, type);
}
}
-/* Copyright (c) 2013-2015. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
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);\
- new_pajeNewEvent (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)\
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
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);
- new_pajePushStateWithExtra (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);
- new_pajePopState (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);
- new_pajePushState (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);
- new_pajePushStateWithExtra (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);
- new_pajePopState (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);
- new_pajePushState (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);
- new_pajePushStateWithExtra (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);
- new_pajePopState (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);
- new_pajePushStateWithExtra (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);
- new_pajePopState (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);
- new_pajePushStateWithExtra (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);
- new_pajePopState (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);
- new_pajeStartLinkWithSize (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);
- new_pajeEndLink (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
+ new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
}
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/instr/instr_private.h"
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
#include "src/kernel/routing/NetZoneImpl.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/xml/platf_private.hpp"
snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
counter++;
- new_pajeStartLink(SIMIX_get_clock(), father, link_type, src, "topology", key);
- new_pajeEndLink(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);
}
- new_pajeSetVariable(0, container, bandwidth, bandwidth_value);
- new_pajeSetVariable(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();
- new_pajeSetVariable (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);