- reverted win64 to sse2

- added some debug info for win64 testing
This commit is contained in:
Mark Vejvoda 2013-11-06 02:14:49 +00:00
parent eb6466889f
commit 493981e8b3
9 changed files with 62 additions and 13 deletions

View File

@ -150,7 +150,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>

View File

@ -192,7 +192,7 @@
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>

View File

@ -191,7 +191,7 @@
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>

View File

@ -259,7 +259,7 @@
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>

View File

@ -168,7 +168,7 @@
<AdditionalIncludeDirectories>../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/windows_deps_2012/cppunit/include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

View File

@ -205,7 +205,7 @@
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>

View File

@ -160,7 +160,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;libxml2_a.lib;%(AdditionalDependencies)</AdditionalDependencies>

View File

@ -287,6 +287,7 @@ bool FactionThread::isSignalPathfinderCompleted(int frameIndex) {
}
void FactionThread::execute() {
string codeLocation = "1";
RunningStatusSafeWrapper runningStatus(this);
try {
//setRunningStatus(true);
@ -296,6 +297,7 @@ void FactionThread::execute() {
bool minorDebugPerformance = false;
Chrono chrono;
codeLocation = "2";
//unsigned int idx = 0;
for(;this->faction != NULL;) {
if(getQuitStatus() == true) {
@ -305,6 +307,7 @@ void FactionThread::execute() {
semTaskSignalled.waitTillSignalled();
codeLocation = "3";
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
static string masterSlaveOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MasterSlaveThreadControllerSafeWrapper safeMasterController(masterController,20000,masterSlaveOwnerId);
@ -315,6 +318,7 @@ void FactionThread::execute() {
break;
}
codeLocation = "4";
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutex(triggerIdMutex,mutexOwnerId);
bool executeTask = (this->frameIndex.first >= 0);
@ -324,9 +328,11 @@ void FactionThread::execute() {
safeMutex.ReleaseLock();
codeLocation = "5";
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(executeTask == true) {
codeLocation = "6";
ExecutingTaskSafeWrapper safeExecutingTaskMutex(this);
if(this->faction == NULL) {
@ -337,6 +343,7 @@ void FactionThread::execute() {
throw megaglest_runtime_error("world == NULL");
}
codeLocation = "7";
//Config &config= Config::getInstance();
//bool sortedUnitsAllowed = config.getBool("AllowGroupedUnitCommands","true");
bool sortedUnitsAllowed = false;
@ -344,6 +351,7 @@ void FactionThread::execute() {
this->faction->sortUnitsByCommandGroups();
}
codeLocation = "8";
static string mutexOwnerId2 = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutex(faction->getUnitMutex(),mutexOwnerId2);
@ -352,22 +360,28 @@ void FactionThread::execute() {
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
codeLocation = "9";
int unitCount = this->faction->getUnitCount();
for(int j = 0; j < unitCount; ++j) {
codeLocation = "10";
Unit *unit = this->faction->getUnit(j);
if(unit == NULL) {
throw megaglest_runtime_error("unit == NULL");
}
codeLocation = "11";
int64 elapsed1 = 0;
if(minorDebugPerformance) elapsed1 = chrono.getMillis();
bool update = unit->needToUpdate();
codeLocation = "12";
if(minorDebugPerformance && (chrono.getMillis() - elapsed1) >= 1) printf("Faction [%d - %s] #1-unit threaded updates on frame: %d for [%d] unit # %d, unitCount = %d, took [%lld] msecs\n",faction->getStartLocationIndex(),faction->getType()->getName(false).c_str(),currentTriggeredFrameIndex,faction->getUnitPathfindingListCount(),j,unitCount,(long long int)chrono.getMillis() - elapsed1);
//update = true;
if(update == true) {
if(update == true)
{
codeLocation = "13";
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
int64 updateProgressValue = unit->getUpdateProgress();
int64 speed = unit->getCurrSkill()->getTotalSpeed(unit->getTotalUpgrade());
@ -386,12 +400,14 @@ void FactionThread::execute() {
if(world->getUnitUpdater() == NULL) {
throw megaglest_runtime_error("world->getUnitUpdater() == NULL");
}
codeLocation = "14";
world->getUnitUpdater()->updateUnitCommand(unit,currentTriggeredFrameIndex);
codeLocation = "15";
if(minorDebugPerformance && (chrono.getMillis() - elapsed2) >= 1) printf("Faction [%d - %s] #2-unit threaded updates on frame: %d for [%d] unit # %d, unitCount = %d, took [%lld] msecs\n",faction->getStartLocationIndex(),faction->getType()->getName(false).c_str(),currentTriggeredFrameIndex,faction->getUnitPathfindingListCount(),j,unitCount,(long long int)chrono.getMillis() - elapsed2);
}
else {
codeLocation = "16";
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true) {
int64 updateProgressValue = unit->getUpdateProgress();
int64 speed = unit->getCurrSkill()->getTotalSpeed(unit->getTotalUpgrade());
@ -406,12 +422,14 @@ void FactionThread::execute() {
}
}
codeLocation = "17";
if(minorDebugPerformance && chrono.getMillis() >= 1) printf("Faction [%d - %s] threaded updates on frame: %d for [%d] units took [%lld] msecs\n",faction->getStartLocationIndex(),faction->getType()->getName(false).c_str(),currentTriggeredFrameIndex,faction->getUnitPathfindingListCount(),(long long int)chrono.getMillis());
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
safeMutex.ReleaseLock();
codeLocation = "18";
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
setTaskCompleted(currentTriggeredFrameIndex);
@ -421,6 +439,7 @@ void FactionThread::execute() {
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
codeLocation = "19";
if(getQuitStatus() == true) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
break;
@ -433,14 +452,14 @@ void FactionThread::execute() {
catch(const exception &ex) {
//setRunningStatus(false);
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Loc [%s] Error [%s]\n",__FILE__,__FUNCTION__,__LINE__,codeLocation.c_str(),ex.what());
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
throw megaglest_runtime_error(ex.what());
}
catch(...) {
char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s %d] UNKNOWN error\n",__FILE__,__FUNCTION__,__LINE__);
snprintf(szBuf,8096,"In [%s::%s %d] UNKNOWN error Loc [%s]\n",__FILE__,__FUNCTION__,__LINE__,codeLocation.c_str());
SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
throw megaglest_runtime_error(szBuf);
}

View File

@ -302,6 +302,8 @@ bool UnitUpdater::updateUnit(Unit *unit) {
//VERY IMPORTANT: compute next state depending on the first order of the list
void UnitUpdater::updateUnitCommand(Unit *unit, int frameIndex) {
string codeLocation = "1";
try {
bool minorDebugPerformance = false;
Chrono chrono;
if((minorDebugPerformance == true && frameIndex > 0) || SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled) chrono.start();
@ -309,31 +311,40 @@ void UnitUpdater::updateUnitCommand(Unit *unit, int frameIndex) {
//if unit has command process it
bool hasCommand = (unit->anyCommand());
codeLocation = "2";
if((minorDebugPerformance && frameIndex > 0) && chrono.getMillis() >= 1) printf("UnitUpdate [%d - %s] #1-unit threaded updates on frame: %d took [%lld] msecs\n",unit->getId(),unit->getType()->getName(false).c_str(),frameIndex,(long long int)chrono.getMillis());
int64 elapsed1 = 0;
if(minorDebugPerformance && frameIndex > 0) elapsed1 = chrono.getMillis();
if(hasCommand == true) {
codeLocation = "3";
if(SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"In [%s::%s Line: %d] unit [%s] has command [%s]\n",__FILE__,__FUNCTION__,__LINE__,unit->toString(false).c_str(), unit->getCurrCommand()->toString(false).c_str());
bool commandUsesPathFinder = (frameIndex < 0);
if(frameIndex > 0) {
codeLocation = "3a";
if(unit->getCurrCommand() != NULL && unit->getCurrCommand()->getCommandType() != NULL) {
codeLocation = "3b";
commandUsesPathFinder = unit->getCurrCommand()->getCommandType()->usesPathfinder();
// Clear previous cached unit data
if(commandUsesPathFinder == true) {
codeLocation = "3c";
clearUnitPrecache(unit);
}
}
}
codeLocation = "4";
if(commandUsesPathFinder == true) {
codeLocation = "4a";
if(unit->getCurrCommand() != NULL && unit->getCurrCommand()->getCommandType() != NULL) {
codeLocation = "4b";
unit->getCurrCommand()->getCommandType()->update(this, unit, frameIndex);
}
}
codeLocation = "5";
if((minorDebugPerformance && frameIndex > 0) && (chrono.getMillis() - elapsed1) >= 1) {
//CommandClass cc = unit->getCurrCommand()->getCommandType()->commandTypeClass;
printf("UnitUpdate [%d - %s] #2-unit threaded updates on frame: %d commandUsesPathFinder = %d took [%lld] msecs\nCommand: %s\n",unit->getId(),unit->getType()->getName(false).c_str(),frameIndex,commandUsesPathFinder,(long long int)chrono.getMillis() - elapsed1,unit->getCurrCommand()->toString(false).c_str());
@ -343,21 +354,40 @@ void UnitUpdater::updateUnitCommand(Unit *unit, int frameIndex) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
if(frameIndex < 0) {
codeLocation = "6";
//if no commands stop and add stop command
if(unit->anyCommand() == false && unit->isOperative()) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
codeLocation = "6a";
if(unit->getType()->hasSkillClass(scStop)) {
unit->setCurrSkill(scStop);
}
codeLocation = "6b";
if(unit->getType()->hasCommandClass(ccStop)) {
unit->giveCommand(new Command(unit->getType()->getFirstCtOfClass(ccStop)));
}
}
}
codeLocation = "7";
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld --------------------------- [END OF METHOD] ---------------------------\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
if((minorDebugPerformance && frameIndex > 0) && chrono.getMillis() >= 1) printf("UnitUpdate [%d - %s] #3-unit threaded updates on frame: %d took [%lld] msecs\n",unit->getId(),unit->getType()->getName(false).c_str(),frameIndex,(long long int)chrono.getMillis());
}
catch(const exception &ex) {
//setRunningStatus(false);
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Loc [%s] Error [%s]\n",__FILE__,__FUNCTION__,__LINE__,codeLocation.c_str(),ex.what());
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
throw megaglest_runtime_error(ex.what());
}
catch(...) {
char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s %d] UNKNOWN error Loc [%s]\n",__FILE__,__FUNCTION__,__LINE__,codeLocation.c_str());
SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
throw megaglest_runtime_error(szBuf);
}
}
// ==================== updateStop ====================