FAQ  •  Register  •  Login

Processor Affinity Explained

<<

{HVY-E}Jinxx

User avatar

Site Administrator

Posts: 1239

Joined: Tue Nov 13, 2007 11:26 pm

Location: Ft. Lewis, WA.

Post Tue Jul 27, 2010 8:50 pm

Processor Affinity Explained

If it is commented out the OS will decide which cores to use. ie All cores.
"IL-2 is not a ,multithread application." True
IL-2 only uses 1 core" False.
so PAF....

=1 - core 0
=2 - core 1
=3 - core 0+1
=4 - core 2
=5 - core 0+2
=6 - core 1+2
=7 - core 0+1+2
=8 - core 3
=9 - core 0 + 3
=10 - core 1 + 3
=11 - core 0 + 2 + 3
=12 - core 2 + 3
=13 - core 0 + 2 + 3
=14 - core 1 + 2 + 3
=15 - core 0 + 1 + 2 + 3

commented out - all cores

If a core is enabled, it does NOT mean that core will be performing 100% while the other cores that are not enabled do nothing.
The enabled core needs an active thread to perform,
The disabled cores will be assigned tasks by the OS if needed.
There is only one way to switch off cores - the power switch - meaning all or nothing lol.

There was an long thread at SimHQ some time back exploring this(end 2005/beginning of 2006).

An understanding of binary bit system will help with the next section.
Binary is simply an on/off value for a particular bit location.

It is read from right to left as follows:

0_0_0_1_1_1 = 7 Binary
32 16 8 4 2 1 = 1+2+4 = 7 Decimal equivalent
As seen, this value of 7 would enable cores 0 1 and 2 (first, second and third cores on a 4 core system).

a '1' bit will enable the core, a '0' bit disables it.
Actual activity of cores can be checked through TaskManager. Keep in mind in general Windows OS runs hundreds of threads at the same time IL-2 runs.

A substantial part of IL-2 is written in Java which can use in excess of 100 threads. (source: Sun Microsystems) Shift-Tab opens the Java console in-game Yep that's where all those white messages come from.

Bitmask: 00000 = Decimal 0
Processor affinity is off, and the load is distributed across all available processors.

Bitmask: 00001 = Decimal 1
Processor 1 selected. The process will only run on processor 1.

Bitmask: 00010 = Decimal 2
Processor 2 selected. The process will only run on processor 2.

Bitmask: 00011 = Decimal 3
Processors 1 & 2 selected. The load is distributed across both processors, effectively the same as setting 0 above for Dual cores.

Because 0 puts the load across all processors and 3 puts the load on processor 1 and 2, they are essentially the same thing for Dual core CPUs.

For Quad core CPUs you can use more values:

Bitmask: 00100 = Decimal 4
Processor 3 selected. The process will only run on processor 3.

Bitmask: 01000 = Decimal 8
Processor 4 selected. The process will only run on processor 4.

And any combo between 0 and 15, for example:

Bitmask: 00101 = Decimal 5
Processor 1 and 3 selected. The load is distributed across processor 1 and 3.

Bitmask: 01111 = Decimal 15
Processor 1, 2, 3, and 4 selected. The load is distributed across all processors, 1, 2, 3, and 4.

Get the picture?



Basically, using a multi core processor in IL-2 has no real performance gain when you're talking about just the game, but........
If you use a multicore processor and assign different programs to each core, you get incredible results.

ie. I use an AMD Phenom 9850 quad core with the following settings.

IL-2 is running on Core 4
TS is running on Core 3
HL is running on Core 2
Windows uses Core 1

This is what processor affinity will do for you. Take the load off of the core that you're using for the game by assigning the game to use a core that isn't normally used. Windows, by default, will always try to use the first core (Core 0).

Here is a my guide for understanding and using the conf.ini file:

De-Mystifying the Conf.ini
viewtopic.php?f=29&t=29185&p=331280#p331280

Another way to assign IL-2, and all your other programs, to specific cores is to use a program like PsExec. It is available here: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx.

You will simply install the program and then run like this...
1.) Right click on the shortcut icon for the program you wish to modify. ie IL-2 1946.
2.) Click on the "Target" box.
3.) Add the appropriate modifiers to the beginning of the call. In the case of IL-2 it would look something like this:

