[R-pkg-devel] openmp

2015-08-21 Thread Joshua N Pritikin
Many CRAN packages offer improved performance when compiled with 
OpenMP. However, the MacOS and Windows binaries built by CRAN are built 
without openmp enabled. Would it be possible to build openmp enabled 
binaries for some CRAN packages?

-- 
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] openmp

2015-08-24 Thread Joshua N Pritikin
On Sun, Aug 23, 2015 at 08:01:08AM +0200, Mark van der Loo wrote:
>Afaik, openmp is available on windows. According to writing R
>extensions:
> 
>There is nothing to say what version of OpenMP is supported: version
>3.0 (May 2008) is supported by recent versions of the Linux, _Windows_
>and Solaris platforms, but portable packages cannot assume that end
>users have recent versions. OS X nowadays uses clang, and the Apple
>builds currently have no OpenMP support.

So I take that answer as, "No, CRAN cannot possibly enable openmp for 
binary builds." Is that correct?

>Op 21 aug. 2015 22:50 schreef "Joshua N Pritikin"
><[1]jpriti...@pobox.com>:
>  Many CRAN packages offer improved performance when compiled with
>  OpenMP. However, the MacOS and Windows binaries built by CRAN are
>  built
>  without openmp enabled. Would it be possible to build openmp enabled
>  binaries for some CRAN packages?

-- 
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [[openmx-dev]] Re: openmp

2015-08-24 Thread Joshua N Pritikin
On Mon, Aug 24, 2015 at 09:29:34AM -0500, Dirk Eddelbuettel wrote:
> On 24 August 2015 at 09:14, Joshua N Pritikin wrote:
> | So I take that answer as, "No, CRAN cannot possibly enable openmp for 
> | binary builds." Is that correct?
> 
> The CRAN maintainers are not withholding OpenMP from you because they 
> are meanies.
> 
> But they may do so because it is not reliable or performant on some of 
> the platforms.  This issue has been discussed before, Luke Tierney in 
> particular is quite on top of this has made comments in the past that 
> performance might "soon" catch up in the OS X implementation.  OpenMP 
> _is_ used in R itself and by a number of packages.  Your best bet may 
> be to test for it with a configure script, and maybe to talk to the 
> respective CRAN maintainers for Windows and OS X if you have 
> particular questions, there.

Currently, we have a configure script for package OpenMx that only 
enables openmp if gcc is the compiler (OS X only). Nice to hear that 
openmp is supported on Windows.

Are there any CRAN packages that actually compile to openmp enabled 
binaries on CRAN? I'd prefer if we weren't breaking new ground here. I'd 
love to copy an already working configure script instead of trying to 
write it for the first time.

-- 
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [[openmx-dev]] Re: [[openmx-dev]] Re: openmp

2015-08-24 Thread Joshua N Pritikin
On Mon, Aug 24, 2015 at 10:14:10AM -0500, Dirk Eddelbuettel wrote:
> On 24 August 2015 at 11:02, Joshua N Pritikin wrote:
> | Currently, we have a configure script for package OpenMx that only 
> | enables openmp if gcc is the compiler (OS X only). Nice to hear that 
> | openmp is supported on Windows.
> 
> Interesting that you opt to ignore OpenMP support on the platform that
> probably supports it best ...

Do you mean Linux? Yeah, we do enable OpenMP on gcc+Linux but CRAN 
doesn't compile binaries for Linux so it's up to the user to have things 
set up properly.

-- 
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] [mcne...@mac.com: Re: [[openmx-dev]] Re: [[openmx-dev]] Re: [[openmx-dev]] Re: openmp]

2015-08-24 Thread Joshua N Pritikin
Dirk, I pick one of the packages you suggested and asked my colleague to 
test it on MacOS X. As you can see, it did not use more than 1 CPU. I 
inspected the Makevars and found that it relied on 
SHLIB_OPENMP_CXXFLAGS. This variable is set to -fopenmp on my laptop.

