mirror of
https://github.com/Findus23/rebound-collisions.git
synced 2024-09-19 15:53:48 +02:00
better process title
This commit is contained in:
parent
eaefc69be0
commit
e2e1c54e0f
2 changed files with 7 additions and 2 deletions
|
@ -36,9 +36,13 @@ def process_friendlyness(fn: Path) -> None:
|
|||
if socket.gethostname() == "standpc":
|
||||
# only handle other computers specially
|
||||
return
|
||||
setproctitle(f"[{fn.stem}] [rebound-watersim] read /home/winklerl23/sim-info.txt for more information")
|
||||
set_process_title(fn, 0, 0)
|
||||
os.nice(5)
|
||||
|
||||
|
||||
def set_process_title(fn: Path, progress: float, bodies: int) -> None:
|
||||
setproctitle(f"watersim [{fn.stem}] {progress * 100:.2f}% finished, {bodies} bodies")
|
||||
|
||||
|
||||
def is_ci() -> bool:
|
||||
return "CI" in os.environ
|
||||
|
|
|
@ -15,7 +15,7 @@ from scipy.constants import astronomical_unit, mega, year
|
|||
from extradata import ExtraData, ParticleData
|
||||
from merge import merge_particles
|
||||
from utils import unique_hash, filename_from_argv, innermost_period, total_momentum, process_friendlyness, total_mass, \
|
||||
third_kepler_law, solar_radius, git_hash, check_heartbeat_needs_recompile, PlanetaryRadius
|
||||
third_kepler_law, solar_radius, git_hash, check_heartbeat_needs_recompile, PlanetaryRadius, set_process_title
|
||||
|
||||
MIN_TIMESTEP_PER_ORBIT = 20
|
||||
|
||||
|
@ -213,6 +213,7 @@ def main(fn: Path, testrun=False):
|
|||
while t <= tmax:
|
||||
print()
|
||||
print(f"{t / tmax * 100:.2f}%")
|
||||
set_process_title(fn, t / tmax, sim.N)
|
||||
try:
|
||||
print(f"integrating until {t}")
|
||||
sim.integrate(t, exact_finish_time=0)
|
||||
|
|
Loading…
Reference in a new issue