/*
* Project: MoleCuilder
* Description: creates and alters molecular systems
* Copyright (C) 2017 Frederik Heber. All rights reserved.
*
*
* This file is part of MoleCuilder.
*
* MoleCuilder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* MoleCuilder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MoleCuilder. If not, see .
*/
/*
* MPQCJobi_Work.cpp
*
* Created on: Feb 20, 2017
* Author: heber
*/
// include config.h
#ifdef HAVE_CONFIG_H
#include
#endif
// include headers that implement a archive in simple text format
// otherwise BOOST_CLASS_EXPORT_IMPLEMENT has no effect
#include
#include
#include "CodePatterns/MemDebug.hpp"
#include "MPQCJob.hpp"
#include
#include "CodePatterns/Log.hpp"
FragmentResult::ptr MPQCJob::Work()
{
// instantiate empty data
const MPQCData data;
std::stringstream returnstream;
boost::archive::text_oarchive oa(returnstream);
oa << data;
// create the result
FragmentResult::ptr ptr( new FragmentResult(getId(), returnstream.str()) );
if (data.desired_accuracy != 0.) {
ptr->exitflag = data.accuracy < data.desired_accuracy ? 0 : 1;
if (ptr->exitflag != 0)
ELOG(1, "Job #" << ptr->getId() << " failed to reach desired accuracy.");
} else {
LOG(3, "INFO: No precision returned from MPQC job, not checking.");
}
return ptr;
}