Does CRAN add -fopenmp to SHLIB_OPENMP_CXXFLAGS (when there is compiler 
support) or not? It seems not.

-- 
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc
--- Begin Message ---
I tried. Although it is pretty quick at simulating millions of records, it 
never hits the CPU more than 100%:

xx <- rmvn(1,rep(0,6),diag(6))

Michael Neale
mcne...@mac.com



> On Aug 24, 2015, at 12:13 PM, Joshua N Pritikin  wrote:
> 
> On Mon, Aug 24, 2015 at 11:53:33AM -0400, Michael Neale wrote:
>> I guess the issue is whether there is ANY package on CRAN which 
>> compiles with OpenMP under OS X.  It sounds like there isn’t…
> 
> Are you sure?
> 
> Can you try mvnfast?
> 
> -- 
> Joshua N. Pritikin
> Department of Psychology
> University of Virginia
> 485 McCormick Rd, Gilmer Hall Room 102
> Charlottesville, VA 22904
> http://people.virginia.edu/~jnp3bc

--- End Message ---
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [[openmx-dev]] Re: [[openmx-dev]] Re: openmp

2015-08-24 Thread Joshua N Pritikin
On Mon, Aug 24, 2015 at 09:57:05AM -0700, Zhian Kamvar wrote:
> The way several packages have implemented OpenMP is to wrap it in 
> pre-compiler statements i.e.:
> 
> // Include openMP if the compiler supports it
> #ifdef _OPENMP
> #include 
> #endif
> 
> This way, all compilers can build the code and those that have OpenMP 
> (even modified versions of clang: https://clang-omp.github.io/) can do 
> so in a parallel fashion.

Yes, of course, but you're missing the point of my enquiry. My question 
is whether it is possible for CRAN to build and distribute openmp 
enabled binaries.

-- 
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] why doesn't CRAN add -fopenmp to SHLIB_OPENMP_CXXFLAGS for Mac OS?

2015-08-28 Thread Joshua N Pritikin
For example, mvnfast CRAN binaries could take advantage of OpenMP.

The OpenMx team has been building Mac OS binaries with openmp enabled 
for years. We compile with gcc and bundle the necessary openmp enabled 
libraries with the binary. Why couldn't CRAN do this?

-- 
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Check Issue Kinds

2018-09-21 Thread Joshua N Pritikin
We noticed,

https://cran.r-project.org/web/checks/check_issue_kinds.html

Are test results from alternative BLAS/LAPACK implementations available 
somewhere?

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] OS/X binary builds

2018-09-22 Thread Joshua N Pritikin
I set up a cron job to watch for changes in OpenMx check results,

https://cran.r-project.org/web/checks/check_results_OpenMx.html

I notice that Linux builds have been rebuilt multiple times. However, 
it's been almost a week and OS/X builds haven't even been attempted.

When can we expect to see OS/X builds?

Thank you.

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] CRAN's mysterious behavior building OS/X binaries for OpenMx

2018-09-25 Thread Joshua N Pritikin
We finally figured out why our binaries were failing to build on OS/X, 
after more than a year of misery.

We use C++ exceptions and try/catch blocks like this,