psexec -a 2 "C:\IL-2 Sturmovik 1946\il2fb.exe"

This will cause IL-2 to run on processor 2.

*** Remember to use the FULL path. For long file names with spaces in them, you must use quotes "" around the path other wise they are optional.
Last edited by {HVY-E}Jinxx on Sat Sep 04, 2010 5:50 pm, edited 3 times in total.
<<

Fireskull

User avatar

Posts: 4183

Joined: Tue Jun 09, 2009 12:11 pm

Location: Milky Way Galaxy, Sun System, Earth, USA...Somewhere roaming in the mid-west of America! LOL!

Post Thu Jul 29, 2010 8:59 pm

Re: Processor Affinity Explained

Hello, everyone

Since I have seen many situations where an IL-2 fan had incorrect process affinity, I made this a Sticky Topic.

Thank you, {HVY-E} Jinxx


Fireskull, Administrator
<<

George Formby

User avatar

Posts: 202

Joined: Thu Feb 12, 2009 1:38 pm

Location: Nashville, TN.......the Burbs

Post Thu Jul 29, 2010 9:55 pm

Re: Processor Affinity Explained

where exactly do you find the controls for the processors?? and what do you mean by commented out??
Than you in advance
<<

{HVY-E}Jinxx

User avatar

Site Administrator

Posts: 1239

Joined: Tue Nov 13, 2007 11:26 pm

Location: Ft. Lewis, WA.

Post Fri Jul 30, 2010 4:40 am

Re: Processor Affinity Explained

As far as the game is concerned, we're going to deal with the conf.ini only. There is another area within Windows where you can assign cores for a program to use.
This is in fact how I assign all of my cores to different programs. I'm currently working on another part of my tutorial (with pictures) to aide everyone with this task as it can be a bit overwhelming for the Windows challenged.

In your conf.ini file there is a section called [RTS]
This is where you find the command line ProcessAffinityMask = xxxx
By default, this line is commented out by using a ; at the beginning of the line.
By removing the ; (semicolon) you enable the line and thus allow IL-2 to use processor affinity.

Hope this helps. Let me know if you're still confused.

S!
<<

Quelty

User avatar

Posts: 410

Joined: Mon May 19, 2008 4:14 am

Location: Ingham, Queensland, Australia

Post Sat Jul 31, 2010 1:35 am

Re: Processor Affinity Explained

Jinnx,
I currently have most of my programs' affinity (IL2 included) set by the OS, is there any benefit to having the game set the affinty as opposed to the OS?

Cheers
Quelty
<<

{HVY-E}Jinxx

User avatar

Site Administrator

Posts: 1239

Joined: Tue Nov 13, 2007 11:26 pm

Location: Ft. Lewis, WA.

Post Sat Jul 31, 2010 3:11 am

Re: Processor Affinity Explained

Well, the only real benefit of having the game do it, is it will be done automatically every time to the same core without haveing to use task manager to set it all the time.

There are a few programs out there that I'm researching that will do it for you automatically, but the one I used to use, Proaffin, is no longer supported and only works with Duel Core systems.

I'm currently checking on 3 other programs I've just learned about, SeeSaw Pro being the current one I'm trying to figure out.

Will let you all know more as I unravel them.

S!
<<

Quelty

User avatar

Posts: 410

Joined: Mon May 19, 2008 4:14 am

Location: Ingham, Queensland, Australia

Post Sat Jul 31, 2010 3:21 am

Re: Processor Affinity Explained

