From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rocky Dunlap Subject: Using Babeltrace to write CTF for MPI application Date: Tue, 4 Apr 2017 15:29:19 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2425624148453075805==" Return-path: Received: from mail-ua0-x22d.google.com (mail-ua0-x22d.google.com [IPv6:2607:f8b0:400c:c08::22d]) by lists.lttng.org (Postfix) with ESMTPS id 3vyMZM4X0Kz1Kn for ; Tue, 4 Apr 2017 21:30:03 +0000 (UTC) Received: by mail-ua0-x22d.google.com with SMTP id 97so16865319uaz.3 for ; Tue, 04 Apr 2017 14:29:40 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" To: lttng-dev@lists.lttng.org List-Id: lttng-dev@lists.lttng.org --===============2425624148453075805== Content-Type: multipart/alternative; boundary=f403045f286a2c983a054c5df9e4 --f403045f286a2c983a054c5df9e4 Content-Type: text/plain; charset=UTF-8 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: https://github.com/efficios/babeltrace/blob/stable-1.5/tests/lib/test_ctf_writer.c 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. Rocky --f403045f286a2c983a054c5df9e4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am instrumenting an MPI application to output a custom a= pplication trace in CTF using Babeltrace 1.5.2.=C2=A0 I would like to end u= p with a single trace with multiple streams, one per process.=C2=A0 All str= eams share the same stream class (and metadata). All processes have access = to the same file system.=C2=A0 I am using the C CTF writer API using this t= est as an example:

W= hat I have in mind is something like this: process 0 would be responsible f= or 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 appendi= ng stream->id to the stream filename and the stream id is determined beh= ind the scenes as=C2=A0stream->id =3D stream_class->next_stream_id++.= =C2=A0 Since each process has its own address space, all processes want str= eam 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 separa= te file?

I'm also open for suggestions on the = overall approach.=C2=A0 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 analy= sis tool like TraceCompass and see all processes together.

Rocky
--f403045f286a2c983a054c5df9e4-- --===============2425624148453075805== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbHR0bmctZGV2 IG1haWxpbmcgbGlzdApsdHRuZy1kZXZAbGlzdHMubHR0bmcub3JnCmh0dHBzOi8vbGlzdHMubHR0 bmcub3JnL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9sdHRuZy1kZXYK --===============2425624148453075805==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Rajotte Julien Subject: Re: Using Babeltrace to write CTF for MPI application Date: Tue, 4 Apr 2017 19:52:47 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from mail.efficios.com (mail.efficios.com [167.114.142.141]) by lists.lttng.org (Postfix) with ESMTPS id 3vyQlY3nBlz5H for ; Tue, 4 Apr 2017 23:53:13 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 0528B34020C for ; Tue, 4 Apr 2017 23:53:58 +0000 (UTC) Received: from mail.efficios.com ([127.0.0.1]) by localhost (evm-mail-1.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Kn51vlCON7vk for ; Tue, 4 Apr 2017 23:53:57 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 5B96834022A for ; Tue, 4 Apr 2017 23:53:57 +0000 (UTC) Received: from mail.efficios.com ([127.0.0.1]) by localhost (evm-mail-1.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zhPEsNJO6UKc for ; Tue, 4 Apr 2017 23:53:57 +0000 (UTC) Received: from [192.168.2.14] (mtrlpq2848w-70-48-16-61.dsl.bell.ca [70.48.16.61]) by mail.efficios.com (Postfix) with ESMTPSA id 4588134020C for ; Tue, 4 Apr 2017 23:53:57 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" To: lttng-dev@lists.lttng.org List-Id: lttng-dev@lists.lttng.org SGkgUm9ja3ksCgpOb3Qgc3VyZSBpZiBwZXJ0aW5lbnQgYnV0IGRpZCB5b3UgdGFrZSBhIGxvb2sg YXQgdGhlIGJhcmVjdGYgWzFdIHByb2plY3Q/CgpDaGVlcnMKClsxXSBodHRwczovL2dpdGh1Yi5j b20vZWZmaWNpb3MvYmFyZWN0ZgoKT24gMjAxNy0wNC0wNCAwNToyOSBQTSwgUm9ja3kgRHVubGFw IHdyb3RlOgo+IEkgYW0gaW5zdHJ1bWVudGluZyBhbiBNUEkgYXBwbGljYXRpb24gdG8gb3V0cHV0 IGEgY3VzdG9tIGFwcGxpY2F0aW9uIHRyYWNlIGluIENURiB1c2luZyBCYWJlbHRyYWNlIDEuNS4y LiAgSSB3b3VsZCBsaWtlIHRvIGVuZCB1cCB3aXRoIGEgc2luZ2xlIHRyYWNlIHdpdGggbXVsdGlw bGUgc3RyZWFtcywgb25lIHBlciBwcm9jZXNzLiAgQWxsIHN0cmVhbXMgc2hhc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