Changeset b1d8092 for src/builder.cpp
- Timestamp:
- Feb 17, 2010, 11:15:27 AM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 326a43b
- Parents:
- 7ba324 (diff), 354859 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
r7ba324 rb1d8092 76 76 #include "Actions/MethodAction.hpp" 77 77 #include "Actions/small_actions.hpp" 78 #include "World.hpp" 78 79 #include "version.h" 79 80 … … 2166 2167 /********************************************** Main routine **************************************/ 2167 2168 2169 void cleanUp(config *configuration){ 2170 World::destroy(); 2171 delete(configuration); 2172 Log() << Verbose(0) << "Maximum of allocated memory: " 2173 << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl; 2174 Log() << Verbose(0) << "Remaining non-freed memory: " 2175 << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl; 2176 MemoryUsageObserver::purgeInstance(); 2177 logger::purgeInstance(); 2178 errorLogger::purgeInstance(); 2179 UIFactory::purgeInstance(); 2180 ActionRegistry::purgeRegistry(); 2181 } 2182 2168 2183 int main(int argc, char **argv) 2169 2184 { 2170 periodentafel *periode = new periodentafel;2171 MoleculeListClass *molecules = new MoleculeListClass;2172 2185 molecule *mol = NULL; 2173 2186 config *configuration = new config; … … 2180 2193 setVerbosity(0); 2181 2194 /* structure of ParseCommandLineOptions will be refactored later */ 2182 j = ParseCommandLineOptions(argc, argv, molecules, periode, *configuration, ConfigFileName);2195 j = ParseCommandLineOptions(argc, argv, World::get()->getMolecules(), World::get()->getPeriode(), *configuration, ConfigFileName); 2183 2196 switch (j){ 2184 2197 case 255: 2185 2198 case 2: 2186 2199 case 1: 2187 delete (molecules); 2188 delete (periode); 2189 delete (configuration); 2190 Log() << Verbose(0) << "Maximum of allocated memory: " << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl; 2191 Log() << Verbose(0) << "Remaining non-freed memory: " << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl; 2192 MemoryUsageObserver::getInstance()->purgeInstance(); 2193 logger::purgeInstance(); 2194 errorLogger::purgeInstance(); 2200 cleanUp(configuration); 2195 2201 return (j == 1 ? 0 : j); 2196 2202 default: 2197 2203 break; 2198 2204 } 2199 if( molecules->ListOfMolecules.size() == 0){2200 mol = new molecule(periode);2205 if(World::get()->numMolecules() == 0){ 2206 mol = World::get()->createMolecule(); 2201 2207 if(mol->cell_size[0] == 0.){ 2202 2208 Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl; … … 2206 2212 } 2207 2213 } 2208 2209 2214 mol->ActiveFlag = true; 2210 molecules->insert(mol);2211 2215 } 2212 2216 … … 2224 2228 UIFactory::makeUserInterface(UIFactory::Text); 2225 2229 #endif 2226 MainWindow *mainWindow = UIFactory::get()->makeMainWindow(populaters, molecules, configuration, periode, ConfigFileName);2230 MainWindow *mainWindow = UIFactory::get()->makeMainWindow(populaters,World::get()->getMolecules(), configuration, World::get()->getPeriode(), ConfigFileName); 2227 2231 mainWindow->display(); 2228 2232 … … 2230 2234 } 2231 2235 2232 if( periode->StorePeriodentafel(configuration->databasepath))2236 if(World::get()->getPeriode()->StorePeriodentafel(configuration->databasepath)) 2233 2237 Log() << Verbose(0) << "Saving of elements.db successful." << endl; 2234 2238 … … 2236 2240 Log() << Verbose(0) << "Saving of elements.db failed." << endl; 2237 2241 2238 delete (molecules); 2239 delete(periode); 2240 delete(configuration); 2241 2242 2243 2244 Log() << Verbose(0) << "Maximum of allocated memory: " 2245 << MemoryUsageObserver::getInstance()->getMaximumUsedMemory() << endl; 2246 Log() << Verbose(0) << "Remaining non-freed memory: " 2247 << MemoryUsageObserver::getInstance()->getUsedMemorySize() << endl; 2248 MemoryUsageObserver::purgeInstance(); 2249 logger::purgeInstance(); 2250 errorLogger::purgeInstance(); 2251 UIFactory::purgeInstance(); 2252 ActionRegistry::purgeRegistry(); 2242 cleanUp(configuration); 2253 2243 return (0); 2254 2244 }
Note:
See TracChangeset
for help on using the changeset viewer.