×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    25

    Question An issue with ensymble and Python 1.9.4

    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

  2. #2
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: An issue with ensymble and Python 1.9.4

    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

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    25

    Smile Re: An issue with ensymble and Python 1.9.4

    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

  4. #4
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: An issue with ensymble and Python 1.9.4

    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

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    25

    Thumbs up Re: An issue with ensymble and Python 1.9.4

    Hi,

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

    --Kris

  6. #6
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: An issue with ensymble and Python 1.9.4

    Maybe the default heap size should be increased? It seems to be a frequent problem.

  7. #7
    Nokia Developer Expert
    Join Date
    Apr 2007
    Posts
    131

    Re: An issue with ensymble and Python 1.9.4

    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.

  8. #8
    Nokia Developer Expert
    Join Date
    Apr 2007
    Posts
    131

    Re: An issue with ensymble and Python 1.9.4

    ensymble in PyS60 1.9.5 allocates more heap by default.

Similar Threads

  1. Python for S60 1.9.4 is now released
    By tvijayan in forum Python
    Replies: 9
    Last Post: 2009-05-27, 10:39
  2. Ensymble and python 2.6
    By freequest in forum Python
    Replies: 7
    Last Post: 2009-04-07, 08:47
  3. Python for S60 1.9.3 released
    By tvijayan in forum Python
    Replies: 40
    Last Post: 2009-04-03, 15:00
  4. Python for S60 1.9.2 released
    By tvijayan in forum Python
    Replies: 26
    Last Post: 2009-03-11, 09:28
  5. Python for S60 1.9.0 released
    By tvijayan in forum Python
    Replies: 48
    Last Post: 2009-01-27, 15:39

Posting Permissions

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