[Matrix-SIG] Pyfort Version 2 now available

Berthold Höllmann se6y095@public.uni-hamburg.de
11 Sep 1999 13:59:39 +0200


"Paul F. Dubois" <dubois1@llnl.gov> writes:

> Version 2 of Pyfort, a tool that lets you extend Python with Fortran, is now
> available. See http://xfiles.llnl.gov/python.htm.

Hello, 

I downloaded and installed pyfort2. Checking the test subdirectory I
get:

# python testit.py 
itimes [1 2 3] [2 3 4]
[ 2  6 12]
times [ 1.  2.  3.] [ 2.  3.  4.]
[  2.   6.  12.]
bang 1.2 [0 1 2 3 4 5 6 7 8 9] [ 3.+0.j  4.+2.j]
Speicherzugriffsfehler

(Speicherzugriffsfehler is german for "segmentation fault")

So I started gdb:

# gdb python 
GNU gdb 4.17.0.11 with Linux support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run testit.py 
Starting program: /usr/local/bin/python testit.py
itimes [1 2 3] [2 3 4]
[ 2  6 12]
times [ 1.  2.  3.] [ 2.  3.  4.]
[  2.   6.  12.]
bang 1.2 [0 1 2 3 4 5 6 7 8 9] [ 3.+0.j  4.+2.j]

Program received signal SIGSEGV, Segmentation fault.
0x4013730b in do_array_in (rname=0x4013a0da "bang", vname=0x4013a0d8 "R", 
    v=0x80cdcd4, python_array_type=PyArray_FLOAT) at ./testpyfmodule.c:172
172         if (t->descr->type_num != python_array_type) {
(gdb) where
#0  0x4013730b in do_array_in (rname=0x4013a0da "bang", vname=0x4013a0d8 "R", 
    v=0x80cdcd4, python_array_type=PyArray_FLOAT) at ./testpyfmodule.c:172
#1  0x40138103 in testpyf_bang (unused=0x0, args=0x80d4f50) at ./testpyfmodule.c:562
#2  0x80539e0 in call_builtin (func=0x80cebf8, arg=0x80d4f50, kw=0x0)
    at ceval.c:2359
#3  0x80538f8 in PyEval_CallObjectWithKeywords (func=0x80cebf8, arg=0x80d4f50, 
    kw=0x0) at ceval.c:2324
#4  0x8052ac5 in eval_code2 (co=0x80cd7e0, globals=0x80a34d8, locals=0x80a34d8, 
    args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, owner=0x0)
    at ceval.c:1654
#5  0x8050dd2 in PyEval_EvalCode (co=0x80cd7e0, globals=0x80a34d8, locals=0x80a34d8)
    at ceval.c:324
#6  0x805f8ae in run_node (n=0x80bd658, filename=0xbffff8a4 "testit.py", 
    globals=0x80a34d8, locals=0x80a34d8) at pythonrun.c:887
#7  0x805f868 in run_err_node (n=0x80bd658, filename=0xbffff8a4 "testit.py", 
    globals=0x80a34d8, locals=0x80a34d8) at pythonrun.c:872
#8  0x805f840 in PyRun_File (fp=0x80a1148, filename=0xbffff8a4 "testit.py", 
    start=257, globals=0x80a34d8, locals=0x80a34d8) at pythonrun.c:860
#9  0x805efce in PyRun_SimpleFile (fp=0x80a1148, filename=0xbffff8a4 "testit.py")
    at pythonrun.c:570
#10 0x805ec61 in PyRun_AnyFile (fp=0x80a1148, filename=0xbffff8a4 "testit.py")
    at pythonrun.c:451
#11 0x804f5eb in Py_Main (argc=2, argv=0xbffff724) at main.c:287
#12 0x804f0e8 in main (argc=2, argv=0xbffff724) at python.c:12
(gdb) print t->descr->type_num
Cannot access memory at address 0x3ff00034.
(gdb) print t->descr       
$1 = (PyArray_Descr *) 0x3ff00000
(gdb) print t->descr->type    
Cannot access memory at address 0x3ff00044.
(gdb) print t->descr->data
There is no member named data.
(gdb) print t->ob_type
$2 = (struct _typeobject *) 0x8094cc0
(gdb) print t->ob_type->tp_name
$3 = 0x808c3a0 "float"
(gdb) 

I'm using LLNLDistribution12beta which seems to return Floats instead
of array(<value>, Float) from PyArray_ContiguousFromObject for single
values. (This is my understanding of the recent dicussion on
[Matrix-SIG])

Cheers

Berthold
-- 
bhoel@starship.python.net / http://starship.python.net/crew/bhoel/
        It is unlawful to use this email address for unsolicited ads
        (USC Title 47 Sec.227). I will assess a US$500 charge for
        reviewing and deleting each unsolicited ad.