开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
develop
分支 (8)
标签 (98)
develop
dashboard
copilot/fix-test-github-actions-job
feature/openmp-hsolver
LTS
feat/tests-17-ds-dftu
ZhouXY-KML
feat/dftu-pw-port-v2
v3.11.0-beta5
v3.11.0-beta4
v3.11.0-beta.3
v3.11.0-beta.2
3.11.0-beta.1
v3.9.0.27
v3.9.0.26
v3.9.0.25
v3.9.0.24
v3.9.0.23
v3.9.0.22
v3.9.0.21
v3.9.0.20
v3.9.0.19
v3.10.1
v3.9.0.18
v3.9.0.17
v3.9.0.16
v3.9.0.15
v3.9.0.14
develop
分支 (8)
标签 (98)
develop
dashboard
copilot/fix-test-github-actions-job
feature/openmp-hsolver
LTS
feat/tests-17-ds-dftu
ZhouXY-KML
feat/dftu-pw-port-v2
v3.11.0-beta5
v3.11.0-beta4
v3.11.0-beta.3
v3.11.0-beta.2
3.11.0-beta.1
v3.9.0.27
v3.9.0.26
v3.9.0.25
v3.9.0.24
v3.9.0.23
v3.9.0.22
v3.9.0.21
v3.9.0.20
v3.9.0.19
v3.10.1
v3.9.0.18
v3.9.0.17
v3.9.0.16
v3.9.0.15
v3.9.0.14
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
develop
分支 (8)
标签 (98)
develop
dashboard
copilot/fix-test-github-actions-job
feature/openmp-hsolver
LTS
feat/tests-17-ds-dftu
ZhouXY-KML
feat/dftu-pw-port-v2
v3.11.0-beta5
v3.11.0-beta4
v3.11.0-beta.3
v3.11.0-beta.2
3.11.0-beta.1
v3.9.0.27
v3.9.0.26
v3.9.0.25
v3.9.0.24
v3.9.0.23
v3.9.0.22
v3.9.0.21
v3.9.0.20
v3.9.0.19
v3.10.1
v3.9.0.18
v3.9.0.17
v3.9.0.16
v3.9.0.15
v3.9.0.14
driver.cpp 7.58 KB
一键复制 编辑 原始数据 按行查看 历史
#include "source_main/driver.h"
#include "source_base/global_file.h"
#include "source_base/memory_recorder.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_base/version.h"
#include "source_base/parallel_global.h"
#ifdef __DSP
#include "source_base/module_device/memory_op.h"
#include "source_base/module_external/blas_connector.h"
#endif
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 << " "
" "
<< std::endl;
GlobalV::ofs_running << " ABACUS " << version << std::endl << std::endl;
GlobalV::ofs_running << " Atomic-orbital Based Ab-initio "
"Computation at UStc "
<< std::endl
<< std::endl;
GlobalV::ofs_running << " Website: http://abacus.ustc.edu.cn/ "
" "
<< std::endl;
GlobalV::ofs_running << " Documentation: https://abacus.deepmodeling.com/ "
" "
<< std::endl;
GlobalV::ofs_running << " Repository: "
"https://github.com/abacusmodeling/abacus-develop "
<< std::endl;
GlobalV::ofs_running << " "
"https://github.com/deepmodeling/abacus-develop "
<< std::endl;
GlobalV::ofs_running << " Commit: " << commit << std::endl << std::endl;
GlobalV::ofs_running << std::setiosflags(std::ios::right);
#ifndef __MPI
GlobalV::ofs_running << " This is SERIES version." << std::endl;
#endif
GlobalV::ofs_running << " Start Time is " << ctime(&time_now);
GlobalV::ofs_running << " "
" "
<< std::endl;
GlobalV::ofs_running << " -------------------------------------------------"
"-----------------------------------"
<< std::endl;
GlobalV::ofs_running << std::setiosflags(std::ios::left);
std::cout << std::setiosflags(std::ios::left);
GlobalV::ofs_running << "\n READING GENERAL INFORMATION" << std::endl;
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "global_out_dir", PARAM.globalv.global_out_dir);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "global_in_card", PARAM.globalv.global_in_card);
}
void Driver::reading()
{
ModuleBase::TITLE("Driver", "reading");
ModuleBase::timer::start("Driver", "reading");
// temperarily
GlobalV::MY_RANK = PARAM.globalv.myrank;
GlobalV::NPROC = PARAM.globalv.nproc;
// (1) read the input file
ModuleIO::ReadInput input(PARAM.globalv.myrank);
input.read_parameters(PARAM, PARAM.globalv.global_in_card);
ModuleBase::set_quit_out_dir(PARAM.globalv.global_out_dir);
ModuleBase::set_quit_calculation(PARAM.inp.calculation);
#if defined(__CUDA) && defined(__USE_NVTX)
ModuleBase::timer::set_nvtx_enabled(PARAM.inp.timer_enable_nvtx);
#endif
#ifdef __DSP
if (PARAM.inp.dsp_count <= 0)
{
ModuleBase::WARNING_QUIT("driver", "dsp_count must be > 0");
}
base_device::memory::set_dsp_cluster_id(GlobalV::MY_RANK % PARAM.inp.dsp_count);
BlasConnector::set_dsp_cluster_id(GlobalV::MY_RANK % PARAM.inp.dsp_count);
#endif
// (2) create the output directory, running_*.log and print info
input.create_directory(PARAM);
this->print_start_info();
// (3) write the input file
std::stringstream ss1;
ss1 << PARAM.globalv.global_out_dir << PARAM.globalv.global_in_card << ".info";
input.write_parameters(PARAM, ss1.str());
// (*temp*) copy the variables from INPUT to each class
Input_Conv::Convert();
// (4) define the 'DIAGONALIZATION' world in MPI
Parallel_Global::split_diag_world(PARAM.inp.diago_proc,
GlobalV::NPROC,
GlobalV::MY_RANK,
GlobalV::DRANK,
GlobalV::DSIZE,
GlobalV::DCOLOR);
Parallel_Global::split_grid_world(PARAM.inp.diago_proc,
GlobalV::NPROC,
GlobalV::MY_RANK,
GlobalV::GRANK,
GlobalV::GSIZE);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "DRANK", GlobalV::DRANK + 1);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "DSIZE", GlobalV::DSIZE);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "DCOLOR", GlobalV::DCOLOR + 1);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "GRANK", GlobalV::GRANK + 1);
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "GSIZE", GlobalV::GSIZE);
#ifdef __MPI
// (5) divide the GlobalV::NPROC processors into GlobalV::KPAR for k-points
// parallelization.
Parallel_Global::init_pools(GlobalV::NPROC,
GlobalV::MY_RANK,
PARAM.inp.bndpar,
GlobalV::KPAR,
GlobalV::NPROC_IN_BNDGROUP,
GlobalV::RANK_IN_BPGROUP,
GlobalV::MY_BNDGROUP,
GlobalV::NPROC_IN_POOL,
GlobalV::RANK_IN_POOL,
GlobalV::MY_POOL);
#endif
ModuleBase::timer::end("Driver", "reading");
}
void Driver::atomic_world()
{
ModuleBase::TITLE("Driver", "atomic_world");
ModuleBase::timer::start("Driver", "atomic_world");
// reading information
this->reading();
// where the actual stuff is done
this->driver_run();
ModuleBase::timer::end("Driver", "atomic_world");
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

An electronic structure software based on either plane wave basis or numerical atomic orbitals. (https://github.com/deepmodeling/abacus-develop)
取消

发行版 (40)

全部

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/deepmodeling/abacus-develop.git
git@gitee.com:deepmodeling/abacus-develop.git
deepmodeling
abacus-develop
abacus-develop
develop
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /