[parsec-users] PARSEC Pin instrumentation Error

Yungang Bao ybao at CS.Princeton.EDU
Mon Apr 25 13:54:06 EDT 2011


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


More information about the parsec-users mailing list