diff --git a/purge-workflows.py b/purge-workflows.py new file mode 100755 index 0000000000..00ebf35fa8 --- /dev/null +++ b/purge-workflows.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +from yaml import load +import subprocess +try: + from yaml import CLoader as Loader +except ImportError: + from yaml import Loader + +runs = subprocess.check_output('gh api repos/lammps/lammps/actions/runs',shell=True) +data = load(runs,Loader=Loader) +while data['total_count'] > 3: + print('remaining: ', data['total_count']) + num=1 + for d in data['workflow_runs']: + print(num, d['id'],d['name'],d['run_number']) + num += 1 + if num > 4: + subprocess.call('gh api -X DELETE repos/lammps/lammps/actions/runs/' + str(d['id']), shell=True) + #print('gh api -X DELETE repos/lammps/lammps/actions/runs/' + str(d['id'])) + else: + print('skip') + runs = subprocess.check_output('gh api repos/lammps/lammps/actions/runs',shell=True) + data = load(runs,Loader=Loader) diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp index b56ae4f846..ba69d17718 100644 --- a/src/fix_dt_reset.cpp +++ b/src/fix_dt_reset.cpp @@ -195,7 +195,7 @@ void FixDtReset::end_of_step() update->dt_default = 0; if (respaflag) update->integrate->reset_dt(); if (force->pair) force->pair->reset_dt(); - for (int i = 0; i < modify->nfix; i++) modify->fix[i]->reset_dt(); + for (auto &ifix : modify->get_fix_list()) ifix->reset_dt(); output->reset_dt(); } diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp index 331d50631b..53e9258ce5 100644 --- a/src/fix_nve_limit.cpp +++ b/src/fix_nve_limit.cpp @@ -71,12 +71,9 @@ void FixNVELimit::init() // warn if using fix shake, which will lead to invalid constraint forces - for (int i = 0; i < modify->nfix; i++) - if (utils::strmatch(modify->fix[i]->style,"^shake") - || utils::strmatch(modify->fix[i]->style,"^rattle")) { - if (comm->me == 0) + if ((comm->me == 0) && ((modify->get_fix_by_style("^shake").size() > 0) || + (modify->get_fix_by_style("^rattle").size() > 0))) error->warning(FLERR,"Should not use fix nve/limit with fix shake or fix rattle"); - } } /* ---------------------------------------------------------------------- diff --git a/src/neighbor.cpp b/src/neighbor.cpp index c6eea7e2f1..63e1494acd 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -143,7 +143,6 @@ pairclass(nullptr), pairnames(nullptr), pairmasks(nullptr) cutneighghostsq = nullptr; cuttype = nullptr; cuttypesq = nullptr; - fixchecklist = nullptr; // pairwise neighbor lists and associated data structs @@ -242,7 +241,6 @@ Neighbor::~Neighbor() memory->destroy(cutneighghostsq); delete[] cuttype; delete[] cuttypesq; - delete[] fixchecklist; for (int i = 0; i < nlist; i++) delete lists[i]; for (int i = 0; i < nbin; i++) delete neigh_bin[i]; @@ -497,19 +495,15 @@ void Neighbor::init() if (cut_respa[0]-skin < 0) cut_middle_inside_sq = 0.0; } - // fixchecklist = other classes that can induce reneighboring in decide() - restart_check = 0; if (output->restart_flag) restart_check = 1; - delete[] fixchecklist; - fixchecklist = nullptr; - fixchecklist = new int[modify->nfix]; + // fixchecklist = other classes that can induce reneighboring in decide() + fixchecklist.clear(); fix_check = 0; - for (i = 0; i < modify->nfix; i++) - if (modify->fix[i]->force_reneighbor) - fixchecklist[fix_check++] = i; + for (auto &ifix : modify->get_fix_list()) + if (ifix->force_reneighbor) fixchecklist.push_back(ifix); must_check = 0; if (restart_check || fix_check) must_check = 1; @@ -2298,8 +2292,8 @@ int Neighbor::decide() if (must_check) { bigint n = update->ntimestep; if (restart_check && n == output->next_restart) return 1; - for (int i = 0; i < fix_check; i++) - if (n == modify->fix[fixchecklist[i]]->next_reneighbor) return 1; + for (auto &ifix : fixchecklist) + if (n == ifix->next_reneighbor) return 1; } ago++; diff --git a/src/neighbor.h b/src/neighbor.h index 9c51361aa8..d696445d61 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -187,7 +187,7 @@ class Neighbor : protected Pointers { int must_check; // 1 if must check other classes to reneigh int restart_check; // 1 if restart enabled, 0 if no int fix_check; // # of fixes that induce reneigh - int *fixchecklist; // which fixes to check + std::vectorfixchecklist; // which fixes to check double triggersq; // trigger = build when atom moves this dist