[parsec-users] PARSEC Pin instrumentation Error

Sudhanshu Shukla sudhan345 at gmail.com
Mon Apr 25 14:22:57 EDT 2011


Hi

It is possible to instrument OpenMP applications with PIN. PIN instruments
at the binary instruction level, thus it should be able to instrument OpenMp
applications.

Actually, using the pintool from the last mail, I can see that thread
initiation is getting instrumented for freqmine, but not the thread
termination.


Sudhanshu Shukla




On Mon, Apr 25, 2011 at 11:24 PM, Yungang Bao <ybao at cs.princeton.edu> wrote:

> Hi,
>
> Raytrace uses a threadpool to run task in parallel. Once the threads in the
> pool are created, they keep alive until receive a THREAD_EXIT signal. I am
> also curious that it seems that those threads  will never receive the
> THREAD_EXIT signal. It might be a bug here.
>
> Freqmine uses OpenMP rather than pthread. So for your case, I doubt if
> Pintool supports monitoring OpenMP thread manipulations.
>
> Best Regards,
> Yungang
>
> ----- Original Message -----
> From: "Sudhanshu Shukla" <sudhan345 at gmail.com>
> To: parsec-users at lists.cs.princeton.edu
> Sent: Sunday, April 24, 2011 11:51:58 PM
> Subject: [parsec-users] PARSEC Pin instrumentation Error
>
>
> Hi All,
>
>
> I have been trying for instrument PARSEC with pin. For initial testing I am
> using a pintool similar to malloc_mt which just records the thread begin and
> thread end. The code for the pintool is attached with this mail.
>
>
> On instrumenting raytrace and freqmine application(with 8, 16, 32 threads)
> with this pintool. I observe that the number of threads created are not
> equal to the number of threads that end.
>
>
> For all the other application and kernels, the number of threads created is
> same as number of threads that end.
>
>
> Can somebody please verify this? or is there some problem with my pintool.
>
>
>
> Thanks
>
>
> Sudhanshu Shukla
>
>
>
>
> -------------------------------------------------------Pintool
> used---------------------------------
>
> #include <stdio.h>
> #include "pin.H"
>
>
> KNOB<string> KnobOutputFile(KNOB_MODE_WRITEONCE, "pintool",
> "o", "traceThread.out", "specify output file name");
>
>
> FILE * out;
> PIN_LOCK lock;
>
>
> VOID ThreadStart(THREADID threadid, CONTEXT *ctxt, INT32 flags, VOID *v)
> {
> GetLock(&lock, threadid+1);
> fprintf(out, "thread begin %d\n",threadid);
> fflush(out);
> ReleaseLock(&lock);
> }
>
>
> VOID ThreadFini(THREADID threadid, const CONTEXT *ctxt, INT32 code, VOID
> *v)
> {
> GetLock(&lock, threadid+1);
> fprintf(out, "thread end %d code %d\n",threadid, code);
> fflush(out);
> ReleaseLock(&lock);
> }
>
>
> VOID Fini(INT32 code, VOID *v)
> {
> fclose(out);
> }
>
>
> INT32 Usage()
> {
> PIN_ERROR("This Pintool prints a trace of thread start and thread end in
> the guest application\n"
> + KNOB_BASE::StringKnobSummary() + "\n");
> return -1;
> }
>
>
> int main(INT32 argc, CHAR **argv)
> {
> // Initialize the pin lock
> InitLock(&lock);
>
> // Initialize pin
> if (PIN_Init(argc, argv)) return Usage();
> PIN_InitSymbols();
>
> out = fopen(KnobOutputFile.Value().c_str(), "w");
>
>
> // Register Analysis routines to be called when a thread begins/ends
> PIN_AddThreadStartFunction(ThreadStart, 0);
> PIN_AddThreadFiniFunction(ThreadFini, 0);
>
>
> // Register Fini to be called when the application exits
> PIN_AddFiniFunction(Fini, 0);
>
> // Never returns
> PIN_StartProgram();
>
> return 0;
> }
>
>
>
>
>
> ---------------------------------------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users
> _______________________________________________
> parsec-users mailing list
> parsec-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/parsec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/parsec-users/attachments/20110425/99d69775/attachment.html>


More information about the parsec-users mailing list