diff --git a/src/main_gpumd/add_force.cu b/src/main_gpumd/add_force.cu index cbf1a01b0..03f942fe5 100644 --- a/src/main_gpumd/add_force.cu +++ b/src/main_gpumd/add_force.cu @@ -55,7 +55,7 @@ void Add_Force::compute(const int step, const std::vector& groups, Atom& const int num_atoms_total = atom.force_per_atom.size() / 3; const int group_size = groups[grouping_method_[call]].cpu_size[group_id_[call]]; const int group_size_sum = groups[grouping_method_[call]].cpu_size_sum[group_id_[call]]; - add_force<<<(atom.number_of_atoms - 1) / 64 + 1, 64>>>( + add_force<<<(group_size - 1) / 64 + 1, 64>>>( group_size, group_size_sum, groups[grouping_method_[call]].contents.data(), @@ -154,7 +154,9 @@ void Add_Force::parse(const char** param, int num_param, const std::vector 10) { + PRINT_INPUT_ERROR("add_force cannot be used more than 10 times in one run."); + } } void Add_Force::finalize() diff --git a/src/main_gpumd/run.cu b/src/main_gpumd/run.cu index 1928a023a..aea3b6c8b 100644 --- a/src/main_gpumd/run.cu +++ b/src/main_gpumd/run.cu @@ -466,7 +466,7 @@ void Run::parse_one_keyword(std::vector& tokens) electron_stop.parse(param, num_param, atom.number_of_atoms, number_of_types); } else if (strcmp(param[0], "add_force") == 0) { add_force.parse(param, num_param, group); - }else if (strcmp(param[0], "mc") == 0) { + } else if (strcmp(param[0], "mc") == 0) { mc.parse_mc(param, num_param, group, atom); } else if (strcmp(param[0], "dftd3") == 0) { // nothing here; will be handled elsewhere