-
Notifications
You must be signed in to change notification settings - Fork 234
Add fixed-cell i-PI socket driver #7609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
5225369
e0f70ca
fe2c2a3
3635341
c86281f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,26 +59,33 @@ void Driver::driver_run() | |
| unitcell::check_atomic_stru(ucell, PARAM.inp.min_dist_coef); | ||
|
|
||
| //! 2: initialize the ESolver (depends on a set-up ucell after `setup_cell`) | ||
| Input_para socket_esolver_inp = PARAM.inp; | ||
| const bool socket_mode = (socket_esolver_inp.calculation == "socket"); | ||
| if (socket_mode) | ||
| { | ||
| socket_esolver_inp.calculation = "scf"; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the PR, but here it seems not appropriate to set the calculation as 'socket' first and then change it to 'scf', it may better to design another variable other than calculation |
||
| } | ||
| const Input_para& esolver_inp = socket_mode ? socket_esolver_inp : PARAM.inp; | ||
|
|
||
| this->init_hardware(); | ||
|
|
||
| ModuleESolver::ESolver* p_esolver = ModuleESolver::init_esolver(PARAM.inp, ucell); | ||
| ModuleESolver::ESolver* p_esolver = ModuleESolver::init_esolver(esolver_inp, ucell); | ||
|
|
||
| //! 3: initialize Esolver and fill json-structure | ||
| p_esolver->before_all_runners(ucell, PARAM.inp); | ||
| p_esolver->before_all_runners(ucell, esolver_inp); | ||
|
|
||
| // this Json part should be moved to before_all_runners, mohan 2024-05-12 | ||
| #ifdef __RAPIDJSON | ||
| Json::gen_stru_wrapper(&ucell); | ||
| #endif | ||
|
|
||
| const std::string cal = PARAM.inp.calculation; | ||
|
|
||
| //! 4: different types of calculations | ||
| const std::string cal = PARAM.inp.calculation; | ||
| if (cal == "md") | ||
| { | ||
| Run_MD::md_line(ucell, p_esolver, PARAM); | ||
| } | ||
| else if (cal == "scf" || cal == "relax" || cal == "cell-relax" || cal == "nscf") | ||
| else if (cal == "scf" || cal == "relax" || cal == "cell-relax" || cal == "nscf" || cal == "socket") | ||
| { | ||
| Relax_Driver rl_driver; | ||
| rl_driver.relax_driver(p_esolver, ucell, PARAM.inp, GlobalV::ofs_running); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ add_library( | |
| relax | ||
| OBJECT | ||
| relax_data.cpp | ||
| ipi_socket.cpp | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems better to name the file name as socket_ipi.cpp, consistent with the socket_driver.cpp |
||
| socket_driver.cpp | ||
| cg_base.cpp | ||
| relax_driver.cpp | ||
| relax_sync.cpp | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have an example to demonstrate how to use this feature?