Message: How to get thread id? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How to get thread id?  

Forum: Multithreading
Date: 24 Jul, 2013
From: Jungwook Shin <Jungwook Shin>

Hi,

I've been porting my code to G4MT and would like to generate outputs by worker thread at this point. In MT prototype version, I used to use threadrank for this purpose, which doesn't exist any longer. So I called G4GetThreadId from EndOfRunAction but it returned -1 in every threads however G4GetPidId seems to return appropriate values such as 9242933, 9242934, and 9242935 (nThreads = 3).

Is there any possible way to get worker's ID by now?

Thanks,

Jungwook

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: How to get thread id?   (Andrea Dotti - 24 Jul, 2013)
2 Note: Re: How to get thread id?   (Andrea Dotti - 10 Jan, 2014)
 Add Message Add Message
to: "How to get thread id? "

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews