You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@systemml.apache.org by "Nakul Jindal (JIRA)" <ji...@apache.org> on 2016/09/14 21:14:20 UTC

[jira] [Updated] (SYSTEMML-920) Validate if a scalar is being indexed in DMLTranslator

     [ https://issues.apache.org/jira/browse/SYSTEMML-920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nakul Jindal updated SYSTEMML-920:
----------------------------------
    Description: 
When this script is run against master :
{code}
B = "hello"
C = B[1,1]
print(C)
{code}

The following error is printed:
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.

```
16/09/12 11:15:35 INFO api.DMLScript: END DML run 09/12/2016 11:15:35
16/09/12 11:15:35 ERROR api.DMLScript: Failed to execute DML script.
org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:184)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Exception in thread "main" org.apache.sysml.api.DMLException: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:378)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	... 1 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:184)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Failed to run SystemML. Exit code: 1
```
The error being printed out is :  **Variable 'hello' does not exist in the symbol table.** 
Whereas the core issue is of trying to index a scalar.


Here is another more interesting example:
```r
A = matrix(1, rows=1, cols=10)
B = sum(A %*% t(A))
C = B[1,1]
print(C)
```

And the error message:
```
16/09/12 11:23:30 ERROR api.DMLScript: Failed to execute DML script.
org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable '_Var3' is not a frame.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:186)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Exception in thread "main" org.apache.sysml.api.DMLException: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:378)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	... 1 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable '_Var3' is not a frame.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:186)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Failed to run SystemML. Exit code: 1
```

The error message is : **Variable '_Var3' is not a frame.**

In both cases, `DMLTranslator` is not doing the appropriate error checking.

[PR 234](https://github.com/apache/incubator-systemml/pull/234) attempts to put in a check at the runtime. But the error needs to caught higher up in the stack.


  was:
When this script is run against master :
```r
B = "hello"
C = B[1,1]
print(C)
```

The following error is printed:
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.

```
16/09/12 11:15:35 INFO api.DMLScript: END DML run 09/12/2016 11:15:35
16/09/12 11:15:35 ERROR api.DMLScript: Failed to execute DML script.
org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:184)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Exception in thread "main" org.apache.sysml.api.DMLException: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:378)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	... 1 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:184)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Failed to run SystemML. Exit code: 1
```
The error being printed out is :  **Variable 'hello' does not exist in the symbol table.** 
Whereas the core issue is of trying to index a scalar.


Here is another more interesting example:
```r
A = matrix(1, rows=1, cols=10)
B = sum(A %*% t(A))
C = B[1,1]
print(C)
```

And the error message:
```
16/09/12 11:23:30 ERROR api.DMLScript: Failed to execute DML script.
org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable '_Var3' is not a frame.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:186)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Exception in thread "main" org.apache.sysml.api.DMLException: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:378)
       	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
Caused by: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
       	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
       	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
       	... 1 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
       	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
       	... 3 more
Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable '_Var3' is not a frame.
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:186)
       	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
       	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
       	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
       	... 6 more
Failed to run SystemML. Exit code: 1
```

The error message is : **Variable '_Var3' is not a frame.**

In both cases, `DMLTranslator` is not doing the appropriate error checking.

[PR 234](https://github.com/apache/incubator-systemml/pull/234) attempts to put in a check at the runtime. But the error needs to caught higher up in the stack.



> Validate if a scalar is being indexed in DMLTranslator
> ------------------------------------------------------
>
>                 Key: SYSTEMML-920
>                 URL: https://issues.apache.org/jira/browse/SYSTEMML-920
>             Project: SystemML
>          Issue Type: Bug
>            Reporter: Nakul Jindal
>            Priority: Minor
>
> When this script is run against master :
> {code}
> B = "hello"
> C = B[1,1]
> print(C)
> {code}
> The following error is printed:
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.
> ```
> 16/09/12 11:15:35 INFO api.DMLScript: END DML run 09/12/2016 11:15:35
> 16/09/12 11:15:35 ERROR api.DMLScript: Failed to execute DML script.
> org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
>        	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
>        	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
>        	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
>        	... 3 more
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:184)
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
>        	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
>        	... 6 more
> Exception in thread "main" org.apache.sysml.api.DMLException: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
>        	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:378)
>        	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
>        	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
>        	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
>        	... 1 more
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 3 -- Error evaluating instruction: CP°rangeReIndex°hello·SCALAR·STRING·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var1·SCALAR·STRING
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
>        	... 3 more
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable 'hello' does not exist in the symbol table.
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:184)
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
>        	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
>        	... 6 more
> Failed to run SystemML. Exit code: 1
> ```
> The error being printed out is :  **Variable 'hello' does not exist in the symbol table.** 
> Whereas the core issue is of trying to index a scalar.
> Here is another more interesting example:
> ```r
> A = matrix(1, rows=1, cols=10)
> B = sum(A %*% t(A))
> C = B[1,1]
> print(C)
> ```
> And the error message:
> ```
> 16/09/12 11:23:30 ERROR api.DMLScript: Failed to execute DML script.
> org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
>        	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
>        	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
>        	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
>        	... 3 more
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable '_Var3' is not a frame.
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:186)
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
>        	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
>        	... 6 more
> Exception in thread "main" org.apache.sysml.api.DMLException: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
>        	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:378)
>        	at org.apache.sysml.api.DMLScript.main(DMLScript.java:199)
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:152)
>        	at org.apache.sysml.api.DMLScript.execute(DMLScript.java:698)
>        	at org.apache.sysml.api.DMLScript.executeScript(DMLScript.java:364)
>        	... 1 more
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: ERROR: Runtime error in program block generated from statement block between lines 1 and 4 -- Error evaluating instruction: CP°rangeReIndex°_Var3·SCALAR·DOUBLE·false°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°1·SCALAR·INT·true°_Var4·SCALAR·DOUBLE
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:335)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeInstructions(ProgramBlock.java:224)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.execute(ProgramBlock.java:168)
>        	at org.apache.sysml.runtime.controlprogram.Program.execute(Program.java:145)
>        	... 3 more
> Caused by: org.apache.sysml.runtime.DMLRuntimeException: Variable '_Var3' is not a frame.
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameObject(ExecutionContext.java:186)
>        	at org.apache.sysml.runtime.controlprogram.context.ExecutionContext.getFrameInput(ExecutionContext.java:351)
>        	at org.apache.sysml.runtime.instructions.cp.FrameIndexingCPInstruction.processInstruction(FrameIndexingCPInstruction.java:51)
>        	at org.apache.sysml.runtime.controlprogram.ProgramBlock.executeSingleInstruction(ProgramBlock.java:305)
>        	... 6 more
> Failed to run SystemML. Exit code: 1
> ```
> The error message is : **Variable '_Var3' is not a frame.**
> In both cases, `DMLTranslator` is not doing the appropriate error checking.
> [PR 234](https://github.com/apache/incubator-systemml/pull/234) attempts to put in a check at the runtime. But the error needs to caught higher up in the stack.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)