Skip to content

Commit e67e94f

Browse files
authored
Merge pull request #392 from amcadmus/master
Fix lammps related bugs
2 parents 2644cca + 5597ea2 commit e67e94f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

source/lib/src/NNPInter.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ void
190190
NNPInter::
191191
init (const string & model, const int & gpu_rank)
192192
{
193-
assert (!inited);
193+
if (inited){
194+
std::cerr << "WARNING: deepmd-kit should not be initialized twice, do nothing at the second call of initializer" << std::endl;
195+
return ;
196+
}
194197
SessionOptions options;
195198
options.config.set_inter_op_parallelism_threads(num_inter_nthreads);
196199
options.config.set_intra_op_parallelism_threads(num_intra_nthreads);
@@ -497,7 +500,10 @@ void
497500
NNPInterModelDevi::
498501
init (const vector<string> & models, const int & gpu_rank)
499502
{
500-
assert (!inited);
503+
if (inited){
504+
std::cerr << "WARNING: deepmd-kit should not be initialized twice, do nothing at the second call of initializer" << std::endl;
505+
return ;
506+
}
501507
numb_models = models.size();
502508
sessions.resize(numb_models);
503509
graph_defs.resize(numb_models);

source/lmp/pair_nnp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ PairNNP::PairNNP(LAMMPS *lmp)
206206
if (strcmp(update->unit_style,"metal") != 0) {
207207
error->all(FLERR,"Pair deepmd requires metal unit, please set it by \"units metal\"");
208208
}
209+
restartinfo = 0;
209210
pppmflag = 1;
210211
respa_enable = 0;
211212
writedata = 0;

0 commit comments

Comments
 (0)