File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,10 @@ void
190190NNPInter::
191191init (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
497500NNPInterModelDevi::
498501init (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);
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments