JeffersonLab / qphix

QCD for Intel Xeon Phi and Xeon processors
http://jeffersonlab.github.io/qphix/
Other
13 stars 11 forks source link

“-geom” argument parsing was wrong #53

Closed martin-ueding closed 7 years ago

martin-ueding commented 7 years ago

In the master branch, you find the following in most of the timing and testing code:

    else if (string(argv[i]).compare("-geom") == 0 ) {
      qmp_geometry[0] = atoi(argv[i+1]);
      qmp_geometry[1] = atoi(argv[i+2]);
      qmp_geometry[2] = atoi(argv[i+3]);
      qmp_geometry[3] = atoi(argv[i+4]);
      i+=4;  
    }

The issue is that i is not advanced sufficiently, it should be i += 5 in there. This means that if the -geom argument was not the last one, the next argument that the parser would look at would be the last digit. That is no problem in master because unknown arguments are just skipped.

In the devel (until now), unknown arguments are not silently ignored but are an error. This mean errors like “argument “2” could not be parsed”. If you experienced that, this is where it came from. This is now fixed.