First time here? Checkout the FAQ!
x
0 votes
ago by (560 points)

Hi,

I just installed the latest openCARP version from source on a HPC, after the installation was successful, I tested a few example code, the 02_EP_tissue/02_stimulation example can run smoothly without any problem, but later when I test the 21_Reentry example I started to have problems with tuneCV. It seems to only have generated a empty folder "imp_Courtemanche_vel_0.3_dx_400.0" and not generating the needed 'imp_Courtemanche_vel_0.3_dx_400.0_It_0/init_acts_lats-thresh.igb' file and folder, so later I got a no file exist error, then lead tuneCV returned non-zero exit status 1 error. I did not made any modification to the example code, just used "python3 run.py --np 2 --protocol PSD " to run it.

Any ideas on why is this problem happening? Here is the error message I received:

Traceback (most recent call last):

  File "/home/openCARP/external/carputils/bin/tuneCV", line 221, in <module>

    run()

  File "/home/openCARP/external/carputils/carputils/tools.py", line 570, in wrapped

    ret = run(args, job)

          ^^^^^^^^^^^^^^

  File "/home/openCARP/external/carputils/bin/tuneCV", line 191, in run

    gi, ge, CV, gm, it, flg = to.iterateCV(job)

                              ^^^^^^^^^^^^^^^^^

  File "/home/openCARP/external/carputils/carputils/tuning.py", line 981, in iterateCV

    self.vel_ = self.measureCV(lats_file)

                ^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/openCARP/external/carputils/carputils/tuning.py", line 764, in measureCV

    igb_file = carpio.igb.IGBFile(actsFile, 'r')

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/openCARP/external/carputils/carputils/carpio/igb.py", line 58, in __init__

    self._fp = fopen(filename, mode)

               ^^^^^^^^^^^^^^^^^^^^^

FileNotFoundError: [Errno 2] No such file or directory: 'imp_Courtemanche_vel_0.3_dx_400.0_It_0/init_acts_lats-thresh.igb'

Traceback (most recent call last):

  File "/home/openCARP/external/experiments/examples/02_EP_tissue/21_reentry_induction/run.py", line 725, in <module>

    run()

  File "/home/openCARP/external/carputils/carputils/tools.py", line 570, in wrapped

    ret = run(args, job)

          ^^^^^^^^^^^^^^

  File "/home/openCARP/external/experiments/examples/02_EP_tissue/21_reentry_induction/run.py", line 466, in run

    converge_CV(args,job)

  File "/home/openCARP/external/experiments/examples/02_EP_tissue/21_reentry_induction/run.py", line 652, in converge_CV

    job.bash(cmd)

  File "/home/openCARP/external/carputils/carputils/job/job.py", line 248, in bash

    self.register(ShellCommand(cmd, message, *args, **kwargs), delayed )

  File "/home/openCARP/external/carputils/carputils/job/job.py", line 121, in register

    self._queue.pop(0).execute()

  File "/home/openCARP/external/carputils/carputils/job/command.py", line 191, in execute

    divertoutput.call(self._cmd, stdout=self._stdout, stderr=self._stderr)

  File "/home/openCARP/external/carputils/carputils/divertoutput.py", line 45, in wrapped

    return func(cmd, *args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/openCARP/external/carputils/carputils/divertoutput.py", line 149, in call

    raise subprocess.CalledProcessError(proc.returncode, cmd[0])

subprocess.CalledProcessError: Command '/home/openCARP/external/carputils/bin/tuneCV' returned non-zero exit status 1.

1 Answer

0 votes
ago by (1.9k points)

Thanks for reporting. I can reproduce this, it's a bug on our side.

What's happening:

Recently, we added a new parameter parser to openCARP https://opencarp.org/about/news/new-parameter-parser-supporting-modern-file-formats. This new parser is currently compared to the old one in each simulation, which now seems to clash for this example because there is a bug.

The PSD protocol asks openCARP to save the simulation state at t = 500 ms. openCARP derives the state filename from that time value, and right now two parts of the code disagree on how to write it: one produces 500.0, the other 500.

openCARP currently cross-checks these two against each other at startup as a safety measure. It spots the disagreement, refuses to start, and exits. Because the simulation never runs, vm.igb is never written, which is the FileNotFoundError you see at the end of the traceback. The Python error is just the downstream symptom; the real failure is the parameter check above it.

This only affects protocols that save state at a whole-number time, which is why PSD breaks while the other protocols are fine.

Workaround:

Tell openCARP to use the older parameter handling, which is unaffected:

OPENCARP_PARAM_FALLBACK=legacy python run.py --np 2 --protocol PSD

Results are unaffected. This only changes which of the two parameter code paths is used. The same thing can be done via the command line, but note the = sign is required, argparse rejects the space-separated form:

# works

python run.py --np 2 --protocol PSD --CARP-opts="--param-fallback=legacy"

# does NOT work

python run.py --np 2 --protocol PSD --CARP-opts "--param-fallback=legacy"

The environment variable is the simpler option.

Fix

We're fixing the underlying filename inconsistency; the workaround won't be needed after that.

Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...