diff --git a/Change b/Change index eda9d41..31beb53 100644 --- a/Change +++ b/Change @@ -3,3 +3,6 @@ 1.0.1 Fri Jul 19 09:07:09 PM UTC 2024 - update POD + +1.0.2 Sat Jul 20 09:07:09 PM UTC 2024 + - update POD diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e082c5f --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +clean: + dzil clean + rm -rf _Inline + +test: clean + dzil test + +prepare: clean + dzil build + mv -vf *.tar.gz ./releases/ + dzil clean + git add ./releases/*.tar.gz + git status + @echo "tag and push ... " diff --git a/dist.ini b/dist.ini index 92b5f8c..d48654c 100644 --- a/dist.ini +++ b/dist.ini @@ -30,5 +30,3 @@ OpenMP::Simple = 0 [PruneFiles] filename = _Inline filename = releases -[ExecDir] -dir = bin diff --git a/lib/OpenMP.pm b/lib/OpenMP.pm index 99b4586..124e0d2 100644 --- a/lib/OpenMP.pm +++ b/lib/OpenMP.pm @@ -6,7 +6,7 @@ use warnings; use OpenMP::Simple; use OpenMP::Environment; -my $VERSION = q{1.0.1}; +my $VERSION = q{1.0.2}; sub new { my ($pkg) = shift; @@ -29,46 +29,47 @@ OpenMP - Metapackage for using OpenMP in Perl =head1 SYNOPSIS + #!/usr/bin/env perl use strict; use warnings; - + use OpenMP; - + use Inline ( C => 'DATA', with => qw/OpenMP::Simple/, ); - + my $omp = OpenMP->new; - + for my $want_num_threads ( 1 .. 8 ) { $omp->env->omp_num_threads($want_num_threads); - + $omp->env->assert_omp_environment; # (optional) validates %ENV - + # call parallelized C function my $got_num_threads = _check_num_threads(); - + printf "%0d threads spawned in ". "the OpenMP runtime, expecting %0d\n", $got_num_threads, $want_num_threads; } - + __DATA__ __C__ - + /* C function parallelized with OpenMP */ int _check_num_threads() { int ret = 0; - - PerlOMP_UPDATE_WITH_ENV__NUM_THREADS /* <~ MACRO x OpenMP::Simple */ - + + PerlOMP_GETENV_BASIC + #pragma omp parallel { #pragma omp single ret = omp_get_num_threads(); } - + return ret; } @@ -79,6 +80,16 @@ also makes documentation and tutorials much more clear. It also makes it easier to install everything needed since this module will pull in L and L. +Installing this module will also install whichever of the following modules are +not already on your system: L, L, L, +and L. + +OpenMP::Simple - provides C MACROS and convenient runtime functions for use in the +Perl environment; e.g., C. + +OpenMP::Environment - provides accessors for environmental variables the OpenMP +run-time considers important; e.g., C. + =head1 METHODS There are just 2 methods, @@ -103,6 +114,8 @@ This is a module that aims at making it easier to bootstrap Perl+OpenMP programs. It is designed to work together with L and L. +B L. + This module heavily favors the C implementation of the OpenMP specification within gcc. In fact, it has not been tested with any other implementations because L doesn't support anything other diff --git a/releases/OpenMP-1.0.2.tar.gz b/releases/OpenMP-1.0.2.tar.gz new file mode 100644 index 0000000..d8f215f Binary files /dev/null and b/releases/OpenMP-1.0.2.tar.gz differ