Running ROOT on Dual Core (one thread only?)

Hello guys,

I have dual core processor and noticed each time when I run a macro with ROOT it uses only one core but other is idle. I found this situation very frustraiting :frowning: :frowning: :frowning:
Is there any way to use both cores when I running ROOT?

Thank you!

==
OS: WinXP, ROOT 5.14 (I use gcc/Cygwin as well as VC6)

Hi,

Yes, you can use threads. Try the macro in attachment. To run it: ā€œ.x pirndmthread.C+ā€.
The threads will be distributed to your cores (if you have a quad-core, it will use the four processorsā€¦)

Cheers,
Bertrand.
pirndmthread.C (6.63 KB)

I seeā€¦ It could be a solution!
But when Iā€™m trying to run your code Iā€™m getting an error

C:\>root -l pirndmthread.C
root [0]
Processing pirndmthread.C...
Starting Thread 1
Error in <TMutex::UnLock>: thread 5732 tries to unlock unlocked mutex

Move to version 5.18

Rene

Iā€™ve updated ROOT to 5.18 but getting the same error again.

Read the way to invoke this script

root > .x pirndmthread.C+
Rene

Does not work either :cry:

C:\>root -l
root [0] .x pirndmthread.C+
Error in <TApplication::ExecuteFile>: macro pirndmthread.C not found in path .;C
:\root\/macros;
root [1]

(pirndmthread.C+ is in C:)

Hi,

Do I understand correctly that you renamed the file ā€˜pirndmthread.C+ā€™??
Please donā€™t. The + in ā€˜.x pirndmthread.C+ā€™ tells Root to compile the macro using ACLiC (please read the documentation).

And I donā€™t see any problem running this on Windows (it has even been developped on Windowsā€¦):

C:>root -l
root [0] .x pirndmthread.C+
Info in TWinNTSystem::ACLiC: creating shared library C:\pirndmthread_C.dll
23240140_cint.cxx
s21k_.cxx
Creating library C:\pirndmthread_C.lib and object C:\pirndmthread_C.exp
Starting Thread 1
Starting Thread 2
Starting Thread 3
Starting Thread 4
Starting Thread 5
Thread State
6 top:0x950 Running
5 th5:0xdb4 Running
4 th4:0xce4 Running
3 th3:0xb44 Running
2 th2:0x150 Running
1 th1:0x8a4 Running

And BTW, I just see that you are using VC6ā€¦
Forget it! The minimum supported version is 7.1 - Older versions of MSVC++ are obsolete.

Cheers,
Bertrand.

Yes, I did wrong since I renamed the file, it was stupid. But now I hope I do right but get an errors again. Maybe this is because Iā€™m using VC++ v6.0 (as you noticed before)?

root -l
root [0] .x pirndmthread.C+
Info in TWinNTSystem::ACLiC: creating shared library C:\cygwin\home\Mustang\an
alysis\susy\pirndmthread_C.dll
23868109_cint.cxx
s5jo_.cxx
C:\root/include\TDatime.h(101) : error C2248: ā€˜fDatimeā€™ : cannot access protecte
d member declared in class 'TDatimeā€™
C:\root/include\TDatime.h(43) : see declaration of 'fDatimeā€™
C:\root/include\TDatime.h(101) : error C2248: ā€˜fDatimeā€™ : cannot access protecte
d member declared in class 'TDatimeā€™
C:\root/include\TDatime.h(43) : see declaration of 'fDatimeā€™
C:\root/include\TDatime.h(103) : error C2248: ā€˜fDatimeā€™ : cannot access protecte
d member declared in class 'TDatimeā€™
C:\root/include\TDatime.h(43) : see declaration of 'fDatimeā€™
C:\root/include\TDatime.h(103) : error C2248: ā€˜fDatimeā€™ : cannot access protecte
d member declared in class ā€˜TDatimeā€™
ā€¦
C:\root/include\TDatime.h(43) : see declaration of 'fDatimeā€™
C:\root/include\TH1.h(368) : fatal error C1903: unable to recover from previous
error(s); stopping compilation
Error in : Compilation failed!
Error: Function pirndmthread() is not defined in current scope (0)
*** Interpreter error recovered ***
root [1]

Thank you so much!

Yes, probably. The first thing to do is to take a newer version of MSVC++ (at least 7.1)

Bertrand.

It seems to be working with VC++ 7.1

Thank you very much guys!