dca: a bare -- on the command line makes the solver read --MU as a parameter file

Open Beginner friendly
#479 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@skilledwolf is already working on this.

Since Dec 1, 2026.

  • #516 by @skilledwolf — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
cli

Research direction

The command line for the external solver is assembled in ImpuritySolver in src/apps/dmft/dca/libsolver/impurity_solver.h; read that loop first, then check how args_-style arguments reach it from dca after the parameter file. The fix given in the issue inserts the loop's --MU before a bare -- and stops stripping --MU= arguments after it. Done means the new case in impurity_solver_test with arguments {"--U=2", "--", "extra.ini"} produces params.ini --U=2 --MU=0.3 -- extra.ini, with the existing test still passing.

Written by the indexing model from the issue text.

Description

P2

Found while reviewing #464 (fix for #463), at 767720107.

Problem

alps::params reads every argument after a bare -- as another parameter file. With #464, dca passes its arguments after the parameter file on to the solver and then adds the loop's --MU, so after a -- the solver reads --MU=<mu> as a file name and fails:

$ dca params.ini -- extra.ini
Calling external solver as: .../dca_free_solver 'params.ini' '--' 'extra.ini' --MU=0.3
iniparser: cannot open --MU=0.3
free_solver: Cannot read INI file --MU=0.3
System error code 256 encountered when executing command:

The filter that drops a --MU= override also drops a file named --MU=... after the --.

Fix

In ImpuritySolver (src/apps/dmft/dca/libsolver/impurity_solver.h), write the loop's --MU before a --, and stop filtering after it:

    command << launch_command_ << " " << shell_quote(param_file_name_);
    bool files_only = false;
    for (const std::string &argument : arguments_) {
      if (!files_only && argument == "--") {
        command << " --MU=" << exact(mu_);
        files_only = true;
      } else if (!files_only && argument.compare(0, 5, "--MU=") == 0) {
        continue;
      }
      command << " " << shell_quote(argument);
    }
    if (!files_only) command << " --MU=" << exact(mu_);

Test

impurity_solver_test: the arguments {"--U=2", "--", "extra.ini"} reach the solver as params.ini --U=2 --MU=0.3 -- extra.ini.

Dominant language
C++
Stars
32
Forks
10
Avg merge
3d 23h
Merged PRs (30d)
109

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ALPSim/ALPS

All issues in ALPSim/ALPS

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.