| Reply | « Previous Thread | Next Thread » |
|
Hi,
Ensymble is a great tool to convert python scripts into sis files. It worked well for us for one script. For a second script the sisx is created. However, during execution the program aborts with the error code "-2". According to this url "http://www.newlc.com/Symbian-OS-Error-Codes.html" -2 stands for KErrGeneral The following is the code... I suspect the lambda function to be problematic one. May be we need to include some headers files ? Please note the script is working correctly when launched from the python interpretor and doesn't execute after exported as sisx file using ensymble. Any sugggestions would be helpful. Code:
#!/usr/bin/env python
import os
import time
""" Matrix-vector multiplication """
# variables
z = 1000 # number of loop iterations
m, n = 200, 300
vec = range(1, n+1)
mat = [map(lambda x: i*n+x+1, range(n)) for i in range(m)]
def matmult6(m, v):
rows = len(m)
w = [0]*rows
irange = range(len(v))
sum = 0
for j in range(rows):
r = m[j]
for i in irange:
sum += r[i]*v[i]
w[j],sum = sum,0
return w
for q in range(z):
res = []
res = matmult6(mat, vec)
print "i = ", q
print "res = ", len(res)
|
| sptkrishnan |
| View Public Profile |
| Find all posts by sptkrishnan |
|
It has nothing to do with ensymble. Blind guess - Try reducing the no of loops(z) and the 'm' and 'n' values to more sensible ones like 10 or 50. Maybe it is OutOfMemory-StackOverflow kinda error.
import antigravity |
| ashwinurao |
| View Public Profile |
| Find all posts by ashwinurao |
|
Hi,
Thanks for the tip. I have reduced the loop, and the matrix size and the program now works when exported from ensymble. However, this raises the question. How was the program able to run without any errors as a python script under PyS60 interpreter but doesn't run when exported as a sisx file ? Could it be that the python run-time which needs to be embedded inside the process address space is using a lot of memory ? while in python interpreter the script was a separate process and connects to the single python run time ? just speculations but it is good to have a understanding of the conversion process. --Kris |
| sptkrishnan |
| View Public Profile |
| Find all posts by sptkrishnan |
|
When creating the sis using PyS60 application packager part of the PyS60 1.9.x series, click on the Advanced button and specify the heap-size 1M and 16M(min & max). If you are using PyS60 1.4.x then specify the heap size in the command line options of ensymble. The PyS60 ScriptShell is generated with this heap size specification as the default of 100Kb is very low for such complex operations.
import antigravity |
| ashwinurao |
| View Public Profile |
| Find all posts by ashwinurao |
|
Hi,
Thanks again for the timely reply. Using your suggested settings I was able to run my original program. ![]() --Kris |
| sptkrishnan |
| View Public Profile |
| Find all posts by sptkrishnan |
|
Maybe the default heap size should be increased? It seems to be a frequent problem.
|
|
Yes, next release shall have ensymble upgraded to allocate higher heap size by default.
|
| mahesh.sayibabu |
| View Public Profile |
| Find all posts by mahesh.sayibabu |
|
ensymble in PyS60 1.9.5 allocates more heap by default.
|
| mahesh.sayibabu |
| View Public Profile |
| Find all posts by mahesh.sayibabu |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Python for S60 1.9.4 is now released | tvijayan | Python | 9 | 2009-05-27 11:39 |
| Ensymble and python 2.6 | freequest | Python | 7 | 2009-04-07 09:47 |
| Python for S60 1.9.3 released | tvijayan | Python | 40 | 2009-04-03 16:00 |
| Python for S60 1.9.2 released | tvijayan | Python | 26 | 2009-03-11 10:28 |
| Python for S60 1.9.0 released | tvijayan | Python | 48 | 2009-01-27 16:39 |