Thanks for the response Trey. What I'm really wanting to do is monitor the
environment variable OMP_NUM_THREADS. One of the third-party libraries
calls it to see how many threads it should spawn, but on any given run it
may return the correct number or 1. We're suspecting one of the programs is
somehow stomping on the memory. I want to ensure that it isn't chrd or
taskset somehow doing that, so I'd like to monitor them, too, at least
initially.

Could someone please tell me how to monitor the environment variable as the
programs run?

Thanks,

James Orr

On Fri, Jul 15, 2016 at 2:25 PM, Trey Boudreau <t...@treysoft.com> wrote:

>
> On Jul 15, 2016, at 12:38 , James Orr <james....@wustl.edu> wrote:
>
> Hi all.
>
> I'm a relatively novice Valgrind user. I've used it in the past to ensure
> that my code has no memory leaks, but that's about it. Now I suspect that
> there is a memory stomp on an environment variable somewhere in my fairly
> complex multi-threaded program that spawns different processes and makes
> external library calls. For the first time I'm wanting to use some of
> Valgrind's more advanced functions. I'm getting an error running what I
> expected was a fairly simple command.
>
> $ valgrind ./[multi-threaded/multi-process-spawing program] [args]
> runs fine and reveals 1 memory leak.
>
> $ valgrind --trace-children=yes ./[multi-threaded/multi-process-spawing
> program] [args]
>
> This traces everything that your process spawns, which in the case below
> means all three programs:
>  * chrt
>  * taskset
>  * BuntingFEA(Small|Big)
>
> You probably don’t want that. If you can arrange for it you want to remove
> the "—trace-children=yes" and replace the BuntingFEA(Small|Big) with a
> wrapper script that does something like:
>
> !#/bin/bash
> exec valgrind (valgrind params here) BuntingFEA(Small|Big) $*
>
> That way you don’t waste any resources on valgrinding chrt and taskset.
>
> I do exactly this for a similar situation, but I did it to avoid
> valgrinding an "xterm/tail -f logfile.txt” chain.
>
> — Trey
>
> Doesn't spawn the new tasks and has some errors...
>
>
> ==14590== Memcheck, a memory error detector
> ==14590== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==14590== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==14590== Command: ./clustering_launcher BeamContinuumModelTSR1Short
> ==14590==
> Taskset is schedulable: BeamContinuumModelTSR1Short
> Forking and execv-ing task BuntingFEASmall
> Forking and execv-ing task BuntingFEABig
> All tasks started
> ==14591== Memcheck, a memory error detector
> ==14591== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==14591== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==14591== Command: /usr/bin/chrt -r 97 taskset -c 1-7 ./BuntingFEASmall 1
> 7 97 0 976562 0 976562 0 0 10 RT_GOMP_CLUSTERING_BARRIER BuntingFEASmall
> beamContinuumModel.txt beamContinuumParams.txt
> ==14591==
> ==14592== Memcheck, a memory error detector
> ==14592== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==14592== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==14592== Command: /usr/bin/chrt -r 96 taskset -c 10-10 ./BuntingFEABig 10
> 10 96 0 976562 0 976562 0 0 10 RT_GOMP_CLUSTERING_BARRIER BuntingFEABig
> beamContinuumModel.txt beamContinuumParams.txt
> ==14592==
> ==14591== Memcheck, a memory error detector
> ==14591== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==14591== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==14591== Command: /bin/taskset -c 1-7 ./BuntingFEASmall 1 7 97 0 976562 0
> 976562 0 0 10 RT_GOMP_CLUSTERING_BARRIER BuntingFEASmall
> beamContinuumModel.txt beamContinuumParams.txt
> ==14591==
> ==14592== Memcheck, a memory error detector
> ==14592== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==14592== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==14592== Command: /bin/taskset -c 10-10 ./BuntingFEABig 10 10 96 0 976562
> 0 976562 0 0 10 RT_GOMP_CLUSTERING_BARRIER BuntingFEABig
> beamContinuumModel.txt beamContinuumParams.txt
> ==14592==
> valgrind: failed to start tool 'memcheck' for platform 'x86-linux': No
> such file or directory
> valgrind: failed to start tool 'memcheck' for platform 'x86-linux': No
> such file or directory
>
>
> Can someone please tell me what I'm doing wrong?
>
> Thanks,
>
> James
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning
> reports.
> http://sdm.link/zohodev2dev_______________________________________________
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to