You Are Here:

Community: Developer Discussion Boards

#1 Old Question An issue with ensymble and Python 1.9.4 - 2009-05-04, 08:22

Join Date: Feb 2008
Posts: 25
sptkrishnan
Offline
Registered User
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)
--Kris
Reply With Quote

#2 Old Re: An issue with ensymble and Python 1.9.4 - 2009-05-04, 11:34

Join Date: Oct 2007
Posts: 114
ashwinurao
Offline
Regular Contributor
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
Reply With Quote

#3 Old Smile Re: An issue with ensymble and Python 1.9.4 - 2009-05-04, 13:51

Join Date: Feb 2008
Posts: 25
sptkrishnan
Offline
Registered User
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
Reply With Quote

#4 Old Re: An issue with ensymble and Python 1.9.4 - 2009-05-04, 15:27

Join Date: Oct 2007
Posts: 114
ashwinurao
Offline
Regular Contributor
Quote:
Originally Posted by sptkrishnan View Post
Hi,

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 ?


--Kris
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
Reply With Quote

#5 Old Thumbs up Re: An issue with ensymble and Python 1.9.4 - 2009-05-05, 04:31

Join Date: Feb 2008
Posts: 25
sptkrishnan
Offline
Registered User
Hi,

Thanks again for the timely reply. Using your suggested settings I was able to run my original program.

--Kris
Reply With Quote

#6 Old Re: An issue with ensymble and Python 1.9.4 - 2009-05-05, 16:18

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Maybe the default heap size should be increased? It seems to be a frequent problem.
Reply With Quote

#7 Old Re: An issue with ensymble and Python 1.9.4 - 2009-05-08, 05:47

Join Date: Apr 2007
Posts: 131
mahesh.sayibabu's Avatar
mahesh.sayibabu
Offline
Regular Contributor
Quote:
Originally Posted by jplauril View Post
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.
Reply With Quote

#8 Old Re: An issue with ensymble and Python 1.9.4 - 2009-05-26, 06:13

Join Date: Apr 2007
Posts: 131
mahesh.sayibabu's Avatar
mahesh.sayibabu
Offline
Regular Contributor
ensymble in PyS60 1.9.5 allocates more heap by default.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia