Ranking query

Ranking query

Assume you have a very long input file with no syntax errors.

It is clear for this case that the time to completion is what is important.

Assume you have a very long input file with no syntax errors except at the very end of the file. (syntax test program).

What is more important? Time to completion with error message or correctly identifying line and statement in program?

Note, these require different strategies for different requirements.

If the requirements for the interpreter are for checking syntax errors then time to find and report error is important.
If the requirements for the interpreter are for running presumably error free code then time to complete error free code is much more important than time to detect and report syntax errors.

Jim Dempsey

www.quickthreadprogramming.com
publicaciones de 7 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

The second case isn't much different from the first, since you have to still produce all output up to the syntax error.
e.g..... 1 million lines of codevar j = 10;
and... same 1 million lines of codevar j = 10a; // errorIf the requirement were just produce the syntax error and no output, then I see finding the right comprimise would be important, but that's not the case here, as output is required in both cases.

IMHO the correct interpretation is "produce the same result as a serial intpreter that analyzes and executes one statement at a time". So in your example there might be a million output lines before the syntax error output and program stop. It would be incorrect to output more or less than the equivalent serial program.

>>The second case isn't much different from the first, since you have to still produce all output up to the syntax error

Not necessarily true. The interpreter can keep track (or compute) the character position within the input file. No need to count lines and statements on lineunless there is an error. On error condition output data is correct up to error, but you currently are missing the line number and statement number on that line information. No problem, rewind the file then count lines and statements on line up to error position. Although line counting as you compute might not seem like a lot of overhead it could consume an additional pass on each input buffer.

Jim Dempsey

www.quickthreadprogramming.com

Quoting john_e_lilley
IMHO the correct interpretation is "produce the same result as a serial intpreter that analyzes and executes one statement at a time". So in your example there might be a million output lines before the syntax error output and program stop. It would be incorrect to output more or less than the equivalent serial program.

I agree, I was hoping the judges would make a statment as clear as this, stating that parallel execution must produce the same output as the sequential case. It makes a lot of questions disappear, and testing much easier.

Output an error message needs to be accurate. The results output can not do request.

写字楼里写字间,写字间里程序员
程序人员写程序,又拿程序换酒钱
酒醒只在网上坐,酒醉还来网下眠
酒醉酒醒日复日,网上网下年复年

John,That's exactly the idea, to produce the same result as a serial interpreter but with a better throughput.In fact, it's the same that happens when you optimize existing serial code to take advantage of multiple cores. Imagine a black box with inputs and outputs. The parallelized black box must run in parallel but the output should be the same than the serial black box.The following text appears in the problem description:"Output Description: The output to be generated by the application is a line for each interpreted output function that appears in the input. The output should contain the results of the calls to output in the same order that they appear in the input. Correctness is essential but high-throughput and scalability as the number of cores increase is also important. Output for the application will be stored in the text file specified as the second parameter on the command line. If there is a syntax error, the previously explained message should be written to the output file."The ouput should be that same output generated by a sequential execution.Hope it helps.Cheers,Gaston

Gastón C. Hillar

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya