[lttng-dev] Using Babeltrace to write CTF for MPI application

Rocky Dunlap rsdunlapiv at gmail.com
Tue Apr 4 21:29:19 UTC 2017

I am instrumenting an MPI application to output a custom application trace
in CTF using Babeltrace 1.5.2.  I would like to end up with a single trace
with multiple streams, one per process.  All streams share the same stream
class (and metadata). All processes have access to the same file system.  I
am using the C CTF writer API using this test as an example:

What I have in mind is something like this: process 0 would be responsible
for writing the metadata and its own stream, while all other processes
would only need to write their own stream.

The issue I have run into is that the individual stream file names are
determined by appending stream->id to the stream filename and the stream id
is determined behind the scenes as stream->id =
stream_class->next_stream_id++.  Since each process has its own address
space, all processes want stream id of 0.

Is there a way using the current API to explicitly set the stream id so
that each process will write to a separate file?

I'm also open for suggestions on the overall approach.  The main reason to
have each process as a separate stream in a single trace is so that I can
open the entire trace in an analysis tool like TraceCompass and see all
processes together.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20170404/1f35d39b/attachment.html>

More information about the lttng-dev mailing list