<div dir="ltr">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:<div><a href="https://github.com/efficios/babeltrace/blob/stable-1.5/tests/lib/test_ctf_writer.c">https://github.com/efficios/babeltrace/blob/stable-1.5/tests/lib/test_ctf_writer.c</a></div><div><br><div>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.</div><div><br></div>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.</div><div><br></div><div>Is there a way using the current API to explicitly set the stream id so that each process will write to a separate file?</div><div><br></div><div>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.</div><div><br></div><div>Rocky</div></div>