[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Re: Strange observation: Chicken, C, C++: Joe Averag

From: Siegfried Gonzi
Subject: Re: [Chicken-users] Re: Strange observation: Chicken, C, C++: Joe Average does benchmarking
Date: Wed, 19 Dec 2007 13:26:21 +0100

-------- Original-Nachricht --------
> Datum: Wed, 19 Dec 2007 08:48:30 -0300
> Von: "Alex Queiroz" <address@hidden>

> > The optimization options for Chicken on OS X are pretty conservative:
> > only -Os -fomit-frame-pointer.  Your options are probably better.
> > But, I noticed you didn't add -m64 to your C++ compile to activate
> > 64-bit mode, which adds a bunch of extra CPU registers as well.
> >
>      On x86-64 GCC uses -m64 by default, unless Apple changed something.

Question: why does'nt Chicken have fl*,fl+? I get a segementation fault. I 
guess Chicken only implements fx*,fx+,... I cannot find it in the manual.

Would'nt it make more sense to implement fl*,... too?

Okay, Bigloo without that fl*, etc. being not the fastest. But in all my 
projects I rarely ever used that kind of optimizations because Bigloo was 
always speedy.

When one is going to do micro benchmarks it always seems much worse for all the 
Scheme languages than reality will show.

There is another point which is often neglected: how a programming language 
handles large arrays and data sets. Bigloo was always good in this respect. 
Honestly I know no scientist personally who really does 'clever algorithm like 
programming'. At least in my case: brute force methods and I am happy with.

Will have to see how Chicken deals with large arrays.

Btw: Anyone here who has experience dealing with external Fortran subprograms. 
I have never done any serious OCaml programming but I at one time browsed 
through a Caml tutorial which demonstrated that including external Fortran 
subroutines is quite easy in Ocaml.

What is the preferred method in Chicken: writing a wrapper function in C to 
Fortran and in turn calling that particular wrapper function from Chicken?

Btw: any serious C programmer here who can point me to a tutorial or method how 
to accomplish the following lets now say from within C:

given a Fortran subroutine:

subroutine read(array,array_out,dim1,dim2,dim3)

real*8, allocatable(:,:), intent(in) :: array
real*8, allocatable(:,:), intent(inout) :: array_out
integer, intent(inout) :: dim1,dim2,dim3
end subroutine read

The important thing here in Fortran 90: I pass an array which is allocated 
inside the function.

How could I write a wrapper function in C without knowing the returned array 
dimension in advance. What could additionally be returned are the dimension 
though and the allocated (with content) array from the Fortran subroutine. Can 
I set a pointer in C to the returned (Fortran 90) array and with the additional 
information of dimension dim1,dim2,dim3 the C pointer collects the content of 
the array (Fortraner told me arrays in Fortran are always stored consecutively 
in memory).

Thanks, Siegfried


GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]