Farama-Foundation / SuperSuit

A collection of wrappers for Gymnasium and PettingZoo environments (being merged into gymnasium.wrappers and pettingzoo.wrappers
Other
441 stars 56 forks source link

Minor: Using `concat_vec_envs_v1`, with num_cpus > 1 results in unnessary print outputs when calling `env.close()` #244

Closed KaleabTessera closed 4 months ago

KaleabTessera commented 6 months ago

Using the vectorised envs (concat_vec_envs_v1), with num_cpus >1 causes a redundant printout when calling env.close.

Code:

from pettingzoo.mpe import simple_spread_v3
import supersuit as ss

env = simple_spread_v3.parallel_env()
env = ss.pettingzoo_env_to_vec_env_v1(env)
env = ss.concat_vec_envs_v1(env, 10, num_cpus=10, base_class="gymnasium")
obs, info = env.reset()

env.close()

Output:

XIO:  fatal IO error 0 (Success) on X server ":0"
      after 89 requests (89 known processed) with 0 events remaining.
XIO:  fatal IO error 0 (Success) on X server ":0"
      after 89 requests (89 known processed) with 0 events remaining.
XIO:  fatal IO error 0 (Success) on X server ":0"
      after 89 requests (89 known processed) with 0 events remaining.
XIO:  fatal IO error 0 (Success) on X server ":0"
...

This isn't really a bug, just removes an annoying print out. @elliottower You also pointed this issue out a while back here - https://github.com/Farama-Foundation/PettingZoo/pull/1017#issuecomment-1626421217.

elliottower commented 4 months ago

Sounds good thanks for this