Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: OpenMP from Perl?

by Moron (Curate)
on Jun 21, 2007 at 14:02 UTC ( #622572=note: print w/replies, xml ) Need Help??

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

Come to think of it, for that part of the story you could also use perlcc

^M Free your mind!

Replies are listed 'Best First'.
Re^4: OpenMP from Perl?
by Anonymous Monk on Jun 21, 2007 at 14:22 UTC
    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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://622572]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-06-21 11:02 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.