Changeset cb98f1 for src/Jobs


Ignore:
Timestamp:
Mar 2, 2017, 2:01:50 PM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_ChronosMutex, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
Children:
290c8e
Parents:
dfeb7c
git-author:
Frederik Heber <heber@…> (02/20/17 09:46:50)
git-committer:
Frederik Heber <heber@…> (03/02/17 14:01:50)
Message:

FIX: One Definition Rule violation by mpqc.

  • mpqc.cc implements MPQCJob::Work() a second time (other in MPQCJob.cpp), this violates ODR and did so far work out of sheer luck. This was brough to surface by making a debian package.
  • Now, we extracted MPQCJob::Work() into a separate library.
Location:
src/Jobs
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/Jobs/MPQCJob.cpp

    rdfeb7c rcb98f1  
    4545
    4646#include <limits>
    47 #include <sstream>
    4847
    4948#include "CodePatterns/Assert.hpp"
     
    8483{}
    8584
    86 FragmentResult::ptr MPQCJob::Work()
    87 {
    88   // instantiate empty data
    89   const MPQCData data;
    90   std::stringstream returnstream;
    91   boost::archive::text_oarchive oa(returnstream);
    92   oa << data;
    93 
    94   // create the result
    95   FragmentResult::ptr ptr( new FragmentResult(getId(), returnstream.str()) );
    96   if (data.desired_accuracy != 0.) {
    97     ptr->exitflag = data.accuracy < data.desired_accuracy ? 0 : 1;
    98     if (ptr->exitflag != 0)
    99       ELOG(1, "Job #" << ptr->getId() << " failed to reach desired accuracy.");
    100   } else {
    101     LOG(3, "INFO: No precision returned from MPQC job, not checking.");
    102   }
    103 
    104   return ptr;
    105 }
    106 
    10785// we need to explicitly instantiate the serialization functions as
    10886// its is only serialized through its base class FragmentJob
  • src/Jobs/Makefile.am

    rdfeb7c rcb98f1  
    5555endif
    5656
    57 lib_LTLIBRARIES += libMolecuilderJobs.la
     57lib_LTLIBRARIES += \
     58        libMolecuilderJobs.la
     59noinst_LTLIBRARIES += \
     60        libMolecuilderJobs_Work.la
    5861libMolecuilderJobs_la_includedir = $(includedir)/MoleCuilder/
    5962nobase_libMolecuilderJobs_la_include_HEADERS = $(JOBSHEADER)
    6063libMolecuilderJobs_la_CPPFLAGS = $(AM_CPPFLAGS) ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS} ${JobMarket_CFLAGS} -Dvmg_float=double -Dvmg_int=int $(VMG_CFLAGS)
     64libMolecuilderJobs_Work_la_CPPFLAGS = $(AM_CPPFLAGS) ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS} ${JobMarket_CFLAGS} -Dvmg_float=double -Dvmg_int=int $(VMG_CFLAGS)
    6165libMolecuilderJobs_la_LDFLAGS = $(AM_LDFLAGS) \
    6266  $(BOOST_IOSTREAMS_LDFLAGS) \
    6367  $(BOOST_SERIALIZATION_LDFLAGS) \
    6468  $(BOOST_SYSTEM_LDFLAGS)
     69libMolecuilderJobs_Work_la_LDFLAGS = $(AM_LDFLAGS)
    6570if CONDJOBMARKET
    6671libMolecuilderJobs_la_LDFLAGS += \
     72  $(JobMarket_LDFLAGS)
     73libMolecuilderJobs_Work_la_LDFLAGS += \
    6774  $(JobMarket_LDFLAGS)
    6875endif
     
    8390if CONDJOBMARKET
    8491libMolecuilderJobs_la_LIBADD += \
     92  $(JobMarket_LIBS)
     93libMolecuilderJobs_Work_la_LIBADD = \
    8594  $(JobMarket_LIBS)
    8695endif
     
    105114## which are already listed elsewhere in a _HEADERS variable assignment.
    106115libMolecuilderJobs_la_SOURCES = $(JOBSSOURCE)
     116libMolecuilderJobs_Work_la_SOURCES = Jobs/MPQCJob_Work.cpp
    107117
    108118## Instruct libtool to include ABI version information in the generated shared
  • src/Jobs/unittests/Makefile.am

    rdfeb7c rcb98f1  
    2020        ../libMolecuilder.la \
    2121        ../libMolecuilderJobs.la \
     22        ../libMolecuilderJobs_Work.la \
    2223        ../libMolecuilderFragmentationContainers.la \
    2324        ../libMolecuilderFragmentationSummation.la \
Note: See TracChangeset for help on using the changeset viewer.