Skip to content

Commit f1018f9

Browse files
authored
Merge pull request #41 from kmokstad/dump-if-profiling
Optional memory profiling
2 parents a956500 + 17f484f commit f1018f9

File tree

4 files changed

+20
-22
lines changed

4 files changed

+20
-22
lines changed

vpmDB/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ if ( USE_MEMPOOL )
4949
string ( APPEND CMAKE_CXX_FLAGS " -DFT_USE_MEMPOOL" )
5050
endif ( USE_MEMPOOL )
5151

52+
if ( USE_PROFILER )
53+
string ( APPEND CMAKE_CXX_FLAGS " -DFT_USE_PROFILER" )
54+
endif ( USE_PROFILER )
55+
5256
if ( USE_VISUALS )
5357
string ( APPEND CMAKE_CXX_FLAGS " -DFT_USE_VISUALS" )
5458
endif ( USE_VISUALS )

vpmDB/FmPart.C

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,13 @@ bool FmPart::importPart(const std::string& fileName,
14641464

14651465
fileVersion = 1; // Don't care about file version on import
14661466
nFENodesTotal += myFEData->getNodeCount();
1467+
#ifdef FT_USE_PROFILER
1468+
#ifdef FT_USE_CMDLINEARG
1469+
int memPoll = 0;
1470+
FFaCmdLineArg::instance()->getValue("memPoll",memPoll);
1471+
if (memPoll > 0) myFEData->dump(this->getLinkIDString(true));
1472+
#endif
1473+
#endif
14671474

14681475
needsCSupdate.setValue(true);
14691476
originalFEFile.setValue(newFEFile);
@@ -1509,16 +1516,6 @@ bool FmPart::importPart(const std::string& fileName,
15091516
this->updateMassProperties();
15101517
this->updateLoadCases();
15111518

1512-
#ifdef FT_USE_CMDLINEARG
1513-
bool doMemPoll = false;
1514-
FFaCmdLineArg::instance()->getValue("memPoll",doMemPoll);
1515-
if (doMemPoll)
1516-
{
1517-
std::cout << this->getLinkIDString() << std::endl;
1518-
myFEData->dump();
1519-
}
1520-
#endif
1521-
15221519
// Check if the number of component modes was specified on the FE data file
15231520
if (myFEData->getNumberOfGenDofs())
15241521
nGenModes.setValue(myFEData->getNumberOfGenDofs());
@@ -1637,22 +1634,19 @@ bool FmPart::openFEData()
16371634
{
16381635
FFaMsg::list(" ...OK\n");
16391636
nFENodesTotal += myFEData->getNodeCount();
1637+
#ifdef FT_USE_PROFILER
1638+
#ifdef FT_USE_CMDLINEARG
1639+
int memPoll = 0;
1640+
FFaCmdLineArg::instance()->getValue("memPoll",memPoll);
1641+
if (memPoll > 0) myFEData->dump(this->getLinkIDString(true));
1642+
#endif
1643+
#endif
16401644

16411645
this->updateElemGroupProxies();
16421646
this->updateMassProperties();
16431647
this->updateLoadCases();
16441648

16451649
savedCS.setValue(myFEData->calculateChecksum());
1646-
1647-
#ifdef FT_USE_CMDLINEARG
1648-
bool doMemPoll = false;
1649-
FFaCmdLineArg::instance()->getValue("memPoll",doMemPoll);
1650-
if (doMemPoll)
1651-
{
1652-
std::cout << this->getLinkIDString() << std::endl;
1653-
myFEData->dump();
1654-
}
1655-
#endif
16561650
}
16571651
else if (myFEData->isTooLarge())
16581652
{

vpmDB/FmSolverInput.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ std::string Fedem::createReducerInput(FmAnalysis* analysis,
264264
if (analysis->useRamSizeGSF.getValue())
265265
{
266266
// Use the out-of-core GSF equation solver
267-
if (addOptions.find("-gsfSolver") != std::string::npos)
267+
if (addOptions.find("-gsfSolver") == std::string::npos)
268268
fcoArgs.add("-gsfSolver",2);
269269
if (analysis->autoRamSizeGSF.getValue())
270270
fcoArgs.add("-cachesize",0);

0 commit comments

Comments
 (0)