Skip to content

Erroneus shell commands after extensive ts.iterate #366

Open
@n01r

Description

@n01r

Hi, I noticed that when I would run a ts.iterate over many output iterations on OLCF's Jupyter Service and afterwards I would try to simply create a directory with a magic command from a Jupyter cell (! mkdir <path/to/dir>) the directory would get created but I would receive an error that reads:
ValueError: filedescriptor out of range in select()

openpmd-viewer version: 1.6.0

To reproduce:

  • run WarpX sim and write openPMD output
  • read in large time series (e.g. 500 iterations)
  • execute in separate cells:
    ts = LpaDiagnostics('diags/diag_btd/')
    ex, ey = ts.iterate( ts.get_emittance ) # Emittance as a function of time
    g, _ = ts.iterate( ts.get_energy_spread, property='gamma' ) # Mean energy as a function of time
    ! mkdir -p "analysis"
    
full error message
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[6], line 1
----> 1 get_ipython().system(' mkdir -p "analysis"')

File /gpfs/alpine/proj-shared/aph114/mgarten/environments/conda-warpx/lib/python3.10/site-packages/ipykernel/zmqshell.py:649, in ZMQInteractiveShell.system_piped(self, cmd)
    647         self.user_ns["_exit_code"] = system(cmd)
    648 else:
--> 649     self.user_ns["_exit_code"] = system(self.var_expand(cmd, depth=1))

File /gpfs/alpine/proj-shared/aph114/mgarten/environments/conda-warpx/lib/python3.10/site-packages/IPython/utils/_process_posix.py:153, in ProcessHandler.system(self, cmd)
    149 flush = sys.stdout.flush
    150 while True:
    151     # res is the index of the pattern that caused the match, so we
    152     # know whether we've finished (if we matched EOF) or not
--> 153     res_idx = child.expect_list(patterns, self.read_timeout)
    154     print(child.before[out_size:].decode(enc, 'replace'), end='')
    155     flush()

File /gpfs/alpine/proj-shared/aph114/mgarten/environments/conda-warpx/lib/python3.10/site-packages/pexpect/spawnbase.py:372, in SpawnBase.expect_list(self, pattern_list, timeout, searchwindowsize, async_, **kw)
    370     return expect_async(exp, timeout)
    371 else:
--> 372     return exp.expect_loop(timeout)

File /gpfs/alpine/proj-shared/aph114/mgarten/environments/conda-warpx/lib/python3.10/site-packages/pexpect/expect.py:169, in Expecter.expect_loop(self, timeout)
    167     return self.timeout()
    168 # Still have time left, so read more data
--> 169 incoming = spawn.read_nonblocking(spawn.maxread, timeout)
    170 if self.spawn.delayafterread is not None:
    171     time.sleep(self.spawn.delayafterread)

File /gpfs/alpine/proj-shared/aph114/mgarten/environments/conda-warpx/lib/python3.10/site-packages/pexpect/pty_spawn.py:458, in spawn.read_nonblocking(self, size, timeout)
    450         return select_ignore_interrupts([self.child_fd], [], [], timeout)[0]
    452 # If there is data available to read right now, read as much as
    453 # we can. We do this to increase performance if there are a lot
    454 # of bytes to be read. This also avoids calling isalive() too
    455 # often. See also:
    456 # * https://github.com/pexpect/pexpect/pull/304
    457 # * http://trac.sagemath.org/ticket/10295
--> 458 if select(0):
    459     try:
    460         incoming = super(spawn, self).read_nonblocking(size)

File /gpfs/alpine/proj-shared/aph114/mgarten/environments/conda-warpx/lib/python3.10/site-packages/pexpect/pty_spawn.py:450, in spawn.read_nonblocking.<locals>.select(timeout)
    449 def select(timeout):
--> 450     return select_ignore_interrupts([self.child_fd], [], [], timeout)[0]

File /gpfs/alpine/proj-shared/aph114/mgarten/environments/conda-warpx/lib/python3.10/site-packages/pexpect/utils.py:143, in select_ignore_interrupts(iwtd, owtd, ewtd, timeout)
    141 while True:
    142     try:
--> 143         return select.select(iwtd, owtd, ewtd, timeout)
    144     except InterruptedError:
    145         err = sys.exc_info()[1]

ValueError: filedescriptor out of range in select()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions