Why single thread is en of spring for me

Why single thread is en of spring for me

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

User avatar
albator
Posts: 866
Joined: 14 Jan 2009, 14:20

Why single thread is en of spring for me

Post by albator »

http://replays.springrts.com/replay/2f4 ... e783ff94e/

I over-clock my i5: blk 133 -> 166

lowest setting -> http://pastebin.fr/31958

Game is not playable end game, it was with default setting and no over clock in ffa with more unit.

=> no multithread is end of fun for me.

1) Why nor bringing multi-thread back ?

2) Why dev and people not playing BA tell spring 95 is faster and NONE of them is posting config file setting and replay to prove it ? Please, prove I am wrong and do so.
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: Why single thread is en of spring for me

Post by The Yak »

Image

No multithreading in Spring 95.0? You sure about that?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Why single thread is en of spring for me

Post by gajop »

albator wrote: 1) Why nor bringing multi-thread back ?
Why no read forums? It's been asked a lot of times.
klapmongool
Posts: 843
Joined: 13 Aug 2007, 13:19

Re: Why single thread is en of spring for me

Post by klapmongool »

It is funny how much denial there is on this subject. 94.1 MT did give better performance with thousands of units and actions than 95 does.

Assuming that you meant to write ´end´ in the topic title: Good bye Alba. I'm sure you'll be back though. There is still no RTS alike out there.
Broker
Posts: 156
Joined: 02 Jul 2012, 13:16

Re: Why single thread is en of spring for me

Post by Broker »

dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Why single thread is en of spring for me

Post by dansan »

The Yak wrote:ImageNo multithreading in Spring 95.0? You sure about that?
Your OS scheduler is just moving the threads and process quicker around than the task manager shows. It is redistributing the processes every few ms to lower the physical demand (heat) on your CPU. "every few ms" is an eternity for a CPU, but not on the scale of the task manager.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Why single thread is en of spring for me

Post by jK »

dansan wrote:
The Yak wrote:ImageNo multithreading in Spring 95.0? You sure about that?
Your OS scheduler is just moving the threads and process quicker around than the task manager shows. It is redistributing the processes every few ms to lower the physical demand (heat) on your CPU. "every few ms" is an eternity for a CPU, but not on the scale of the task manager.
bullshit,
Spring is threaded!

Also Spring sets core affinity, so there is no thread-hoping!
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Why single thread is en of spring for me

Post by dansan »

jK wrote:Also Spring sets core affinity, so there is no thread-hoping!
The scheduler does still do it, just less often.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Why single thread is en of spring for me

Post by Beherith »

There is one pretty large (at least for me) issue in 95.0, where the apparent frame rate seemed much lower because of jitter than the actual frame spring was running at, this is fixed in latest develop branch (thanks Kloot!). 96 will be much much smoother for many people affected by the bug (you are affected if you get lots of CTO assert errors when in debug view alt+n).

For me, the loads seemed no higher in 95 than in 94.1, but I will agree that MT sim worked well for BA.

Also, try the following settings:
3DTrees = 0
AdvUnitShading = 0
AllowDeferredMapRendering = 0
AllowDeferredModelRendering = 0
CamFreeEnabled = 1
CamFreeScrollSpeed = 50
CamMode = 1
CamTimeExponent = 3.0
CamTimeFactor = 1.0
DepthBufferBits = 24
FPSScrollSpeed = 50
FSAA = 0
GrassDetail = 0
GroundDecals = 0
GroundDetail = 20
InputTextGeo = 0.26 0.73 0.02 0.028
LastSelectedMap = Comet Catcher Redux
LastSelectedMod = Balanced Annihilation V7.84
LastSelectedScript = Player vs. AI: NullAI 0.1
LogFlush = 0
LuaShaders = 0
MaxNanoParticles = 0
MaxParticles = 0
MaxSounds = 24
MaxDynamicMapLights = 0
MaxDynamicModelLights = 0
MinimapOnLeft = 0
OverheadScrollSpeed = 50
ReflectiveWater = 0
RotOverheadScrollSpeed = 50
SM3ForceFallbackTex = 0
ScrollWheelSpeed = 34
ShadowMapSize = 1024
Shadows = 0
ShowFPS = 1
ShowPlayerInfo = 0
SmoothLines = 0
SmoothPoints = 0
TWScrollSpeed = 50
TreeRadius = 600
UnitIconDist = 85
UnitLodDist = 100
UsePBO = 0
VSync = -1
VerboseLevel = 0
WorkerThreadCount = 4
snd_general = 0
snd_volbattle = 60
snd_volmaster = 0
snd_volui = 60
snd_volunitreply = 60
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Why single thread is en of spring for me

Post by dansan »

Ah... I've glanced at the code, and if I understand correctly, you are telling the OS scheduler to treat the sim thread with SCHED_BATCH (though not the other threads). So the OS scheduler will give it a longer time slice.

My C++-foo is bad :oops: , so if I'm totally wrong please don't be pissed - I tried to understand the code in Threading.cpp as quick as possible.
All invocations of "Threading::SetAffinity()" that I see are with "~0". Doesn't that mean, that the cpu_mask is as open as possible (and then gets '&' with available cores)?

I always get "[Threading] Main thread CPU affinity not set" (on a i5) in the infolog. Doesn't that mean exactly what I wrote, that my sim thread is scheduled "slowly", but "fixed" only inside a certain set of cores?

Another question: does OpenMP thread affinity still only work on intel processors, or does it work on AMD now too?
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Why single thread is en of spring for me

Post by Anarchid »

The real question is, does OpenMP have much to do with current version of Spring?
~/Games/spring/spring$ grep -sirn "openmp" ./
./doc/changelog.txt:921: - OpenMP build
./doc/changelog.txt:1687: - added limited OpenMP support
./rts/Sim/Path/QTPFS/PathManager.cpp:268: #ifdef QTPFS_OPENMP_ENABLED
./rts/Sim/Path/QTPFS/PathManager.cpp:369: #ifdef QTPFS_OPENMP_ENABLED
./rts/Sim/Path/QTPFS/PathDefines.hpp:15:// #define QTPFS_OPENMP_ENABLED
./CMakeLists.txt:335:### our custom OpenMP replacement
./CMakeLists.txt:356: if (NOT OPENMP)
./CMakeLists.txt:360: endif (NOT OPENMP)
Binary file ./.git/objects/pack/pack-c510f2c1c39b03fe8533d58b0a6fe8419de1f4fd.pack matches
./buildbot/master/master.cfg:541: self.addStep( TestIfStaticLinked(libname="libgomp", name="openmp") )
Only solid match here is in QTPFS, but that of course doesn't say a lot.
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

Re: Why single thread is en of spring for me

Post by dansan »

try

Code: Select all

egrep -irn 'thread|schedul|affinity' $(find -type f -name '*.cpp')
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Why single thread is en of spring for me

Post by Anarchid »

egrep -irn 'thread|schedul|affinity' $(find -type f -name '*.cpp')
That's a lot of false positives, by which i mean that majority of found lines bear no relation to OpenMP.

...so i found a bit of specs on OpenMP.

Search for "pragma omp" found one old result in my cmake cache.

Then I've made a fair assumption that since most omp calls seem to begin with "omp_", i would expect to find some by grepping for "omp_".

This resulted:
~/Games/spring/spring$ grep -sirn "omp_" ./
./include/SDL/SDL_opengl.h:2603:#define GL_COMP_BIT_ATI 0x00000002
./include/GL/glew.h:4293:#define GL_COMP_BIT_ATI 0x00000002
./include/GL/glext.h:3040:#define GL_COMP_BIT_ATI 0x00000002
./rts/System/ThreadPool.cpp:47: //return omp_get_thread_num();
./rts/CMakeLists.txt:58: #FIND_LIBRARY(OMP_LIBRARY gomp) FIXME it's hidden in some subfolders
./rts/CMakeLists.txt:62: #LIST(APPEND engineCommonLibraries ${PTHREAD_LIBRARY} ${OMP_LIBRARY})
./buildbot/slave/linux/create_linux_static_bundle.sh:51: OMP_LIB_NAME_VER="libgomp.so.1"
./buildbot/slave/linux/create_linux_static_bundle.sh:52: OMP_LIB_NAME_FIX="libgomp.so\x0\x0"
./buildbot/slave/linux/create_linux_static_bundle.sh:58: sed -i -e "s/${SDL_LIB_NAME_VER}/${SDL_LIB_NAME_FIX}/g" -e "s/${OMP_LIB_NAME_VER}/${OMP_LIB_NAME_FIX}/g" ${binary}
The only omp_* call in current spring develop is commented out...

This is really alien land, so i don't know if OMP can somehow work without being called via some voodoo powers. :|
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Why single thread is en of spring for me

Post by jK »

dansan wrote:I always get "[Threading] Main thread CPU affinity not set" (on a i5) in the infolog. Doesn't that mean exactly what I wrote, that my sim thread is scheduled "slowly", but "fixed" only inside a certain set of cores?
Then you disabled threadpool (configtag is WorkerThreadCount) and neither used SetCoreAffinity.
dansan wrote:Another question: does OpenMP thread affinity still only work on intel processors, or does it work on AMD now too?
Where do ppl always get such crap ideas from? When you don't understand stuff, don't talk as if what you say were facts.
Anarchid wrote:This is really alien land, so i don't know if OMP can somehow work without being called via some voodoo powers. :|
Spring doesn't use OMP anymore, it now uses its own threadpool implementation to have full control over it (OMP caused a lot problems which couldn't be solved cause of API limitations).
grep for e.g. for_mt
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Why single thread is en of spring for me

Post by Jools »

Beherith wrote:There is one pretty large (at least for me) issue in 95.0, where the apparent frame rate seemed much lower because of jitter than the actual frame spring was running at, this is fixed in latest develop branch (thanks Kloot!). 96 will be much much smoother for many people affected by the bug (you are affected if you get lots of CTO assert errors when in debug view alt+n).
You mean these errors:

spring 95.0:
Error: assert(CTO <= 1.0f) failed (SF=67 : DF=1273 : CTO=1.429283 : WSF=0.040837 : DT=35.000000ms : NP=1)

spring 95.0.1-168:
assert(CTO <= 1.3f) failed (SF=835 : DF=5022 : CTO=1.317365 : WSF=0.029940 : DT=44.000000ms : DLNPPT=0.000000ms | DLRPT=44.000000ms | DSFPT=44.000000ms : NP=0)

How many is many? I get like a bunch of them with only commanders on map in debug mode (alt-b for me).
varikonniemi
Posts: 451
Joined: 03 Jul 2011, 11:54

Re: Why single thread is en of spring for me

Post by varikonniemi »

zerver said that once the drama is over, he will release gpl violation as open source, and we can have nicer performance again. He just wants the lobby to support multiple engines so that he can compete with spring.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Why single thread is en of spring for me

Post by Anarchid »

he will release gpl violation as open source, and we can have nicer performance again
Hmm, GPL Violation Engine sounds much better than both "Engine that Should Not Be Named" and the alphabet soup zerver devised, i suppose :D
He just wants the lobby to support multiple engines so that he can compete with spring.
Last time i spotted zerver explaining his viewpoint, it was specifically that "gpl violation" was to be allowed to proliferate on lobby server before the conditional source release. Which sounded a bit strange on a whole bunch of levels.
Last edited by Anarchid on 10 Dec 2013, 15:08, edited 1 time in total.
varikonniemi
Posts: 451
Joined: 03 Jul 2011, 11:54

Re: Why single thread is en of spring for me

Post by varikonniemi »

If the lobby supports multiple spring engines, then it supports hosting also MT engine, right? Then he thinks its fair and releases the source since users can play also using his engine.

I don't agree with his method, but i also don't agree on blocking someone to contribute to the spring project.
Last edited by varikonniemi on 10 Dec 2013, 15:11, edited 1 time in total.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Why single thread is en of spring for me

Post by Anarchid »

Then he thinks its fair and releases the source since users can play also on his engine.
"Please host my gpl-violating code on your infrastructure, and then i'll maybe release sources"?

Zerver can already compete with Spring on his own infra. There's a lobby server he launched for gpl violation, with all requisite whois protection in case of a C&D.

(but there are cached records, as always)

Of course, nobody seems to want to play with that.
varikonniemi
Posts: 451
Joined: 03 Jul 2011, 11:54

Re: Why single thread is en of spring for me

Post by varikonniemi »

Yes, the problem is that all users are on spring server. So why should they go to another server to be able to play same game with multithread? Just because the devs cannot kiss and make up and work under same name?
Post Reply

Return to “Help & Bugs”