[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/AroundPeking/abacus-develop/develop/source/source_main/driver.cpp [Back]  [Original]

#include "source_main/driver.h"

#include "source_base/global_file.h"
#include "source_base/memory.h"
#include "source_base/timer.h"
#include "source_esolver/esolver.h"
#include "source_io/module_output/cal_test.h"
#include "source_io/module_parameter/input_conv.h"
#include "source_io/module_json/para_json.h"
#include "source_io/module_output/print_info.h"
#include "source_io/module_parameter/read_input.h"
#include "source_io/module_parameter/parameter.h"
#include "source_main/version.h"
#include "source_base/parallel_global.h"

Driver::Driver()
{
}

Driver::~Driver()
{
}

void Driver::init()
{
    // 1) Let's start by printing a title.
    ModuleBase::TITLE("Driver", "ABACUS_begins");

    // 2) Print the current time, since it may run a long time.
    time_t time_start = std::time(nullptr);
    ModuleBase::timer::start();

    // 3) Welcome to the atomic world! Let's do some fancy stuff here.
    this->atomic_world();

    // 4) All timers recorders are printed.
    ModuleBase::timer::finish(GlobalV::ofs_running);

    // 5) All memory recorders are printed.
    ModuleBase::Memory::print_all(GlobalV::ofs_running);

    // 6) Print the final time, hopefully it will not cost too long. 
    time_t time_finish = std::time(nullptr);
    ModuleIO::print_time(time_start, time_finish);

    // 7) Clean up: close all of the running logs
    ModuleBase::Global_File::close_all_log(GlobalV::MY_RANK, PARAM.inp.out_alllog,PARAM.inp.calculation);

}

void Driver::print_start_info()
{
    ModuleBase::TITLE("Driver", "print_start_info");
#ifdef VERSION
    const char* version = VERSION;
#else
    const char* version = "unknown";
#endif
#ifdef COMMIT_INFO
#include "commit.h"
    const char* commit = COMMIT;
#else
    const char* commit = "unknown";
#endif
    time_t time_now = time(nullptr);

    PARAM.set_start_time(time_now);
    GlobalV::ofs_running 

Web Proxy Viewer  |  New URL  |  Original Page