Thanks Jinxx, I currently use PsExec v1.98 to set mine (I'm on a win7 64 bit system btw), haven't been using it long, but no probs so far... If you want to check it out link is here

Cheers
Quelty
<<

Fireskull

User avatar

Posts: 4183

Joined: Tue Jun 09, 2009 12:11 pm

Location: Milky Way Galaxy, Sun System, Earth, USA...Somewhere roaming in the mid-west of America! LOL!

Post Mon Aug 02, 2010 12:20 am

Re: Processor Affinity Explained

Quelty wrote:Thanks Jinxx, I currently use PsExec v1.98 to set mine (I'm on a win7 64 bit system btw), haven't been using it long, but no probs so far... If you want to check it out link is here

Cheers
Quelty



Good day, obviously since this could help many people, we want to test this. Is there a version for XP or Vista in both 32-bit and 64-bit?
<<

{HVY-E}Jinxx

User avatar

Site Administrator

Posts: 1239

Joined: Tue Nov 13, 2007 11:26 pm

Location: Ft. Lewis, WA.

Post Mon Aug 02, 2010 2:15 am

Re: Processor Affinity Explained

I D/L'd the program today. Will install and test tomorrow and let you all know how it works with Win7 x64.

S!
<<

Quelty

User avatar

Posts: 410

Joined: Mon May 19, 2008 4:14 am

Location: Ingham, Queensland, Australia

Post Mon Aug 02, 2010 4:42 am

Re: Processor Affinity Explained

Fireskull wrote:Good day, obviously since this could help many people, we want to test this. Is there a version for XP or Vista in both 32-bit and 64-bit?


Fireskull,
According to the PsExec website, the same version in the link I posted, runs on XP and higher... as I said in my post I haven't had it long but no problems so far and was a piece of cake to install - a matter of dropping the exe into a windows path folder (I dropped mine in C:\Windows\System32) and editing the desktop shortcut. We'll see how Jinnx goes with his testing.

Cheers

Quelty
<<

Fireskull

User avatar

Posts: 4183

Joined: Tue Jun 09, 2009 12:11 pm

Location: Milky Way Galaxy, Sun System, Earth, USA...Somewhere roaming in the mid-west of America! LOL!

Post Mon Aug 02, 2010 9:29 pm

Re: Processor Affinity Explained

Thanks, Quelty :)
<<

madcat

Posts: 671

Joined: Sat Nov 03, 2007 12:15 pm

Post Sat Aug 07, 2010 7:00 pm

Re: Processor Affinity Explained

Thanks for this, really helped me understand processor affinity
<<

RadPig94

User avatar

Skin Mod Member

Posts: 1222

Joined: Sat Jun 26, 2010 10:50 pm

Location: Ustio Air Defense

Post Tue Aug 17, 2010 1:34 pm

Re: Processor Affinity Explained

how do i get my computer to run on both cores? i'm totally confused
<<

Fireskull

User avatar

Posts: 4183

Joined: Tue Jun 09, 2009 12:11 pm

Location: Milky Way Galaxy, Sun System, Earth, USA...Somewhere roaming in the mid-west of America! LOL!

Post Tue Aug 17, 2010 7:27 pm

Re: Processor Affinity Explained

RadPig94 wrote:how do i get my computer to run on both cores? i'm totally confused



Hi, RadPig


1) Find your conf.ini file in the main registry of IL-2 Sturmovik 1946. Simply open the main folder of IL-2. Look for the file called "conf.ini".


2) In the conf.ini file, look for this computer system command line:

;ProcessAffinityMask=1


3) Delete the semi-colon (;) at the front of the ProcessAffinityMask


4) Replace the =1 with whatever number you need to get your goal.

In your case, the command line should look like this in order to run on the first two or both cores (for dual core):

ProcessAffinityMask=3

Remember that you will need to restart IL-2 each attemp.


5) Try ProcessAffinityMask=2 in order to cause IL-2 to focus being processed in the second core. This is the one most used for Dual Core (though a few guys claim that IL-2 runs best for them when processed in both cores).

6) Compare the two values (either =2 or =3) and decide which makes IL-2 run the best.


Let us know the results. :)
<<

{HVY-E}Jinxx

User avatar

Site Administrator

Posts: 1239

Joined: Tue Nov 13, 2007 11:26 pm

Location: Ft. Lewis, WA.

Post Tue Aug 17, 2010 8:42 pm

Re: Processor Affinity Explained

Well, I finally finished testing that program today...

While it's made for server administrators to run programs remotely, it is capable of running programs locally and assigning processors to each program through a command line interface.

All that is required is to alter the shortcut for a particular program to reference the PsExec program and then the arguments after it to select the appropriate program and core.

S!
Next

Return to PC Technical Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.