try {
 // stuff here
} catch (const std::exception& e) {

This works great with gcc, but whatever version of clang used by CRAN
doesn't like this code. The exception is not caught. So, instead, we have
to write

try {
 // stuff here
} catch (const std::exception& e) {
 // gcc gets here
} catch (...) {
 // clang gets here

which works on both compilers. I don't know why clang skips the first
catch clause.

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] how to throw a C++ exception across modules

2019-09-27 Thread Joshua N Pritikin
OpenMx exports an API that I import into another package (gwsem) like 
this,

  aldp = R_GetCCallable("OpenMx", "AddLoadDataProvider")

gwsem registers some C++ classes through this API.

This works great until gwsem throws a C++ exception. OpenMx calls gwsem in 
a try-catch region. This works flawlessly on Linux. However, it seems to 
not work on Windows. win-builder.r-project.org complained,

** running tests for arch 'i386' ... [23s] ERROR
  Running 'testthat.R' [22s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(gwsem)
  Loading required package: OpenMx
  > 
  > test_check("gwsem")
  
  This application has requested the Runtime to terminate it in an unusual way.
  Please contact the application's support team for more information.
  terminate called after throwing an instance of 'std::runtime_error'
what():  MxComputeLoadData: out of data (record 250 requested but only 199 
in file)

What solution is recommended?

Thank you.

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN submission gwsem 2.0.3

2020-06-14 Thread Joshua N Pritikin


I'm trying to include vignettes that take much too long for CRAN check.

At the beginning of the Rmarkdown vignette, I use

  is_CRAN <- !identical(Sys.getenv("NOT_CRAN"), "true")
  if (is_CRAN) q()

And then I use

  export NOT_CRAN=true

when I build locally. But CRAN check still complains,

On Mon, Jun 08, 2020 at 04:24:43PM +0200, lig...@statistik.tu-dortmund.de wrote:
> Flavor: r-devel-linux-x86_64-debian-gcc
> Check: re-building of vignette outputs, Result: WARNING
>   Error(s) in re-building vignettes:
> ...
>   --- re-building 'GeneEnvironmentInteraction.Rmd' using rmarkdown
>   --- re-building 'OneFactorModel.Rmd' using rmarkdown
>   --- re-building 'PostGWASprocessing.Rmd' using rmarkdown
>   --- re-building 'ResidualsModel.Rmd' using rmarkdown
>   --- re-building 'StandardGWAS.Rmd' using rmarkdown
>   --- re-building 'TwoFactorModel.Rmd' using rmarkdown
>   --- re-building 'UserSpecifiedGWASModels.Rmd' using rmarkdown
>   --- re-building 'growth.Rmd' using rmarkdown
>   Error: Vignette re-building failed.
>   Execution halted

What's the correct way to avoid CRAN complaints?

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN submission gwsem 2.0.3

2020-06-14 Thread Joshua N Pritikin


I'm trying to include vignettes that take much too long for CRAN check.

At the beginning of the Rmarkdown vignette, I use

  is_CRAN <- !identical(Sys.getenv("NOT_CRAN"), "true")
  if (is_CRAN) q()

And then I use

  export NOT_CRAN=true

when I build locally. But CRAN check still complains,

On Mon, Jun 08, 2020 at 04:24:43PM +0200, lig...@statistik.tu-dortmund.de wrote:
> Flavor: r-devel-linux-x86_64-debian-gcc
> Check: re-building of vignette outputs, Result: WARNING
>   Error(s) in re-building vignettes:
> ...
>   --- re-building 'GeneEnvironmentInteraction.Rmd' using rmarkdown
>   --- re-building 'OneFactorModel.Rmd' using rmarkdown
>   --- re-building 'PostGWASprocessing.Rmd' using rmarkdown
>   --- re-building 'ResidualsModel.Rmd' using rmarkdown
>   --- re-building 'StandardGWAS.Rmd' using rmarkdown
>   --- re-building 'TwoFactorModel.Rmd' using rmarkdown
>   --- re-building 'UserSpecifiedGWASModels.Rmd' using rmarkdown
>   --- re-building 'growth.Rmd' using rmarkdown
>   Error: Vignette re-building failed.
>   Execution halted

What's the correct way to avoid CRAN complaints?

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN submission gwsem 2.0.3

2020-06-14 Thread Joshua N Pritikin


I'm trying to include vignettes that take much too long for CRAN check.

At the beginning of the Rmarkdown vignette, I use

  is_CRAN <- !identical(Sys.getenv("NOT_CRAN"), "true")
  if (is_CRAN) q()

And then I use

  export NOT_CRAN=true

when I build locally. But CRAN check still complains,

On Mon, Jun 08, 2020 at 04:24:43PM +0200, lig...@statistik.tu-dortmund.de wrote:
> Flavor: r-devel-linux-x86_64-debian-gcc
> Check: re-building of vignette outputs, Result: WARNING
>   Error(s) in re-building vignettes:
> ...
>   --- re-building 'GeneEnvironmentInteraction.Rmd' using rmarkdown
>   --- re-building 'OneFactorModel.Rmd' using rmarkdown
>   --- re-building 'PostGWASprocessing.Rmd' using rmarkdown
>   --- re-building 'ResidualsModel.Rmd' using rmarkdown
>   --- re-building 'StandardGWAS.Rmd' using rmarkdown
>   --- re-building 'TwoFactorModel.Rmd' using rmarkdown
>   --- re-building 'UserSpecifiedGWASModels.Rmd' using rmarkdown
>   --- re-building 'growth.Rmd' using rmarkdown
>   Error: Vignette re-building failed.
>   Execution halted

What's the correct way to avoid CRAN complaints?

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN submission gwsem 2.0.3

2020-06-14 Thread Joshua N Pritikin
Ah, thank you!

Sorry for the duplicate posts.

On Sun, Jun 14, 2020 at 09:17:32AM -0400, Duncan Murdoch wrote:
> On 13/06/2020 1:29 p.m., Joshua N Pritikin wrote:
> > 
> > I'm trying to include vignettes that take much too long for CRAN check.
> > 
> > At the beginning of the Rmarkdown vignette, I use
> > 
> >is_CRAN <- !identical(Sys.getenv("NOT_CRAN"), "true")
> >if (is_CRAN) q()
> > 
> > And then I use
> > 
> >export NOT_CRAN=true
> > 
> > when I build locally. But CRAN check still complains,
> 
> You shouldn't call q() from a vignette.  Since you're using Rmarkdown, you
> can use a variable for the eval chunk option, e.g. put this in your setup
> chunk:
> 
> knitr::opts_chunk$set(eval = !is_CRAN)

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN submission gwsem 2.0.3

2020-06-14 Thread Joshua N Pritikin
On Sun, Jun 14, 2020 at 09:17:32AM -0400, Duncan Murdoch wrote:
> Since you're using Rmarkdown, you can use a variable for the eval 
> chunk option, e.g. put this in your setup chunk:
> 
> knitr::opts_chunk$set(eval = !is_CRAN)

This works except for in-text `r 1+1` code fragments. Is there an option 
to make these evaluate to "[MISSING]" or similar?

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] [CRAN-pretest-archived] CRAN submission gwsem 2.0.3

2020-06-14 Thread Joshua N Pritikin
Ah, brilliant. Thanks.

On Sun, Jun 14, 2020 at 11:28:17AM -0400, Duncan Murdoch wrote:
> On 14/06/2020 10:59 a.m., Joshua N Pritikin wrote:
> > On Sun, Jun 14, 2020 at 09:17:32AM -0400, Duncan Murdoch wrote:
> > > knitr::opts_chunk$set(eval = !is_CRAN)
> > 
> > This works except for in-text `r 1+1` code fragments. Is there an option
> > to make these evaluate to "[MISSING]" or similar?
> 
> To suppress evaluation of those, you can use this:
> 
> knitr::knit_hooks$set(evaluate.inline = function(x, envir) x)

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] os/x compiled w/ openmp?

2020-07-21 Thread Joshua N Pritikin


Has anybody managed to create binary packages for os/x with openmp 
enabled?

Is this the best place to ask?

Our working non-openmp enabled build is here,

https://travis-ci.org/github/OpenMx/OpenMx/jobs/706741686

Thank you.

-- 
Joshua N. Pritikin, Ph.D.
Virginia Institute for Psychiatric and Behavioral Genetics
Virginia Commonwealth University
PO Box 980126
800 E Leigh St, Biotech One, Suite 1-133
Richmond, VA 23219
http://exuberant-island.surge.sh

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel