Badass1982 Posted July 3, 2020 Posted July 3, 2020 Hi all I have a batch file that starts my 5 server instances , but I'm trying to get it to work so that each instance runs in its own core on the CPU..... I have lots of cores so its not a problem but instead of DCS trying to run all 5 instances in one core as it does by default, I want it to run each instance in a separate core , This is what I have currently and it works great for running without affinity: :loop timeout /t 5 >nul ::REM -- wait before launching CF CAPTURE Start "" /high "E:\DCS\bin\DCS.exe" --norender --server -w CF_CAPTURE timeout /t 5 >nul ::REM -- wait before launching SF CAPTURE Start "" /high "E:\DCS\bin\DCS.exe" --norender --server -w SF_CAPTURE timeout /t 5 >nul ::REM -- wait before launching ROUND TABLE CAUCASUS Start "" /high "E:\DCS\bin\DCS.exe" --norender --server -w ROUND_TABLE_GC timeout /t 5 >nul ::REM -- wait before launching ROUND TABLE PERSIAN GULF Start "" /high "E:\DCS\bin\DCS.exe" --norender --server -w ROUND_TABLE_PERSIA timeout /t 5 >nul ::REM -- wait before launching BONUS SERVER BS_CAPTURE Start "" /high "E:\DCS\bin\DCS.exe" --norender --server -w BS_CAPTURE timeout /t 36030 /nobreak ::REM -- amount of time for servers to run taskkill /f /im DCS.exe goto loop Exit I attempted to add the command switch /affinity "n" -- where N is the core I want this instance to use....as shown below..... :loop timeout /t 5 >nul ::REM -- wait before launching CF CAPTURE Start "" /affinity 0 /high "E:\DCS\bin\DCS.exe" --norender --server -w CF_CAPTURE timeout /t 5 >nul ::REM -- wait before launching SF CAPTURE Start "" /affinity 1 /high "E:\DCS\bin\DCS.exe" --norender --server -w SF_CAPTURE timeout /t 5 >nul ::REM -- wait before launching ROUND TABLE CAUCASUS Start "" /affinity 2 /high "E:\DCS\bin\DCS.exe" --norender --server -w ROUND_TABLE_GC timeout /t 5 >nul ::REM -- wait before launching ROUND TABLE PERSIAN GULF Start "" /affinity 3 /high "E:\DCS\bin\DCS.exe" --norender --server -w ROUND_TABLE_PERSIA timeout /t 5 >nul ::REM -- wait before launching BONUS SERVER BS_CAPTURE Start "" /affinity 4 /high "E:\DCS\bin\DCS.exe" --norender --server -w BS_CAPTURE timeout /t 36030 /nobreak ::REM -- amount of time for servers to run taskkill /f /im DCS.exe goto loop Exit but alas it doesn't work and all 5 instances still run in the same core. Any of you wiz's have any clue with batch files and basic dos programming can help me get this working??? Thanks in advance.... Martin
davidp57 Posted July 4, 2020 Posted July 4, 2020 AFFINITY works with a hexidecimal mask that should allow granular control of all of your processors. Note that the rightmost bit specifies the lowest-order CPU (0) (see KB 299641). https://stackoverflow.com/questions/7759948/set-affinity-with-start-affinity-command-on-windows-7 Zip - VEAF :pilotfly: If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !
davidp57 Posted July 4, 2020 Posted July 4, 2020 Also (after having read a bit) it seems that setting affinity in DCS is not possible anymore since 2.5.6 (see https://forums.eagle.ru/showthread.php?p=4222018) Zip - VEAF :pilotfly: If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !
Recommended Posts