char *filename = TRACE_get_filename();
tracing_file = fopen(filename, "w");
if (tracing_file == NULL) {
- THROWF(system_error, 1, "Tracefile %s could not be opened for writing.",
- filename);
+ THROWF(system_error, 1, "Tracefile %s could not be opened for writing.", filename);
}
XBT_DEBUG("Filename %s is open for writing", filename);
/* output comment file */
dump_comment_file(TRACE_get_comment_file());
-
}
void TRACE_TI_end(void)
prefix = xbt_os_time();
}
- if (!xbt_cfg_get_boolean(_sg_cfg_set, "tracing/smpi/format/ti_one_file")
- || temp == NULL) {
+ if (!xbt_cfg_get_boolean(_sg_cfg_set, "tracing/smpi/format/ti_one_file") || temp == NULL) {
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, ((createContainer_t) event->data)->container->name);
#ifdef WIN32
_mkdir(folder_name);
#else
#endif
temp = fopen(filename, "w");
if (temp == NULL)
- xbt_die("Tracefile %s could not be opened for writing: %s",
- filename, strerror(errno));
+ xbt_die("Tracefile %s could not be opened for writing: %s", filename, strerror(errno));
fprintf(tracing_file, "%s\n", filename);
xbt_free(folder_name);
xbt_free(filename);
}
- xbt_dict_set(tracing_files,
- ((createContainer_t) event->data)->container->name,
- (void *) temp, NULL);
+ xbt_dict_set(tracing_files, ((createContainer_t) event->data)->container->name, (void *) temp, NULL);
}
void print_TIDestroyContainer(paje_event_t event)
{
- if (!xbt_cfg_get_boolean(_sg_cfg_set, "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);
+ if (!xbt_cfg_get_boolean(_sg_cfg_set, "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);
fclose(f);
}
xbt_dict_remove(tracing_files, ((destroyContainer_t) event->data)->container->name);
}
-
void print_TIPushState(paje_event_t event)
{
-
-
int i;
//char* function=NULL;
if (((pushState_t) event->data)->extra == NULL)
return;
- instr_extra_data extra =
- (instr_extra_data) (((pushState_t) event->data)->extra);
+ instr_extra_data extra = (instr_extra_data) (((pushState_t) event->data)->extra);
char *process_id = NULL;
//FIXME: dirty extract "rank-" from the name, as we want the bare process id here
FILE* trace_file = (FILE* )xbt_dict_get(tracing_files, ((pushState_t) event->data)->container->name);
switch (extra->type) {
-
case TRACING_INIT:
fprintf(trace_file, "%s init\n", process_id);
break;
fprintf(trace_file, "%s finalize\n", process_id);
break;
case TRACING_SEND:
- fprintf(trace_file, "%s send %d %d %s\n", process_id, extra->dst,
- extra->send_size, extra->datatype1);
+ 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);
+ 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, "\n");
break;
case TRACING_REDUCE: // rank reduce comm_size comp_size (root) (datatype)
- fprintf(trace_file, "%s reduce %d %f ", process_id, extra->send_size,
- extra->comp_size);
+ fprintf(trace_file, "%s reduce %d %f ", process_id, extra->send_size, extra->comp_size);
if (extra->root != 0 || (extra->datatype1 && strcmp(extra->datatype1, "")))
fprintf(trace_file, "%d %s", extra->root, extra->datatype1);
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 %s \n", extra->datatype1, extra->datatype2);
break;
case TRACING_GATHER: // rank gather send_size recv_size root (sendtype) (recvtype)
- fprintf(trace_file, "%s gather %d %d %d %s %s\n", process_id,
- extra->send_size, extra->recv_size, extra->root, extra->datatype1,
- extra->datatype2);
+ fprintf(trace_file, "%s gather %d %d %d %s %s\n", process_id, extra->send_size, extra->recv_size, extra->root,
+ 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);
case TRACING_SSEND:
case TRACING_ISSEND:
default:
-
- XBT_WARN
- ("Call from %s impossible to translate into replay command : Not implemented (yet)",
+ XBT_WARN ("Call from %s impossible to translate into replay command : Not implemented (yet)",
((pushState_t) event->data)->value->name);
break;
}
static int trace_configured = 0;
static int trace_active = 0;
-
-
static void TRACE_getopts(void)
{
trace_enabled = xbt_cfg_get_boolean(_sg_cfg_set, OPT_TRACING);
if (TRACE_is_enabled()) {
XBT_DEBUG("Tracing starts");
-
/* init the tracing module to generate the right output */
/* open internal buffer */
TRACE_init();
int TRACE_needs_platform (void)
{
- return TRACE_msg_process_is_enabled() ||
- TRACE_msg_vm_is_enabled() ||
- TRACE_categorized() ||
- TRACE_uncategorized() ||
- TRACE_platform () ||
- (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped());
+ return TRACE_msg_process_is_enabled() || TRACE_msg_vm_is_enabled() || TRACE_categorized() ||
+ TRACE_uncategorized() || TRACE_platform () || (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped());
}
int TRACE_is_enabled(void)
int TRACE_smpi_is_enabled(void)
{
- return (trace_smpi_enabled || TRACE_smpi_is_grouped())
- && TRACE_is_enabled();
+ return (trace_smpi_enabled || TRACE_smpi_is_grouped()) && TRACE_is_enabled();
}
int TRACE_smpi_is_grouped(void)
is_initialised = 1;
/* name of the tracefile */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FILENAME,
- "Trace file created by the instrumented SimGrid.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FILENAME, "Trace file created by the instrumented SimGrid.",
xbt_cfgelm_string, 1, 1, NULL);
xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_FILENAME, "simgrid.trace");
/* tracing */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING,
- "Enable Tracing.",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING, "Enable Tracing.", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING, "no");
/* register platform in the trace */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_PLATFORM,
- "Register the platform in the trace as a hierarchy.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_PLATFORM, "Register the platform in the trace as a hierarchy.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_PLATFORM, "no");
/* register platform in the trace */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_TOPOLOGY,
- "Register the platform topology in the trace as a graph.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_TOPOLOGY, "Register the platform topology in the trace as a graph.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_TOPOLOGY, "yes");
/* smpi */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI,
- "Tracing of the SMPI interface.",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI, "Tracing of the SMPI interface.", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_SMPI, "no");
/* smpi grouped */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_GROUP,
- "Group MPI processes by host.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_GROUP, "Group MPI processes by host.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_SMPI_GROUP, "no");
/* smpi computing */
xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_COMPUTING,
- "Generate states for timing out of SMPI parts of the application",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ "Generate states for timing out of SMPI parts of the application", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_SMPI_COMPUTING, "no");
/* smpi sleeping */
xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_SLEEPING,
- "Generate states for timing out of SMPI parts of the application",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ "Generate states for timing out of SMPI parts of the application", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_SMPI_SLEEPING, "no");
-
/* smpi internals */
xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_INTERNALS,
- "View internal messages sent by Collective communications in SMPI",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ "View internal messages sent by Collective communications in SMPI", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_SMPI_INTERNALS, "no");
/* tracing categorized resource utilization traces */
xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_CATEGORIZED,
- "Tracing categorized resource utilization of hosts and links.",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ "Tracing categorized resource utilization of hosts and links.", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_CATEGORIZED, "no");
/* tracing uncategorized resource utilization */
xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_UNCATEGORIZED,
- "Tracing uncategorized resource utilization of hosts and links.",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ "Tracing uncategorized resource utilization of hosts and links.", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_UNCATEGORIZED, "no");
/* msg process */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_PROCESS,
- "Tracing of MSG process behavior.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_PROCESS, "Tracing of MSG process behavior.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_MSG_PROCESS, "no");
/* msg process */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_VM,
- "Tracing of MSG process behavior.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_VM, "Tracing of MSG process behavior.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_MSG_VM, "no");
/* disable tracing link */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_LINK,
- "Do not trace link bandwidth and latency.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_LINK, "Do not trace link bandwidth and latency.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_DISABLE_LINK, "no");
/* disable tracing link */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_POWER,
- "Do not trace host power.",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_POWER, "Do not trace host power.", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_DISABLE_POWER, "no");
-
/* tracing buffer */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BUFFER,
- "Buffer trace events to put them in temporal order.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BUFFER, "Buffer trace events to put them in temporal order.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_BUFFER, "yes");
/* tracing one link only */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_ONELINK_ONLY,
- "Use only routes with one link to trace platform.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_ONELINK_ONLY, "Use only routes with one link to trace platform.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_ONELINK_ONLY, "no");
/* disable destroy */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY,
- "Disable platform containers destruction.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY, "Disable platform containers destruction.",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY, "no");
/* basic -- Avoid extended events (impoverished trace file) */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BASIC,
- "Avoid extended events (impoverished trace file).",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BASIC, "Avoid extended events (impoverished trace file).",
xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_BASIC, "no");
/* display_sizes -- Extended events with message size information */
xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISPLAY_SIZES,
- "(smpi only for now) Extended events with message size information",
- xbt_cfgelm_boolean, 1, 1, NULL);
+ "(smpi only for now) Extended events with message size information", xbt_cfgelm_boolean, 1, 1, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_DISPLAY_SIZES, "no");
/* format -- Switch the ouput format of Tracing */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FORMAT,
- "(smpi only for now) Switch the output format of Tracing",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FORMAT, "(smpi only for now) Switch the output format of Tracing",
xbt_cfgelm_string, 1, 1, NULL);
xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_FORMAT, "Paje");
-
/* format -- Switch the ouput format of Tracing */
xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FORMAT_TI_ONEFILE,
"(smpi only for now) For replay format only : output to one file only",
xbt_cfg_setdefault_boolean(_sg_cfg_set, OPT_TRACING_FORMAT_TI_ONEFILE, "no");
/* comment */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_COMMENT,
- "Comment to be added on the top of the trace file.",
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_COMMENT, "Comment to be added on the top of the trace file.",
xbt_cfgelm_string, 1, 1, NULL);
xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_COMMENT, "");
xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_COMMENT_FILE, "");
/* trace timestamp precision */
- xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_PRECISION,
- "Numerical precision used when timestamping events (hence this value is expressed in number of digits after decimal point)",
- xbt_cfgelm_int, 1, 1, NULL);
+ xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_PRECISION, "Numerical precision used when timestamping events (hence "
+ "this value is expressed in number of digits after decimal point)", xbt_cfgelm_int, 1, 1, NULL);
xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_PRECISION, 6);
/* Viva graph configuration for uncategorized tracing */
void TRACE_help (int detailed)
{
- printf(
- "Description of the tracing options accepted by this simulator:\n\n");
+ printf("Description of the tracing options accepted by this simulator:\n\n");
print_line (OPT_TRACING, "Enable the tracing system",
" It activates the tracing system and register the simulation platform\n"
- " in the trace file. You have to enable this option to others take effect.",
- detailed);
+ " in the trace file. You have to enable this option to others take effect.", detailed);
print_line (OPT_TRACING_CATEGORIZED, "Trace categorized resource utilization",
" It activates the categorized resource utilization tracing. It should\n"
- " be enabled if tracing categories are used by this simulator.",
- detailed);
+ " be enabled if tracing categories are used by this simulator.", detailed);
print_line (OPT_TRACING_UNCATEGORIZED, "Trace uncategorized resource utilization",
" It activates the uncategorized resource utilization tracing. Use it if\n"
" this simulator do not use tracing categories and resource use have to be\n"
- " traced.",
- detailed);
+ " traced.", detailed);
print_line (OPT_TRACING_FILENAME, "Filename to register traces",
" A file with this name will be created to register the simulation. The file\n"
" is in the Paje format and can be analyzed using Viva, Paje, and PajeNG visualization\n"
" tools. More information can be found in these webpages:\n"
" http://github.com/schnorr/viva/\n"
" http://github.com/schnorr/pajeng/\n"
- " http://paje.sourceforge.net/",
- detailed);
+ " http://paje.sourceforge.net/", detailed);
print_line (OPT_TRACING_SMPI, "Trace the MPI Interface (SMPI)",
" This option only has effect if this simulator is SMPI-based. Traces the MPI\n"
" interface and generates a trace that can be analyzed using Gantt-like\n"
" visualizations. Every MPI function (implemented by SMPI) is transformed in a\n"
- " state, and point-to-point communications can be analyzed with arrows.",
- detailed);
+ " state, and point-to-point communications can be analyzed with arrows.", detailed);
print_line (OPT_TRACING_SMPI_GROUP, "Group MPI processes by host (SMPI)",
" This option only has effect if this simulator is SMPI-based. The processes\n"
- " are grouped by the hosts where they were executed.",
- detailed);
+ " are grouped by the hosts where they were executed.", detailed);
print_line (OPT_TRACING_SMPI_COMPUTING, "Generates a \" Computing \" State",
" This option aims at tracing computations in the application, outside SMPI\n"
- " to allow further study of simulated or real computation time",
- detailed);
+ " to allow further study of simulated or real computation time", detailed);
print_line (OPT_TRACING_SMPI_SLEEPING, "Generates a \" Sleeping \" State",
" This option aims at tracing sleeps in the application, outside SMPI\n"
- " to allow further study of simulated or real sleep time",
- detailed);
+ " to allow further study of simulated or real sleep time", detailed);
print_line (OPT_TRACING_SMPI_INTERNALS, "Generates tracing events corresponding",
- " to point-to-point messages sent by collective communications",
- detailed);
+ " to point-to-point messages sent by collective communications", detailed);
print_line (OPT_TRACING_MSG_PROCESS, "Trace processes behavior (MSG)",
" This option only has effect if this simulator is MSG-based. It traces the\n"
" behavior of all categorized MSG processes, grouping them by hosts. This option\n"
- " can be used to track process location if this simulator has process migration.",
- detailed);
+ " can be used to track process location if this simulator has process migration.", detailed);
print_line (OPT_TRACING_BUFFER, "Buffer events to put them in temporal order",
" This option put some events in a time-ordered buffer using the insertion\n"
" sort algorithm. The process of acquiring and releasing locks to access this\n"
" buffer and the cost of the sorting algorithm make this process slow. The\n"
" simulator performance can be severely impacted if this option is activated,\n"
- " but you are sure to get a trace file with events sorted.",
- detailed);
+ " but you are sure to get a trace file with events sorted.", detailed);
print_line (OPT_TRACING_ONELINK_ONLY, "Consider only one link routes to trace platform",
" This option changes the way SimGrid register its platform on the trace file.\n"
" Normally, the tracing considers all routes (no matter their size) on the\n"
" platform file to re-create the resource topology. If this option is activated,\n"
" only the routes with one link are used to register the topology within an AS.\n"
- " Routes among AS continue to be traced as usual.",
- detailed);
+ " Routes among AS continue to be traced as usual.", detailed);
print_line (OPT_TRACING_DISABLE_DESTROY, "Disable platform containers destruction",
" Disable the destruction of containers at the end of simulation. This can be\n"
" used with simulators that have a different notion of time (different from\n"
- " the simulated time).",
- detailed);
+ " the simulated time).", detailed);
print_line (OPT_TRACING_BASIC, "Avoid extended events (impoverished trace file).",
" Some visualization tools are not able to parse correctly the Paje file format.\n"
" Use this option if you are using one of these tools to visualize the simulation\n"
" trace. Keep in mind that the trace might be incomplete, without all the\n"
- " information that would be registered otherwise.",
- detailed);
+ " information that would be registered otherwise.", detailed);
print_line (OPT_TRACING_DISPLAY_SIZES, "Only works for SMPI now. Add message size information",
" Message size (in bytes) is added to links, and to states. For collectives,\n"
" the displayed value is the more relevant to the collective (total sent by\n"
- " the process, usually)",
- detailed);
+ " the process, usually)", detailed);
print_line (OPT_TRACING_FORMAT, "Only works for SMPI now. Switch output format",
" Default format is Paje. Time independent traces are also supported,\n"
- " to output traces that can later be used by the trace replay tool",
- detailed);
+ " to output traces that can later be used by the trace replay tool", detailed);
print_line (OPT_TRACING_FORMAT_TI_ONEFILE, "Only works for SMPI now, and TI output format",
" By default, each process outputs to a separate file, inside a filename_files folder\n"
" By setting this option to yes, all processes will output to only one file\n"
- " This is meant to avoid opening thousands of files with large simulations",
- detailed);
+ " This is meant to avoid opening thousands of files with large simulations", detailed);
print_line (OPT_TRACING_COMMENT, "Comment to be added on the top of the trace file.",
- " Use this to add a comment line to the top of the trace file.",
- detailed);
+ " Use this to add a comment line to the top of the trace file.", detailed);
print_line (OPT_TRACING_COMMENT_FILE, "File contents added to trace file as comment.",
- " Use this to add the contents of a file to the top of the trace file as comment.",
- detailed);
+ " Use this to add the contents of a file to the top of the trace file as comment.", detailed);
print_line (OPT_VIVA_UNCAT_CONF, "Generate a graph configuration for Viva",
" This option can be used in all types of simulators build with SimGrid\n"
" to generate a uncategorized resource utilization graph to be used as\n"
" configuration for the Viva visualization tool. This option\n"
" can be used with tracing/categorized:1 and tracing:1 options to\n"
" analyze an unmodified simulator before changing it to contain\n"
- " categories.",
- detailed);
+ " categories.", detailed);
print_line (OPT_VIVA_CAT_CONF, "Generate an uncategorized graph configuration for Viva",
" This option can be used if this simulator uses tracing categories\n"
" in its code. The file specified by this option holds a graph configuration\n"
" file for the Viva visualization tool that can be used to analyze a categorized\n"
- " resource utilization.",
- detailed);
+ " resource utilization.", detailed);
print_line (OPT_TRACING_TOPOLOGY, "Register the platform topology as a graph",
" This option (enabled by default) can be used to disable the tracing of\n"
" the platform topology in the trace file. Sometimes, such task is really\n"
" time consuming, since it must get the route from each host ot other hosts\n"
- " within the same Autonomous System (AS).",
- detailed);
+ " within the same Autonomous System (AS).", detailed);
}
static void output_types (const char *name, xbt_dynar_t types, FILE *file)
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid_config.h"
-
#include "src/surf/network_interface.hpp"
#include "src/instr/instr_private.h"
#include "surf/surf.h"
/** \ingroup TRACE_category
* \brief Declare a new category with a random color.
*
- * This function should be used to define a user category. The
- * category can be used to differentiate the tasks that are created
- * during the simulation (for example, tasks from server1, server2,
- * or request tasks, computation tasks, communication tasks). All
- * resource utilization (host power and link bandwidth) will be
- * classified according to the task category. Tasks that do not
- * belong to a category are not traced. The color for the category
- * that is being declared is random. This function has no effect
- * if a category with the same name has been already declared.
+ * This function should be used to define a user category. The category can be used to differentiate the tasks that
+ * are created during the simulation (for example, tasks from server1, server2, or request tasks, computation tasks,
+ * communication tasks). All resource utilization (host power and link bandwidth) will be classified according to the
+ * task category. Tasks that do not belong to a category are not traced. The color for the category that is being
+ * declared is random. This function has no effect if a category with the same name has been already declared.
*
- * See \ref tracing for details on how to trace
- * the (categorized) resource utilization.
+ * See \ref tracing for details on how to trace the (categorized) resource utilization.
*
* \param category The name of the new tracing category to be created.
*
/** \ingroup TRACE_category
* \brief Declare a new category with a color.
*
- * Same as #TRACE_category, but let user specify a color encoded as a
- * RGB-like string with three floats from 0 to 1. So, to specify a
- * red color, pass "1 0 0" as color parameter. A light-gray color
- * can be specified using "0.7 0.7 0.7" as color. This function has
- * no effect if a category with the same name has been already declared.
+ * Same as #TRACE_category, but let user specify a color encoded as a RGB-like string with three floats from 0 to 1.
+ * So, to specify a red color, pass "1 0 0" as color parameter. A light-gray color can be specified using "0.7 0.7 0.7"
+ * as color. This function has no effect if a category with the same name has been already declared.
*
- * See \ref tracing for details on how to trace
- * the (categorized) resource utilization.
+ * See \ref tracing for details on how to trace the (categorized) resource utilization.
*
* \param category The name of the new tracing category to be created.
* \param color The color of the category (see \ref tracing to
instr_new_variable_type (category, final_color);
}
-
/** \ingroup TRACE_category
* \brief Get declared categories
*
- * This function should be used to get categories that were already
- * declared with #TRACE_category or with #TRACE_category_with_color.
+ * This function should be used to get categories that were already declared with #TRACE_category or with
+ * #TRACE_category_with_color.
*
- * See \ref tracing for details on how to trace
- * the (categorized) resource utilization.
+ * See \ref tracing for details on how to trace the (categorized) resource utilization.
*
* \return A dynar with the declared categories, must be freed with xbt_dynar_free.
*
/** \ingroup TRACE_mark
* \brief Declare a new type for tracing mark.
*
- * This function declares a new Paje event
- * type in the trace file that can be used by
- * simulators to declare application-level
- * marks. This function is independent of
- * which API is used in SimGrid.
+ * This function declares a new Paje event type in the trace file that can be used by simulators to declare
+ * application-level marks. This function is independent of which API is used in SimGrid.
*
* \param mark_type The name of the new type.
*
/** \ingroup TRACE_mark
* \brief Declare a new colored value for a previously declared mark type.
*
- * This function declares a new colored value for a Paje event
- * type in the trace file that can be used by
- * simulators to declare application-level
- * marks. This function is independent of
- * which API is used in SimGrid. The color needs to be
+ * This function declares a new colored value for a Paje event type in the trace file that can be used by simulators to
+ * declare application-level marks. This function is independent of which API is used in SimGrid. The color needs to be
* a string with three numbers separated by spaces in the range [0,1].
- * A light-gray color can be specified using "0.7 0.7 0.7" as color.
- * If a NULL color is provided, the color used will be white ("1 1 1").
+ * A light-gray color can be specified using "0.7 0.7 0.7" as color. If a NULL color is provided, the color used will
+ * be white ("1 1 1").
*
* \param mark_type The name of the new type.
* \param mark_value The name of the new value for this type.
/** \ingroup TRACE_mark
* \brief Declare a new value for a previously declared mark type.
*
- * This function declares a new value for a Paje event
- * type in the trace file that can be used by
- * simulators to declare application-level
- * marks. This function is independent of
- * which API is used in SimGrid. Calling this function is the same
- * as calling \ref TRACE_declare_mark_value_with_color with a NULL color.
+ * This function declares a new value for a Paje event type in the trace file that can be used by simulators to declare
+ * application-level marks. This function is independent of which API is used in SimGrid. Calling this function is the
+ * same as calling \ref TRACE_declare_mark_value_with_color with a NULL color.
*
* \param mark_type The name of the new type.
* \param mark_value The name of the new value for this type.
* \ingroup TRACE_mark
* \brief Create a new instance of a tracing mark type.
*
- * This function creates a mark in the trace file. The
- * first parameter had to be previously declared using
- * #TRACE_declare_mark, the second is the identifier
- * for this mark instance. We recommend that the
- * mark_value is a unique value for the whole simulation.
- * Nevertheless, this is not a strong requirement: the
- * trace will be valid even if there are multiple mark
- * identifiers for the same trace.
+ * This function creates a mark in the trace file. The first parameter had to be previously declared using
+ * #TRACE_declare_mark, the second is the identifier for this mark instance. We recommend that the mark_value is a
+ * unique value for the whole simulation. Nevertheless, this is not a strong requirement: the trace will be valid even
+ * if there are multiple mark identifiers for the same trace.
*
* \param mark_type The name of the type for which the new instance will belong.
* \param mark_value The name of the new instance mark.
/** \ingroup TRACE_mark
* \brief Get declared marks
*
- * This function should be used to get marks that were already
- * declared with #TRACE_declare_mark.
+ * This function should be used to get marks that were already declared with #TRACE_declare_mark.
*
* \return A dynar with the declared marks, must be freed with xbt_dynar_free.
- *
*/
xbt_dynar_t TRACE_get_marks (void)
{
return instr_dict_to_dynar (declared_marks);
}
-static void instr_user_variable(double time,
- const char *resource,
- const char *variable,
- const char *father_type,
- double value,
- InstrUserVariable what,
- const char *color,
- xbt_dict_t filter)
+static void instr_user_variable(double time, const char *resource, const char *variable, const char *father_type,
+ double value, InstrUserVariable what, const char *color, xbt_dict_t filter)
{
/* safe switch */
if (!TRACE_is_enabled()) return;
//check if variable is already declared
char *created = (char*)xbt_dict_get_or_null(filter, variable);
if (what == INSTR_US_DECLARE){
- if (created){
- //already declared
+ if (created){//already declared
return;
}else{
xbt_dict_set (filter, variable, xbt_strdup("1"), NULL);
}
}else{
- if (!created){
- //not declared, ignore
+ if (!created){//not declared, ignore
return;
}
}
instr_new_user_variable_type (father_type, variable, color);
break;
case INSTR_US_SET:
- {
- container_t container = PJ_container_get(resource);
- type_t type = PJ_type_get (variable, container->type);
- new_pajeSetVariable(time, container, type, value);
+ {
+ container_t container = PJ_container_get(resource);
+ type_t type = PJ_type_get (variable, container->type);
+ new_pajeSetVariable(time, container, type, value);
+ }
break;
- }
case INSTR_US_ADD:
- {
- container_t container = PJ_container_get(resource);
- type_t type = PJ_type_get (variable, container->type);
- new_pajeAddVariable(time, container, type, value);
+ {
+ container_t container = PJ_container_get(resource);
+ type_t type = PJ_type_get (variable, container->type);
+ new_pajeAddVariable(time, container, type, value);
+ }
break;
- }
case INSTR_US_SUB:
- {
- container_t container = PJ_container_get(resource);
- type_t type = PJ_type_get (variable, container->type);
- new_pajeSubVariable(time, container, type, value);
- break;
- }
+ {
+ container_t container = PJ_container_get(resource);
+ type_t type = PJ_type_get (variable, container->type);
+ new_pajeSubVariable(time, container, type, value);
+ }
+ break;
default:
//TODO: launch exception
break;
}
}
-static void instr_user_srcdst_variable(double time,
- const char *src,
- const char *dst,
- const char *variable,
- const char *father_type,
- double value,
- InstrUserVariable what)
+static void instr_user_srcdst_variable(double time, const char *src, const char *dst, const char *variable,
+ const char *father_type, double value, InstrUserVariable what)
{
sg_netcard_t src_elm = sg_netcard_by_name_or_null(src);
if(!src_elm) xbt_die("Element '%s' not found!",src);
/** \ingroup TRACE_API
* \brief Creates a file with the topology of the platform file used for the simulator.
*
- * The graph topology will have the following properties: all hosts, links and routers
- * of the platform file are mapped to graph nodes; routes are mapped to edges.
+ * The graph topology will have the following properties: all hosts, links and routers of the platform file are mapped
+ * to graph nodes; routes are mapped to edges.
* The platform's AS are not represented in the output.
*
* \param filename The name of the file that will hold the graph.
}
/*
- * Derived functions that use instr_user_variable and TRACE_user_srcdst_variable.
- * They were previously defined as pre-processors directives, but were transformed
- * into functions so the user can track them using gdb.
+ * Derived functions that use instr_user_variable and TRACE_user_srcdst_variable. They were previously defined as
+ * pre-processors directives, but were transformed into functions so the user can track them using gdb.
*/
/* for VM variables */
/** \ingroup TRACE_user_variables
* \brief Declare a new user variable associated to VMs.
*
- * Declare a user variable that will be associated to VMs.
- * A user vm variable can be used to trace user variables
- * such as the number of tasks in a VM, the number of
- * clients in an application (for VMs), and so on. The color
+ * Declare a user variable that will be associated to VMs. A user vm variable can be used to trace user variables
+ * such as the number of tasks in a VM, the number of clients in an application (for VMs), and so on. The color
* associated to this new variable will be random.
*
* \param variable The name of the new variable to be declared.
/** \ingroup TRACE_user_variables
* \brief Declare a new user variable associated to VMs with a color.
*
- * Same as #TRACE_vm_variable_declare, but associated a color
- * to the newly created user host variable. The color needs to be
- * a string with three numbers separated by spaces in the range [0,1].
+ * Same as #TRACE_vm_variable_declare, but associated a color to the newly created user host variable. The color needs
+ * to be a string with three numbers separated by spaces in the range [0,1].
* A light-gray color can be specified using "0.7 0.7 0.7" as color.
*
* \param variable The name of the new variable to be declared.
* \param color The color for the new variable.
- *
*/
void TRACE_vm_variable_declare_with_color (const char *variable, const char *color)
{
*/
void TRACE_vm_variable_set (const char *vm, const char *variable, double value)
{
-
TRACE_vm_variable_set_with_time (MSG_get_clock(), vm, variable, value);
}
/** \ingroup TRACE_user_variables
* \brief Set the value of a variable of a VM at a given timestamp.
*
- * Same as #TRACE_vm_variable_set, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_vm_variable_set, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param vm The name of the VM to be considered.
/** \ingroup TRACE_user_variables
* \brief Add a value to a variable of a VM at a given timestamp.
*
- * Same as #TRACE_vm_variable_add, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_vm_variable_add, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param vm The name of the VM to be considered.
/** \ingroup TRACE_user_variables
* \brief Subtract a value from a variable of a VM at a given timestamp.
*
- * Same as #TRACE_vm_variable_sub, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_vm_variable_sub, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param vm The name of the VM to be considered.
/** \ingroup TRACE_user_variables
* \brief Get declared user vm variables
*
- * This function should be used to get VM variables that were already
- * declared with #TRACE_vm_variable_declare or with #TRACE_vm_variable_declare_with_color.
+ * This function should be used to get VM variables that were already declared with #TRACE_vm_variable_declare or with
+ * #TRACE_vm_variable_declare_with_color.
*
* \return A dynar with the declared host variables, must be freed with xbt_dynar_free.
*/
return instr_dict_to_dynar (user_vm_variables);
}
-
-
/* for host variables */
/** \ingroup TRACE_user_variables
* \brief Declare a new user variable associated to hosts.
*
* Declare a user variable that will be associated to hosts.
- * A user host variable can be used to trace user variables
- * such as the number of tasks in a server, the number of
- * clients in an application (for hosts), and so on. The color
- * associated to this new variable will be random.
+ * A user host variable can be used to trace user variables such as the number of tasks in a server, the number of
+ * clients in an application (for hosts), and so on. The color associated to this new variable will be random.
*
* \param variable The name of the new variable to be declared.
*
/** \ingroup TRACE_user_variables
* \brief Declare a new user variable associated to hosts with a color.
*
- * Same as #TRACE_host_variable_declare, but associated a color
- * to the newly created user host variable. The color needs to be
- * a string with three numbers separated by spaces in the range [0,1].
+ * Same as #TRACE_host_variable_declare, but associated a color to the newly created user host variable. The color
+ * needs to be a string with three numbers separated by spaces in the range [0,1].
* A light-gray color can be specified using "0.7 0.7 0.7" as color.
*
* \param variable The name of the new variable to be declared.
* \param color The color for the new variable.
- *
*/
void TRACE_host_variable_declare_with_color (const char *variable, const char *color)
{
/** \ingroup TRACE_user_variables
* \brief Set the value of a variable of a host at a given timestamp.
*
- * Same as #TRACE_host_variable_set, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_host_variable_set, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param host The name of the host to be considered.
/** \ingroup TRACE_user_variables
* \brief Add a value to a variable of a host at a given timestamp.
*
- * Same as #TRACE_host_variable_add, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_host_variable_add, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param host The name of the host to be considered.
/** \ingroup TRACE_user_variables
* \brief Subtract a value from a variable of a host at a given timestamp.
*
- * Same as #TRACE_host_variable_sub, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_host_variable_sub, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param host The name of the host to be considered.
/** \ingroup TRACE_user_variables
* \brief Get declared user host variables
*
- * This function should be used to get host variables that were already
- * declared with #TRACE_host_variable_declare or with #TRACE_host_variable_declare_with_color.
+ * This function should be used to get host variables that were already declared with #TRACE_host_variable_declare or
+ * with #TRACE_host_variable_declare_with_color.
*
* \return A dynar with the declared host variables, must be freed with xbt_dynar_free.
*/
* \brief Declare a new user variable associated to links.
*
* Declare a user variable that will be associated to links.
- * A user link variable can be used, for example, to trace
- * user variables such as the number of messages being
- * transferred through network links. The color
- * associated to this new variable will be random.
+ * A user link variable can be used, for example, to trace user variables such as the number of messages being
+ * transferred through network links. The color associated to this new variable will be random.
*
* \param variable The name of the new variable to be declared.
*
/** \ingroup TRACE_user_variables
* \brief Declare a new user variable associated to links with a color.
*
- * Same as #TRACE_link_variable_declare, but associated a color
- * to the newly created user link variable. The color needs to be
- * a string with three numbers separated by spaces in the range [0,1].
+ * Same as #TRACE_link_variable_declare, but associated a color to the newly created user link variable. The color
+ * needs to be a string with three numbers separated by spaces in the range [0,1].
* A light-gray color can be specified using "0.7 0.7 0.7" as color.
*
* \param variable The name of the new variable to be declared.
* \param color The color for the new variable.
- *
*/
void TRACE_link_variable_declare_with_color (const char *variable, const char *color)
{
/** \ingroup TRACE_user_variables
* \brief Set the value of a variable of a link at a given timestamp.
*
- * Same as #TRACE_link_variable_set, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_link_variable_set, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param link The name of the link to be considered.
/** \ingroup TRACE_user_variables
* \brief Add a value to a variable of a link at a given timestamp.
*
- * Same as #TRACE_link_variable_add, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_link_variable_add, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param link The name of the link to be considered.
/** \ingroup TRACE_user_variables
* \brief Subtract a value from a variable of a link at a given timestamp.
*
- * Same as #TRACE_link_variable_sub, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_link_variable_sub, but let user specify the time used to trace it. Users can specify a time that
+ * is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param link The name of the link to be considered.
/** \ingroup TRACE_user_variables
* \brief Set the value of the variable present in the links connecting source and destination.
*
- * Same as #TRACE_link_variable_set, but instead of providing the
- * name of link to be considered, provide the source and destination
- * hosts. All links that are part of the route between source and
- * destination will have the variable set to the provided value.
+ * Same as #TRACE_link_variable_set, but instead of providing the name of link to be considered, provide the source
+ * and destination hosts. All links that are part of the route between source and destination will have the variable
+ * set to the provided value.
*
* \param src The name of the source host for get route.
* \param dst The name of the destination host for get route.
/** \ingroup TRACE_user_variables
* \brief Add a value to the variable present in the links connecting source and destination.
*
- * Same as #TRACE_link_variable_add, but instead of providing the
- * name of link to be considered, provide the source and destination
- * hosts. All links that are part of the route between source and
- * destination will have the value passed as parameter added to
- * the current value of the variable name to be considered.
+ * Same as #TRACE_link_variable_add, but instead of providing the name of link to be considered, provide the source
+ * and destination hosts. All links that are part of the route between source and destination will have the value
+ * passed as parameter added to the current value of the variable name to be considered.
*
* \param src The name of the source host for get route.
* \param dst The name of the destination host for get route.
/** \ingroup TRACE_user_variables
* \brief Subtract a value from the variable present in the links connecting source and destination.
*
- * Same as #TRACE_link_variable_sub, but instead of providing the
- * name of link to be considered, provide the source and destination
- * hosts. All links that are part of the route between source and
- * destination will have the value passed as parameter subtracted from
- * the current value of the variable name to be considered.
+ * Same as #TRACE_link_variable_sub, but instead of providing the name of link to be considered, provide the source
+ * and destination hosts. All links that are part of the route between source and destination will have the value
+ * passed as parameter subtracted from the current value of the variable name to be considered.
*
* \param src The name of the source host for get route.
* \param dst The name of the destination host for get route.
/** \ingroup TRACE_user_variables
* \brief Set the value of the variable present in the links connecting source and destination at a given timestamp.
*
- * Same as #TRACE_link_srcdst_variable_set, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_link_srcdst_variable_set, but let user specify the time used to trace it. Users can specify a time
+ * that is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param src The name of the source host for get route.
*
* \see TRACE_link_variable_declare, TRACE_link_srcdst_variable_add_with_time, TRACE_link_srcdst_variable_sub_with_time
*/
-void TRACE_link_srcdst_variable_set_with_time (double time, const char *src, const char *dst, const char *variable, double value)
+void TRACE_link_srcdst_variable_set_with_time (double time, const char *src, const char *dst, const char *variable,
+ double value)
{
instr_user_srcdst_variable (time, src, dst, variable, "LINK", value, INSTR_US_SET);
}
/** \ingroup TRACE_user_variables
* \brief Add a value to the variable present in the links connecting source and destination at a given timestamp.
*
- * Same as #TRACE_link_srcdst_variable_add, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_link_srcdst_variable_add, but let user specify the time used to trace it. Users can specify a time
+ * that is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param src The name of the source host for get route.
*
* \see TRACE_link_variable_declare, TRACE_link_srcdst_variable_set_with_time, TRACE_link_srcdst_variable_sub_with_time
*/
-void TRACE_link_srcdst_variable_add_with_time (double time, const char *src, const char *dst, const char *variable, double value)
+void TRACE_link_srcdst_variable_add_with_time (double time, const char *src, const char *dst, const char *variable,
+ double value)
{
instr_user_srcdst_variable (time, src, dst, variable, "LINK", value, INSTR_US_ADD);
}
/** \ingroup TRACE_user_variables
- * \brief Subtract a value from the variable present in the links connecting source and destination at a given timestamp.
+ * \brief Subtract a value from the variable present in the links connecting source and dest. at a given timestamp.
*
- * Same as #TRACE_link_srcdst_variable_sub, but let user specify
- * the time used to trace it. Users can specify a time that
- * is not the simulated clock time as defined by the core
- * simulator. This allows a fine-grain control of time
- * definition, but should be used with caution since the trace
- * can be inconsistent if resource utilization traces are also traced.
+ * Same as #TRACE_link_srcdst_variable_sub, but let user specify the time used to trace it. Users can specify a time
+ * that is not the simulated clock time as defined by the core simulator. This allows a fine-grain control of time
+ * definition, but should be used with caution since the trace can be inconsistent if resource utilization traces are
+ * also traced.
*
* \param time The timestamp to be used to tag this change of value.
* \param src The name of the source host for get route.
*
* \see TRACE_link_variable_declare, TRACE_link_srcdst_variable_set_with_time, TRACE_link_srcdst_variable_add_with_time
*/
-void TRACE_link_srcdst_variable_sub_with_time (double time, const char *src, const char *dst, const char *variable, double value)
+void TRACE_link_srcdst_variable_sub_with_time (double time, const char *src, const char *dst, const char *variable,
+ double value)
{
instr_user_srcdst_variable (time, src, dst, variable, "LINK", value, INSTR_US_SUB);
}
/** \ingroup TRACE_user_variables
* \brief Get declared user link variables
*
- * This function should be used to get link variables that were already
- * declared with #TRACE_link_variable_declare or with #TRACE_link_variable_declare_with_color.
+ * This function should be used to get link variables that were already declared with #TRACE_link_variable_declare or
+ * with #TRACE_link_variable_declare_with_color.
*
* \return A dynar with the declared link variables, must be freed with xbt_dynar_free.
*/
/** \ingroup TRACE_user_variables
* \brief Declare a new value for a user state associated to hosts.
*
- * Declare a value for a state. The color needs to be
- * a string with three numbers separated by spaces in the range [0,1].
+ * Declare a value for a state. The color needs to be a string with 3 numbers separated by spaces in the range [0,1].
* A light-gray color can be specified using "0.7 0.7 0.7" as color.
*
* \param state The name of the new state to be declared.
{
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, NULL, type); /* if user didn't declare a value with a color, user a NULL color */
+ val_t val = PJ_value_get_or_new (value, NULL, type); /* if user didn't declare a value with a color, use NULL color */
new_pajeSetState(MSG_get_clock(), container, type, val);
}
{
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, NULL, type); /* if user didn't declare a value with a color, user a NULL color */
+ val_t val = PJ_value_get_or_new (value, NULL, type); /* if user didn't declare a value with a color, use NULL color */
new_pajePushState(MSG_get_clock(), container, type, val);
}
/** \ingroup TRACE_API
* \brief Get Paje container types that can be mapped to the nodes of a graph.
*
- * This function can be used to create a user made
- * graph configuration file for Triva. Normally, it is
- * used with the functions defined in \ref TRACE_user_variables.
+ * This function can be used to create a user made graph configuration file for Triva. Normally, it is used with the
+ * functions defined in \ref TRACE_user_variables.
*
* \return A dynar with the types, must be freed with xbt_dynar_free.
*/
/** \ingroup TRACE_API
* \brief Get Paje container types that can be mapped to the edges of a graph.
*
- * This function can be used to create a user made
- * graph configuration file for Triva. Normally, it is
- * used with the functions defined in \ref TRACE_user_variables.
+ * This function can be used to create a user made graph configuration file for Triva. Normally, it is used with the
+ * functions defined in \ref TRACE_user_variables.
*
* \return A dynar with the types, must be freed with xbt_dynar_free.
*/
if (newContainer->kind == INSTR_HOST || newContainer->kind == INSTR_LINK || newContainer->kind == INSTR_ROUTER) {
xbt_dict_set (trivaNodeTypes, newContainer->type->name, xbt_strdup("1"), NULL);
}
-
return newContainer;
}
XBT_DEBUG("Filename %s is open for writing", filename);
/* output generator version */
- fprintf (tracing_file, "#This file was generated using SimGrid-%d.%d.%d\n", SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, SIMGRID_VERSION_PATCH);
+ fprintf (tracing_file, "#This file was generated using SimGrid-%d.%d.%d\n",
+ SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, SIMGRID_VERSION_PATCH);
fprintf (tracing_file, "#[");
unsigned int cpt;
char *str;
/* output header */
TRACE_header(TRACE_basic(),TRACE_display_sizes());
-
}
void TRACE_paje_end(void)
XBT_DEBUG("Filename %s is closed", filename);
}
-
void print_pajeDefineContainerType(paje_event_t event)
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event->event_type);
- fprintf(tracing_file, "%d %s %s %s\n",
- (int)event->event_type,
- ((defineContainerType_t)event->data)->type->id,
- ((defineContainerType_t)event->data)->type->father->id,
- ((defineContainerType_t)event->data)->type->name);
+ fprintf(tracing_file, "%d %s %s %s\n", (int)event->event_type, ((defineContainerType_t)event->data)->type->id,
+ ((defineContainerType_t)event->data)->type->father->id, ((defineContainerType_t)event->data)->type->name);
}
void print_pajeDefineVariableType(paje_event_t event)
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event->event_type);
- fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
- (int)event->event_type,
- ((defineVariableType_t)event->data)->type->id,
- ((defineVariableType_t)event->data)->type->father->id,
- ((defineVariableType_t)event->data)->type->name,
- ((defineVariableType_t)event->data)->type->color);
+ fprintf(tracing_file, "%d %s %s %s \"%s\"\n", (int)event->event_type,
+ ((defineVariableType_t)event->data)->type->id, ((defineVariableType_t)event->data)->type->father->id,
+ ((defineVariableType_t)event->data)->type->name, ((defineVariableType_t)event->data)->type->color);
}
void print_pajeDefineStateType(paje_event_t event)
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event->event_type);
- fprintf(tracing_file, "%d %s %s %s\n",
- (int)event->event_type,
- ((defineStateType_t)event->data)->type->id,
- ((defineStateType_t)event->data)->type->father->id,
- ((defineStateType_t)event->data)->type->name);
+ fprintf(tracing_file, "%d %s %s %s\n", (int)event->event_type, ((defineStateType_t)event->data)->type->id,
+ ((defineStateType_t)event->data)->type->father->id, ((defineStateType_t)event->data)->type->name);
}
void print_pajeDefineEventType(paje_event_t event)
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event->event_type);
- fprintf(tracing_file, "%d %s %s %s\n",
- (int)event->event_type,
- ((defineEventType_t)event->data)->type->id,
- ((defineEventType_t)event->data)->type->father->id,
- ((defineEventType_t)event->data)->type->name);
+ fprintf(tracing_file, "%d %s %s %s\n", (int)event->event_type, ((defineEventType_t)event->data)->type->id,
+ ((defineEventType_t)event->data)->type->father->id, ((defineEventType_t)event->data)->type->name);
}
void print_pajeDefineLinkType(paje_event_t event)
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event->event_type);
- fprintf(tracing_file, "%d %s %s %s %s %s\n",
- (int)event->event_type,
- ((defineLinkType_t)event->data)->type->id,
- ((defineLinkType_t)event->data)->type->father->id,
- ((defineLinkType_t)event->data)->source->id,
- ((defineLinkType_t)event->data)->dest->id,
- ((defineLinkType_t)event->data)->type->name);
+ fprintf(tracing_file, "%d %s %s %s %s %s\n", (int)event->event_type, ((defineLinkType_t)event->data)->type->id,
+ ((defineLinkType_t)event->data)->type->father->id, ((defineLinkType_t)event->data)->source->id,
+ ((defineLinkType_t)event->data)->dest->id, ((defineLinkType_t)event->data)->type->name);
}
void print_pajeDefineEntityValue (paje_event_t event)
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event->event_type);
- fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
- (int)event->event_type,
- ((defineEntityValue_t)event->data)->value->id,
- ((defineEntityValue_t)event->data)->value->father->id,
- ((defineEntityValue_t)event->data)->value->name,
+ fprintf(tracing_file, "%d %s %s %s \"%s\"\n", (int)event->event_type, ((defineEntityValue_t)event->data)->value->id,
+ ((defineEntityValue_t)event->data)->value->father->id, ((defineEntityValue_t)event->data)->value->name,
((defineEntityValue_t)event->data)->value->color);
}
void print_pajeCreateContainer(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s \"%s\"\n",
- (int)event->event_type,
- ((createContainer_t)event->data)->container->id,
- ((createContainer_t)event->data)->container->type->id,
- ((createContainer_t)event->data)->container->father->id,
- ((createContainer_t)event->data)->container->name);
+ fprintf(tracing_file, "%d 0 %s %s %s \"%s\"\n", (int)event->event_type,
+ ((createContainer_t)event->data)->container->id, ((createContainer_t)event->data)->container->type->id,
+ ((createContainer_t)event->data)->container->father->id, ((createContainer_t)event->data)->container->name);
}else{
- fprintf(tracing_file, "%d %.*f %s %s %s \"%s\"\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((createContainer_t)event->data)->container->id,
- ((createContainer_t)event->data)->container->type->id,
- ((createContainer_t)event->data)->container->father->id,
- ((createContainer_t)event->data)->container->name);
+ fprintf(tracing_file, "%d %.*f %s %s %s \"%s\"\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((createContainer_t)event->data)->container->id, ((createContainer_t)event->data)->container->type->id,
+ ((createContainer_t)event->data)->container->father->id, ((createContainer_t)event->data)->container->name);
}
}
void print_pajeDestroyContainer(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s\n",
- (int)event->event_type,
- ((destroyContainer_t)event->data)->container->type->id,
- ((destroyContainer_t)event->data)->container->id);
+ fprintf(tracing_file, "%d 0 %s %s\n", (int)event->event_type,
+ ((destroyContainer_t)event->data)->container->type->id, ((destroyContainer_t)event->data)->container->id);
}else{
- fprintf(tracing_file, "%d %.*f %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((destroyContainer_t)event->data)->container->type->id,
- ((destroyContainer_t)event->data)->container->id);
+ fprintf(tracing_file, "%d %.*f %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((destroyContainer_t)event->data)->container->type->id, ((destroyContainer_t)event->data)->container->id);
}
}
void print_pajeSetVariable(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %f\n",
- (int)event->event_type,
- ((setVariable_t)event->data)->type->id,
- ((setVariable_t)event->data)->container->id,
- ((setVariable_t)event->data)->value);
+ fprintf(tracing_file, "%d 0 %s %s %f\n", (int)event->event_type, ((setVariable_t)event->data)->type->id,
+ ((setVariable_t)event->data)->container->id, ((setVariable_t)event->data)->value);
}else{
- fprintf(tracing_file, "%d %.*f %s %s %f\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((setVariable_t)event->data)->type->id,
- ((setVariable_t)event->data)->container->id,
+ fprintf(tracing_file, "%d %.*f %s %s %f\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((setVariable_t)event->data)->type->id, ((setVariable_t)event->data)->container->id,
((setVariable_t)event->data)->value);
}
}
void print_pajeAddVariable(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %f\n",
- (int)event->event_type,
- ((addVariable_t)event->data)->type->id,
- ((addVariable_t)event->data)->container->id,
- ((addVariable_t)event->data)->value);
+ fprintf(tracing_file, "%d 0 %s %s %f\n", (int)event->event_type, ((addVariable_t)event->data)->type->id,
+ ((addVariable_t)event->data)->container->id, ((addVariable_t)event->data)->value);
}else{
- fprintf(tracing_file, "%d %.*f %s %s %f\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((addVariable_t)event->data)->type->id,
- ((addVariable_t)event->data)->container->id,
+ fprintf(tracing_file, "%d %.*f %s %s %f\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((addVariable_t)event->data)->type->id, ((addVariable_t)event->data)->container->id,
((addVariable_t)event->data)->value);
}
}
void print_pajeSubVariable(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %f\n",
- (int)event->event_type,
- ((subVariable_t)event->data)->type->id,
- ((subVariable_t)event->data)->container->id,
- ((subVariable_t)event->data)->value);
+ fprintf(tracing_file, "%d 0 %s %s %f\n", (int)event->event_type, ((subVariable_t)event->data)->type->id,
+ ((subVariable_t)event->data)->container->id, ((subVariable_t)event->data)->value);
}else{
- fprintf(tracing_file, "%d %.*f %s %s %f\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((subVariable_t)event->data)->type->id,
- ((subVariable_t)event->data)->container->id,
+ fprintf(tracing_file, "%d %.*f %s %s %f\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((subVariable_t)event->data)->type->id, ((subVariable_t)event->data)->container->id,
((subVariable_t)event->data)->value);
}
}
void print_pajeSetState(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s\n",
- (int)event->event_type,
- ((setState_t)event->data)->type->id,
- ((setState_t)event->data)->container->id,
- ((setState_t)event->data)->value->id);
+ fprintf(tracing_file, "%d 0 %s %s %s\n", (int)event->event_type, ((setState_t)event->data)->type->id,
+ ((setState_t)event->data)->container->id, ((setState_t)event->data)->value->id);
}else{
- fprintf(tracing_file, "%d %.*f %s %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((setState_t)event->data)->type->id,
- ((setState_t)event->data)->container->id,
+ fprintf(tracing_file, "%d %.*f %s %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((setState_t)event->data)->type->id, ((setState_t)event->data)->container->id,
((setState_t)event->data)->value->id);
}
}
void print_pajePushState(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (!TRACE_display_sizes()){
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s\n",
- (int)event->event_type,
- ((pushState_t)event->data)->type->id,
- ((pushState_t)event->data)->container->id,
- ((pushState_t)event->data)->value->id);
+ fprintf(tracing_file, "%d 0 %s %s %s\n", (int)event->event_type, ((pushState_t)event->data)->type->id,
+ ((pushState_t)event->data)->container->id, ((pushState_t)event->data)->value->id);
}else{
- fprintf(tracing_file, "%d %.*f %s %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((pushState_t)event->data)->type->id,
- ((pushState_t)event->data)->container->id,
+ fprintf(tracing_file, "%d %.*f %s %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((pushState_t)event->data)->type->id, ((pushState_t)event->data)->container->id,
((pushState_t)event->data)->value->id);
}
}else{
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s ",
- (int)event->event_type,
- ((pushState_t)event->data)->type->id,
- ((pushState_t)event->data)->container->id,
- ((pushState_t)event->data)->value->id);
+ fprintf(tracing_file, "%d 0 %s %s %s ", (int)event->event_type, ((pushState_t)event->data)->type->id,
+ ((pushState_t)event->data)->container->id, ((pushState_t)event->data)->value->id);
if(((pushState_t)event->data)->extra !=NULL){
fprintf(tracing_file, "%d ", ((instr_extra_data)((pushState_t)event->data)->extra)->send_size);
}else{
fprintf(tracing_file, "\n");
}else{
- fprintf(tracing_file, "%d %.*f %s %s %s ",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((pushState_t)event->data)->type->id,
- ((pushState_t)event->data)->container->id,
+ fprintf(tracing_file, "%d %.*f %s %s %s ", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((pushState_t)event->data)->type->id, ((pushState_t)event->data)->container->id,
((pushState_t)event->data)->value->id);
if(((pushState_t)event->data)->extra !=NULL){
fprintf(tracing_file, "%d ", ((instr_extra_data)((pushState_t)event->data)->extra)->send_size);
fprintf(tracing_file, "0 ");
}
fprintf(tracing_file, "\n");
-
}
}
if(((pushState_t)event->data)->extra!=NULL){
void print_pajePopState(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s\n",
- (int)event->event_type,
- ((popState_t)event->data)->type->id,
+ fprintf(tracing_file, "%d 0 %s %s\n", (int)event->event_type, ((popState_t)event->data)->type->id,
((popState_t)event->data)->container->id);
}else{
- fprintf(tracing_file, "%d %.*f %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((popState_t)event->data)->type->id,
- ((popState_t)event->data)->container->id);
+ fprintf(tracing_file, "%d %.*f %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((popState_t)event->data)->type->id, ((popState_t)event->data)->container->id);
}
}
void print_pajeResetState(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s\n",
- (int)event->event_type,
- ((resetState_t)event->data)->type->id,
+ fprintf(tracing_file, "%d 0 %s %s\n", (int)event->event_type, ((resetState_t)event->data)->type->id,
((resetState_t)event->data)->container->id);
}else{
- fprintf(tracing_file, "%d %.*f %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((resetState_t)event->data)->type->id,
- ((resetState_t)event->data)->container->id);
+ fprintf(tracing_file, "%d %.*f %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((resetState_t)event->data)->type->id, ((resetState_t)event->data)->container->id);
}
}
{
if (!TRACE_display_sizes()){
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
- (int)event->event_type,
- ((startLink_t)event->data)->type->id,
- ((startLink_t)event->data)->container->id,
- ((startLink_t)event->data)->value,
- ((startLink_t)event->data)->sourceContainer->id,
- ((startLink_t)event->data)->key);
+ fprintf(tracing_file, "%d 0 %s %s %s %s %s\n", (int)event->event_type, ((startLink_t)event->data)->type->id,
+ ((startLink_t)event->data)->container->id, ((startLink_t)event->data)->value,
+ ((startLink_t)event->data)->sourceContainer->id, ((startLink_t)event->data)->key);
}else {
- fprintf(tracing_file, "%d %.*f %s %s %s %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((startLink_t)event->data)->type->id,
- ((startLink_t)event->data)->container->id,
- ((startLink_t)event->data)->value,
- ((startLink_t)event->data)->sourceContainer->id,
+ fprintf(tracing_file, "%d %.*f %s %s %s %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((startLink_t)event->data)->type->id, ((startLink_t)event->data)->container->id,
+ ((startLink_t)event->data)->value, ((startLink_t)event->data)->sourceContainer->id,
((startLink_t)event->data)->key);
}
}else{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s %s %s %d\n",
- (int)event->event_type,
- ((startLink_t)event->data)->type->id,
- ((startLink_t)event->data)->container->id,
- ((startLink_t)event->data)->value,
- ((startLink_t)event->data)->sourceContainer->id,
- ((startLink_t)event->data)->key,
+ fprintf(tracing_file, "%d 0 %s %s %s %s %s %d\n", (int)event->event_type, ((startLink_t)event->data)->type->id,
+ ((startLink_t)event->data)->container->id, ((startLink_t)event->data)->value,
+ ((startLink_t)event->data)->sourceContainer->id, ((startLink_t)event->data)->key,
((startLink_t)event->data)->size);
}else {
- fprintf(tracing_file, "%d %.*f %s %s %s %s %s %d\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((startLink_t)event->data)->type->id,
- ((startLink_t)event->data)->container->id,
- ((startLink_t)event->data)->value,
- ((startLink_t)event->data)->sourceContainer->id,
- ((startLink_t)event->data)->key,
- ((startLink_t)event->data)->size);
+ fprintf(tracing_file, "%d %.*f %s %s %s %s %s %d\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((startLink_t)event->data)->type->id, ((startLink_t)event->data)->container->id,
+ ((startLink_t)event->data)->value, ((startLink_t)event->data)->sourceContainer->id,
+ ((startLink_t)event->data)->key, ((startLink_t)event->data)->size);
}
}
}
void print_pajeEndLink(paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
- (int)event->event_type,
- ((endLink_t)event->data)->type->id,
- ((endLink_t)event->data)->container->id,
- ((endLink_t)event->data)->value,
- ((endLink_t)event->data)->destContainer->id,
- ((endLink_t)event->data)->key);
+ fprintf(tracing_file, "%d 0 %s %s %s %s %s\n", (int)event->event_type, ((endLink_t)event->data)->type->id,
+ ((endLink_t)event->data)->container->id, ((endLink_t)event->data)->value,
+ ((endLink_t)event->data)->destContainer->id, ((endLink_t)event->data)->key);
}else {
- fprintf(tracing_file, "%d %.*f %s %s %s %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((endLink_t)event->data)->type->id,
- ((endLink_t)event->data)->container->id,
- ((endLink_t)event->data)->value,
- ((endLink_t)event->data)->destContainer->id,
- ((endLink_t)event->data)->key);
+ fprintf(tracing_file, "%d %.*f %s %s %s %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((endLink_t)event->data)->type->id, ((endLink_t)event->data)->container->id, ((endLink_t)event->data)->value,
+ ((endLink_t)event->data)->destContainer->id, ((endLink_t)event->data)->key);
}
}
void print_pajeNewEvent (paje_event_t event)
{
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(), event->timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event->event_type, TRACE_precision(),
+ event->timestamp);
if (event->timestamp == 0){
- fprintf(tracing_file, "%d 0 %s %s %s\n",
- (int)event->event_type,
- ((newEvent_t)event->data)->type->id,
- ((newEvent_t)event->data)->container->id,
- ((newEvent_t)event->data)->value->id);
+ fprintf(tracing_file, "%d 0 %s %s %s\n", (int)event->event_type, ((newEvent_t)event->data)->type->id,
+ ((newEvent_t)event->data)->container->id, ((newEvent_t)event->data)->value->id);
}else{
- fprintf(tracing_file, "%d %.*f %s %s %s\n",
- (int)event->event_type,
- TRACE_precision(),
- event->timestamp,
- ((newEvent_t)event->data)->type->id,
- ((newEvent_t)event->data)->container->id,
+ fprintf(tracing_file, "%d %.*f %s %s %s\n", (int)event->event_type, TRACE_precision(), event->timestamp,
+ ((newEvent_t)event->data)->type->id, ((newEvent_t)event->data)->container->id,
((newEvent_t)event->data)->value->id);
}
}
char key[INSTR_DEFAULT_STR_SIZE];
snprintf (key, INSTR_DEFAULT_STR_SIZE, "%s-%s-%s", name, source->id, dest->id);
ret = newType (name, key, NULL, 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);
+ 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);
new_pajeDefineLinkType(ret, source, dest);
return ret;
}
}
if (father->kind == TYPE_VARIABLE)
- THROWF(tracing_error, 0,
- "variables can't have different values (%s)", father->name);
+ THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name);
val_t ret = (val_t)xbt_dict_get_or_null (father->values, name);
if (ret == NULL) {
- THROWF(tracing_error, 2,
- "value with name (%s) not found in father type (%s)",
- name, father->name);
+ THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name);
}
return ret;
}
XBT_PUBLIC(void) new_pajeSubVariable (double timestamp, container_t container, type_t type, double value);
XBT_PUBLIC(void) new_pajeSetState (double timestamp, container_t container, type_t type, val_t value);
XBT_PUBLIC(void) new_pajePushState (double timestamp, container_t container, type_t type, val_t value);
-XBT_PUBLIC(void) new_pajePushStateWithExtra (double timestamp, container_t container, type_t type, val_t value, void* extra);
+XBT_PUBLIC(void) new_pajePushStateWithExtra (double timestamp, container_t container, type_t type, val_t value,
+ void* extra);
XBT_PUBLIC(void) new_pajePopState (double timestamp, container_t container, type_t type);
XBT_PUBLIC(void) new_pajeResetState (double timestamp, container_t container, type_t type);
-XBT_PUBLIC(void) new_pajeStartLink (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key);
-XBT_PUBLIC(void) new_pajeStartLinkWithSize (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key, int size);
-XBT_PUBLIC(void) new_pajeEndLink (double timestamp, container_t container, type_t type, container_t destContainer, const char *value, const char *key);
+XBT_PUBLIC(void) new_pajeStartLink (double timestamp, container_t container, type_t type, container_t sourceContainer,
+ const char *value, const char *key);
+XBT_PUBLIC(void) new_pajeStartLinkWithSize (double timestamp, container_t container, type_t type,
+ container_t sourceContainer, const char *value, const char *key, int size);
+XBT_PUBLIC(void) new_pajeEndLink (double timestamp, container_t container, type_t type, container_t destContainer,
+ const char *value, const char *key);
XBT_PUBLIC(void) new_pajeNewEvent (double timestamp, container_t container, type_t type, val_t value);
/* from instr_config.c */
XBT_PUBLIC(int) TRACE_smpi_view_internals(void);
/* from resource_utilization.c */
-XBT_PRIVATE void TRACE_surf_host_set_utilization(const char *resource,
- const char *category,
- double value,
- double now,
+XBT_PRIVATE void TRACE_surf_host_set_utilization(const char *resource, const char *category, double value, double now,
double delta);
-XBT_PRIVATE void TRACE_surf_link_set_utilization(const char *resource,
- const char *category,
- double value,
- double now,
+XBT_PRIVATE void TRACE_surf_link_set_utilization(const char *resource,const char *category, double value, double now,
double delta);
XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc(void);
XBT_PRIVATE void dump_comment_file (const char *filename);
XBT_PRIVATE void dump_comment (const char *comment);
-
-
-
typedef struct instr_trace_writer {
void (*print_DefineContainerType) (paje_event_t event);
void (*print_DefineVariableType)(paje_event_t event);
void (*print_NewEvent) (paje_event_t event);
} s_instr_trace_writer_t;
-
-
struct s_instr_extra_data;
typedef struct s_instr_extra_data *instr_extra_data;
-
typedef enum{
TRACING_INIT,
TRACING_FINALIZE,
TRACING_EXSCAN
} e_caller_type ;
-
-
typedef struct s_instr_extra_data {
e_caller_type type;
int send_size;
static xbt_dict_t platform_variables;
//used by all methods
-static void __TRACE_surf_check_variable_set_to_zero(double now,
- const char *variable,
- const char *resource)
+static void __TRACE_surf_check_variable_set_to_zero(double now, const char *variable, const char *resource)
{
- /*
- * To trace resource utilization, we use pajeAddVariable and pajeSubVariable only.
- * The Paje simulator needs a pajeSetVariable in the first place so it knows
- * the initial value of all variables for subsequent adds/subs. If we don't do
- * so, the first pajeAddVariable is added to a non-determined value within
+ /* To trace resource utilization, we use pajeAddVariable and pajeSubVariable only.
+ * The Paje simulator needs a pajeSetVariable in the first place so it knows the initial value of all variables for
+ * subsequent adds/subs. If we don't do so, the first pajeAddVariable is added to a non-determined value within
* the Paje simulator, causing analysis problems.
*/
new_pajeSubVariable(now + delta, resource, variable, value);
}
-/*
- * TRACE_surf_link_set_utilization: entry point from SimGrid
- */
-void TRACE_surf_link_set_utilization(const char *resource,
- const char *category,
- double value,
- double now,
- double delta)
+/* TRACE_surf_link_set_utilization: entry point from SimGrid */
+void TRACE_surf_link_set_utilization(const char *resource, const char *category, double value, double now, double delta)
{
//only trace link utilization if link is known by tracing mechanism
if (!PJ_container_get_or_null(resource))
return;
}
-/*
- * TRACE_surf_host_set_utilization: entry point from SimGrid
- */
-void TRACE_surf_host_set_utilization(const char *resource,
- const char *category,
- double value,
- double now,
- double delta)
+/* TRACE_surf_host_set_utilization: entry point from SimGrid */
+void TRACE_surf_host_set_utilization(const char *resource, const char *category, double value, double now, double delta)
{
//only trace host utilization if host is known by tracing mechanism
container_t container = PJ_container_get_or_null(resource);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_trace, instr, "tracing event system");
-
FILE *tracing_file = NULL;
void print_NULL(paje_event_t event){}
if (i == 0)
XBT_DEBUG("%s: inserted at beginning", __FUNCTION__);
else
- XBT_DEBUG("%s: inserted at%s %u", __FUNCTION__,
- (i == xbt_dynar_length(buffer) - 1 ? " end, pos =" : ""), i);
+ XBT_DEBUG("%s: inserted at%s %u", __FUNCTION__, (i == xbt_dynar_length(buffer) - 1 ? " end, pos =" : ""), i);
}
-
static void free_paje_event (paje_event_t event)
{
XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);
insert_into_buffer (event);
}
-void new_pajeStartLink (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key)
+void new_pajeStartLink (double timestamp, container_t container, type_t type, container_t sourceContainer,
+ const char *value, const char *key)
{
paje_event_t event = xbt_new0(s_paje_event_t, 1);
event->event_type = PAJE_StartLink;
insert_into_buffer (event);
}
-void new_pajeStartLinkWithSize (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key, int size)
+void new_pajeStartLinkWithSize (double timestamp, container_t container, type_t type, container_t sourceContainer,
+ const char *value, const char *key, int size)
{
paje_event_t event = xbt_new0(s_paje_event_t, 1);
event->event_type = PAJE_StartLink;
insert_into_buffer (event);
}
-void new_pajeEndLink (double timestamp, container_t container, type_t type, container_t destContainer, const char *value, const char *key)
+void new_pajeEndLink (double timestamp, container_t container, type_t type, container_t destContainer,
+ const char *value, const char *key)
{
paje_event_t event = xbt_new0(s_paje_event_t, 1);
event->event_type = PAJE_EndLink;
xbt_dynar_push(event->characteristics_list, &characteristic);
}
-
void jed_event_add_info(jed_event_t event, char *key, char *value) {
char *val_cp;
xbt_dict_set(event->info_hash, key, val_cp, NULL);
}
-
void create_jed_event(jed_event_t *event, char *name, double start_time,
double end_time, const char *type) {
(*event)->resource_subsets = xbt_dynar_new(sizeof(jed_res_subset_t), xbt_free_ref);
(*event)->characteristics_list = xbt_dynar_new(sizeof(char*), NULL);
(*event)->info_hash = xbt_dict_new_homogeneous(NULL);
-
}
-
void jed_event_free(jed_event_t event) {
-
free(event->name);
free(event->type);
free(event);
}
-
#endif
#ifdef HAVE_JEDULE
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_out, jedule,
- "Logging specific to Jedule output");
-
-/*********************************************************/
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_out, jedule, "Logging specific to Jedule output");
xbt_dynar_t jedule_event_list;
static FILE *jed_file;
-static void print_platform(jed_simgrid_container_t root_container);
-static void print_container(jed_simgrid_container_t container);
-static void print_resources(jed_simgrid_container_t resource_parent);
-static void print_key_value_dict(xbt_dict_t meta_info_dict);
-static void print_events(xbt_dynar_t event_list);
-static void get_hierarchy_list(xbt_dynar_t hier_list,
- jed_simgrid_container_t container);
-
-/*********************************************************/
-
-
-static void get_hierarchy_list(xbt_dynar_t hier_list,
- jed_simgrid_container_t container) {
-
+static void get_hierarchy_list(xbt_dynar_t hier_list, jed_simgrid_container_t container) {
xbt_assert( container != NULL );
if( container->parent != NULL ) {
if( container->parent->container_children == NULL ) {
// we are in the last level
get_hierarchy_list(hier_list, container->parent);
-
} else {
unsigned int i;
int child_nb = -1;
jed_simgrid_container_t child_container;
- xbt_dynar_foreach(container->parent->container_children, i,
- child_container) {
+ xbt_dynar_foreach(container->parent->container_children, i, child_container) {
if( child_container == container ) {
child_nb = i;
break;
}
xbt_assert( child_nb > - 1);
-
xbt_dynar_insert_at(hier_list, 0, &child_nb);
get_hierarchy_list(hier_list, container->parent);
int top_level = 0;
xbt_dynar_insert_at(hier_list, 0, &top_level);
}
-
}
-static void get_hierarchy_string(jed_simgrid_container_t container,
- char *outbuf) {
+static void get_hierarchy_string(jed_simgrid_container_t container, char *outbuf) {
char buf[1024];
xbt_dynar_t hier_list;
unsigned int iter;
int number;
unsigned int length;
-
+
outbuf[0] = '\0';
hier_list = xbt_dynar_new(sizeof(int), NULL);
get_hierarchy_list(hier_list, container);
-
+
length = xbt_dynar_length(hier_list);
-
+
xbt_dynar_foreach(hier_list, iter, number) {
if( iter != length-1 ) {
sprintf(buf, "%d.", number);
}
strcat(outbuf, buf);
}
-
- xbt_dynar_free(&hier_list);
+
+ xbt_dynar_free(&hier_list);
}
static void print_key_value_dict(xbt_dict_t key_value_dict) {
xbt_assert( resource_parent->resource_list != NULL );
res_nb = xbt_dynar_length(resource_parent->resource_list);
-
- get_hierarchy_string(resource_parent, resid);
+
+ get_hierarchy_string(resource_parent, resid);
fprintf(jed_file, " <rset id=\"%s\" nb=\"%d\" names=\"", resid, res_nb);
xbt_dynar_foreach(resource_parent->resource_list, i, res_name) {
fprintf(jed_file, "\" />\n");
}
-
static void print_platform(jed_simgrid_container_t root_container) {
fprintf(jed_file, " <platform>\n");
print_container(root_container);
unsigned int i;
jed_res_subset_t subset;
-
xbt_assert( event != NULL );
xbt_assert( event->resource_subsets != NULL );
fprintf(jed_file, " <event>\n");
-
fprintf(jed_file, " <prop key=\"name\" value=\"%s\" />\n", event->name);
- fprintf(jed_file, " <prop key=\"start\" value=\"%g\" />\n",
- event->start_time);
- fprintf(jed_file, " <prop key=\"end\" value=\"%g\" />\n",
- event->end_time);
+ fprintf(jed_file, " <prop key=\"start\" value=\"%g\" />\n", event->start_time);
+ fprintf(jed_file, " <prop key=\"end\" value=\"%g\" />\n", event->end_time);
fprintf(jed_file, " <prop key=\"type\" value=\"%s\" />\n", event->type);
fprintf(jed_file, " <res_util>\n");
xbt_dynar_foreach(event->resource_subsets, i, subset) {
-
int start = subset->start_idx;
int end = subset->start_idx + subset->nres - 1;
char resid[1024];
get_hierarchy_string(subset->parent, resid);
-
fprintf(jed_file, " <select resources=\"");
fprintf(jed_file, "%s", resid);
fprintf(jed_file, ".[%d-%d]", start, end);
fprintf(jed_file, "\" />\n");
-
}
fprintf(jed_file, " </res_util>\n");
if (!xbt_dynar_is_empty(event->characteristics_list)){
fprintf(jed_file, " <characteristics>\n");
- {
- char *ch;
- unsigned int iter;
- xbt_dynar_foreach(event->characteristics_list, iter, ch) {
- fprintf(jed_file, " <characteristic name=\"%s\" />\n", ch);
- }
+ char *ch;
+ unsigned int iter;
+ xbt_dynar_foreach(event->characteristics_list, iter, ch) {
+ fprintf(jed_file, " <characteristic name=\"%s\" />\n", ch);
}
fprintf(jed_file, " </characteristics>\n");
}
fprintf(jed_file, " </events>\n");
}
-void write_jedule_output(FILE *file, jedule_t jedule,
- xbt_dynar_t event_list, xbt_dict_t meta_info_dict) {
+void write_jedule_output(FILE *file, jedule_t jedule, xbt_dynar_t event_list, xbt_dict_t meta_info_dict) {
jed_file = file;
if (!xbt_dynar_is_empty(jedule_event_list)){
xbt_assert(event != NULL);
xbt_dynar_push(jedule_event_list, &event);
}
-
#endif
#ifdef HAVE_JEDULE
-/********************************************************************/
-
static xbt_dict_t host2_simgrid_parent_container;
static xbt_dict_t container_name2container;
-/********************************************************************/
-
-static void add_subset_to(xbt_dynar_t subset_list, int start, int end,
- jed_simgrid_container_t parent);
-
-static void add_subsets_to(xbt_dynar_t subset_list, xbt_dynar_t hostgroup,
- jed_simgrid_container_t parent);
-
-static void jed_free_container(jed_simgrid_container_t container);
-
-/********************************************************************/
-
static int compare_ids(const void *num1, const void *num2) {
- int *i1 = (int*) num1;
- int *i2 = (int*) num2;
- return *i1 - *i2;
+ return *((int*) num1) - *((int*) num2);
}
static void jed_free_container(jed_simgrid_container_t container) {
-
xbt_dict_free(&container->name2id);
xbt_dynar_free(&container->resource_list);
}
xbt_dynar_free(&container->container_children);
}
-
xbt_free(container->name);
xbt_free(container);
}
-void jed_simgrid_create_container(jed_simgrid_container_t *container,
- const char *name)
+void jed_simgrid_create_container(jed_simgrid_container_t *container, const char *name)
{
xbt_assert( name != NULL );
xbt_dict_set(container_name2container, (*container)->name, *container, NULL);
}
-
-void jed_simgrid_add_container(jed_simgrid_container_t parent,
- jed_simgrid_container_t child) {
+void jed_simgrid_add_container(jed_simgrid_container_t parent, jed_simgrid_container_t child) {
xbt_assert(parent != NULL);
xbt_assert(child != NULL);
xbt_dynar_push(parent->container_children, &child);
child->parent = parent;
}
-void jed_simgrid_add_resources(jed_simgrid_container_t parent,
- xbt_dynar_t host_names) {
-
+void jed_simgrid_add_resources(jed_simgrid_container_t parent, xbt_dynar_t host_names) {
unsigned int iter;
char *host_name;
char *buf;
xbt_dict_set(host2_simgrid_parent_container, host_name, parent, NULL);
xbt_dynar_push(parent->resource_list, &host_name);
}
-
}
-static void add_subset_to(xbt_dynar_t subset_list, int start, int end,
- jed_simgrid_container_t parent) {
-
+static void add_subset_to(xbt_dynar_t subset_list, int start, int end, jed_simgrid_container_t parent) {
jed_res_subset_t subset;
xbt_assert( subset_list != NULL );
xbt_assert( parent != NULL );
- // printf(">>> start=%d end=%d\n", start, end);
-
subset = xbt_new0(s_jed_res_subset_t,1);
subset->start_idx = start;
subset->nres = end-start+1;
subset->parent = parent;
xbt_dynar_push(subset_list, &subset);
-
}
-static void add_subsets_to(xbt_dynar_t subset_list, xbt_dynar_t hostgroup,
- jed_simgrid_container_t parent) {
-
+static void add_subsets_to(xbt_dynar_t subset_list, xbt_dynar_t hostgroup, jed_simgrid_container_t parent) {
unsigned int iter;
char *host_name;
xbt_dynar_t id_list;
pos = start;
for(i=0; i<nb_ids; i++) {
-
if( id_ar[i] - id_ar[pos] > 1 ) {
-
add_subset_to( subset_list, id_ar[start], id_ar[pos], parent );
start = i;
if( i == nb_ids-1 ) {
add_subset_to( subset_list, id_ar[i], id_ar[i], parent );
}
-
} else {
if( i == nb_ids-1 ) {
add_subset_to( subset_list, id_ar[start], id_ar[i], parent );
free(id_ar);
xbt_dynar_free(&id_list);
-
-
}
-void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list,
- xbt_dynar_t host_names) {
-
+void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list, xbt_dynar_t host_names) {
char *host_name;
unsigned int iter;
xbt_dict_t parent2hostgroup; // group hosts by parent
// group by parent container
xbt_dynar_foreach(host_names, iter, host_name) {
- //printf("checking %s \n", host_name);
-
jed_simgrid_container_t parent = (jed_simgrid_container_t)xbt_dict_get(host2_simgrid_parent_container, host_name);
xbt_assert( parent != NULL );
xbt_dynar_push(hostgroup, &host_name);
}
- {
- xbt_dict_cursor_t cursor=NULL;
- char *parent_name;
- xbt_dynar_t hostgroup;
- jed_simgrid_container_t parent;
+ xbt_dict_cursor_t cursor=NULL;
+ char *parent_name;
+ xbt_dynar_t hostgroup;
+ jed_simgrid_container_t parent;
- xbt_dict_foreach(parent2hostgroup,cursor,parent_name,hostgroup) {
- parent = (jed_simgrid_container_t)xbt_dict_get(container_name2container, parent_name);
- // printf("subset parent >>> %s\n", parent->name);
- add_subsets_to(subset_list, hostgroup, parent);
- }
- xbt_dynar_free(&hostgroup);
+ xbt_dict_foreach(parent2hostgroup,cursor,parent_name,hostgroup) {
+ parent = (jed_simgrid_container_t)xbt_dict_get(container_name2container, parent_name);
+ add_subsets_to(subset_list, hostgroup, parent);
}
+ xbt_dynar_free(&hostgroup);
xbt_dict_free(&parent2hostgroup);
-
}
-
void jedule_add_meta_info(jedule_t jedule, char *key, char *value) {
-
char *val_cp;
xbt_assert(key != NULL);
}
void jed_free_jedule(jedule_t jedule) {
-
jed_free_container(jedule->root_container);
xbt_dict_free(&jedule->jedule_meta_info);
xbt_dict_free(&host2_simgrid_parent_container);
xbt_dict_free(&container_name2container);
}
-
#endif
#ifdef HAVE_JEDULE
XBT_LOG_NEW_CATEGORY(jedule, "Logging specific to Jedule");
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_sd, jedule,
- "Logging specific to Jedule SD binding");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_sd, jedule, "Logging specific to Jedule SD binding");
jedule_t jedule;
void jedule_log_sd_event(SD_task_t task)
{
- xbt_dynar_t host_list;
jed_event_t event;
- int i;
xbt_assert(task != NULL);
- host_list = xbt_dynar_new(sizeof(char*), NULL);
+ xbt_dynar_t host_list = xbt_dynar_new(sizeof(char*), NULL);
- for(i=0; i<task->host_count; i++) {
+ for(int i=0; i<task->host_count; i++) {
const char *hostname = sg_host_get_name(task->host_list[i]);
xbt_dynar_push(host_list, &hostname);
}
- create_jed_event(&event, (char*)SD_task_get_name(task),
- task->start_time, task->finish_time,"SD");
+ create_jed_event(&event, (char*)SD_task_get_name(task), task->start_time, task->finish_time,"SD");
jed_event_add_resources(event, host_list);
jedule_store_event(event);
xbt_dynar_free(&host_list);
}
-static void create_hierarchy(AS_t current_comp,
- jed_simgrid_container_t current_container)
+static void create_hierarchy(AS_t current_comp, jed_simgrid_container_t current_container)
{
xbt_dict_cursor_t cursor = NULL;
char *key;
create_hierarchy(root_comp, root_container);
}
-
void jedule_sd_cleanup()
{
jedule_cleanup_output();
free(fname);
}
}
-
#endif