in reply to Re: OpenMP from Perl?
in thread OpenMP from Perl?

Thanks for that. Yes, it is the thought of FORTRAN that makes me shiver. I am considering my own implementation, but did not wish to reinvent the wheel. I had not considered B::C (is it still supported?) and that could be the easiest route.
Update: B::C must be still supported, since there is a 5.9.4 version, but I thought I read somewhere that it is going to be dropped? Maybe I was dreaming.

Replies are listed 'Best First'.
Re^3: OpenMP from Perl?
by Moron (Curate) on Jun 21, 2007 at 14:02 UTC
    Come to think of it, for that part of the story you could also use perlcc
    __________________________________________________________________________________

    ^M Free your mind!

      I've just had a play with both, and it is not so simple. The most basic structure in OpenMP is to parallel a (C-style) 'for' loop by prefixing with a #pragma in C/C++. A Perl 'for' loop is not translated into a C 'for' loop by B::C, so it is not just a case of hacking the resulting C. Looks like I'll have to convert the OpenMP directives into Perl threading constructs.
        I just tested it using perlcc and it DID translate the perl 3-argument for loop into a C 3-argument for-loop. See For Loops for foreach and check out the C-style 3-argument for loop (appears first in the doc in fact!) which got "borrowed" from C in the first place and which is what you probably SHOULD be trying to translate.

        The Perl one-argument for loop (really a foreach loop with a syntactic allowance being supplied) is an entirely different animal entirely and its resemblance to the C for loop should be treated as semantic and of no practical importance in ths regard.

        __________________________________________________________________________________

        ^M Free your mind!