diff --git a/DESCRIPTION b/DESCRIPTION index ddb26a0..8eaca23 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: bettermc Title: Enhanced Fork-Based Parallelization -Version: 1.2.0 -Date: 2023-04-03 +Version: 1.2.1 +Date: 2023-04-09 Authors@R: c(person(given = "Andreas", family = "Kersting", diff --git a/NEWS.md b/NEWS.md index efdde3c..67d6990 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# bettermc 1.2.0 +# bettermc 1.2.1 ## New Features * add support for overloading `parallel::mclapply()` with `bettermc::mclapply()` via the [bettermcExt](https://github.com/gfkse/bettermcExt)-package on GitHub; @@ -15,6 +15,7 @@ this enables the use of `bettermc::mclapply()` by third-party packages originall ## Misc * make the format of this very file *NEWS.md* compatible with *news()* * avoid a superfluous clang -Wuninitialized as requested by CRAN +* avoid a CRAN warning regarding "unlikely file names for src files" # bettermc 1.1.2 diff --git a/configure.win b/configure.win index 3efcdbd..87c7f90 100755 --- a/configure.win +++ b/configure.win @@ -1,7 +1,3 @@ #!/bin/sh -cp src/copy2shm.c.windows src/copy2shm.c -cp src/sem.c.windows src/sem.c -cp src/semv.c.windows src/semv.c - sed -i 's/\\link\[parallel]{mcaffinity}/mcaffinity/' man/mclapply.Rd diff --git a/inst/WORDLIST b/inst/WORDLIST index fef66eb..826a1b0 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -21,9 +21,7 @@ de deserialized dev doMC -ethz etry -https hyperthread idx implementational @@ -34,7 +32,6 @@ md muffleMessage muffleWarning parallelization -pipermail prescheduling radix rchk @@ -44,6 +41,7 @@ sem semv shm sinked +src stderr stdout tmpfs diff --git a/src/copy2shm.c b/src/copy2shm.c index 17f9a55..b1adae7 100644 --- a/src/copy2shm.c +++ b/src/copy2shm.c @@ -1,6 +1,16 @@ #define _GNU_SOURCE - #include "bettermc.h" + +SEXP is_altrep(SEXP x) { + return ScalarLogical(ALTREP(x)); +} + +SEXP is_allocated(SEXP x) { + return ScalarLogical(DATAPTR_OR_NULL(x) != NULL); +} + +#ifndef _WIN32 + #include #include #include @@ -325,15 +335,6 @@ SEXP allocate_from_shm(SEXP name, SEXP type, SEXP length, SEXP size, return ret; } -SEXP is_altrep(SEXP x) { - return ScalarLogical(ALTREP(x)); -} - -SEXP is_allocated(SEXP x) { - return ScalarLogical(DATAPTR_OR_NULL(x) != NULL); -} - - SEXP unlink_all_shm(SEXP prefix, SEXP start) { const char *pre = CHAR(STRING_ELT(prefix, 0)); int pre_len = strlen(pre); @@ -356,3 +357,20 @@ SEXP unlink_all_shm(SEXP prefix, SEXP start) { return R_NilValue; } + +#else + +SEXP copy2shm(SEXP x, SEXP n, SEXP overwrite, SEXP huge_threshold) { + error("Not supported on Windows."); +} + +SEXP allocate_from_shm(SEXP name, SEXP type, SEXP length, SEXP size, + SEXP attributes, SEXP copy) { + error("Not supported on Windows."); +} + +SEXP unlink_all_shm(SEXP prefix, SEXP start) { + error("Not supported on Windows."); +} + +#endif diff --git a/src/copy2shm.c.windows b/src/copy2shm.c.windows deleted file mode 100644 index 32386c7..0000000 --- a/src/copy2shm.c.windows +++ /dev/null @@ -1,22 +0,0 @@ -#include "bettermc.h" - -SEXP copy2shm(SEXP x, SEXP n, SEXP overwrite, SEXP huge_threshold) { - error("Not supported on Windows."); -} - -SEXP allocate_from_shm(SEXP name, SEXP type, SEXP length, SEXP size, - SEXP attributes, SEXP copy) { - error("Not supported on Windows."); -} - -SEXP is_altrep(SEXP x) { - return ScalarLogical(ALTREP(x)); -} - -SEXP is_allocated(SEXP x) { - return ScalarLogical(DATAPTR_OR_NULL(x) != 0); -} - -SEXP unlink_all_shm(SEXP prefix, SEXP start) { - error("Not supported on Windows."); -} diff --git a/src/sem.c b/src/sem.c index 9cbdf17..0284e94 100644 --- a/src/sem.c +++ b/src/sem.c @@ -1,6 +1,8 @@ #define _GNU_SOURCE - #include "bettermc.h" + +#ifndef _WIN32 + #include #include #include @@ -95,3 +97,31 @@ SEXP sigterm(SEXP pid) { int ret = kill(p, SIGTERM); return ScalarInteger(ret); } + +#else + +SEXP semaphore_open(SEXP n, SEXP create, SEXP overwrite, SEXP value) { + error("Not supported on Windows."); +} + +SEXP semaphore_post(SEXP sem) { + error("Not supported on Windows."); +} + +SEXP semaphore_wait(SEXP sem) { + error("Not supported on Windows."); +} + +SEXP semaphore_close(SEXP sem) { + error("Not supported on Windows."); +} + +SEXP semaphore_unlink(SEXP n) { + error("Not supported on Windows."); +} + +SEXP sigterm(SEXP pid) { + error("Not supported on Windows."); +} + +#endif diff --git a/src/sem.c.windows b/src/sem.c.windows deleted file mode 100644 index 6436f41..0000000 --- a/src/sem.c.windows +++ /dev/null @@ -1,25 +0,0 @@ -#include "bettermc.h" - -SEXP semaphore_open(SEXP n, SEXP create, SEXP overwrite, SEXP value) { - error("Not supported on Windows."); -} - -SEXP semaphore_post(SEXP sem) { - error("Not supported on Windows."); -} - -SEXP semaphore_wait(SEXP sem) { - error("Not supported on Windows."); -} - -SEXP semaphore_close(SEXP sem) { - error("Not supported on Windows."); -} - -SEXP semaphore_unlink(SEXP n) { - error("Not supported on Windows."); -} - -SEXP sigterm(SEXP pid) { - error("Not supported on Windows."); -} diff --git a/src/semv.c b/src/semv.c index f753ed2..2cd1525 100644 --- a/src/semv.c +++ b/src/semv.c @@ -1,5 +1,7 @@ #include "bettermc.h" +#ifndef _WIN32 + #include #include #include @@ -80,3 +82,23 @@ SEXP semaphorev_unlink(SEXP sid) { return R_NilValue; } + +#else + +SEXP semaphorev_open(SEXP value) { + error("Not supported on Windows."); +} + +SEXP semaphorev_wait(SEXP sid, SEXP undo) { + error("Not supported on Windows."); +} + +SEXP semaphorev_post(SEXP sid, SEXP undo) { + error("Not supported on Windows."); +} + +SEXP semaphorev_unlink(SEXP sid) { + error("Not supported on Windows."); +} + +#endif diff --git a/src/semv.c.windows b/src/semv.c.windows deleted file mode 100644 index 34082f2..0000000 --- a/src/semv.c.windows +++ /dev/null @@ -1,17 +0,0 @@ -#include "bettermc.h" - -SEXP semaphorev_open(SEXP value) { - error("Not supported on Windows."); -} - -SEXP semaphorev_wait(SEXP sid, SEXP undo) { - error("Not supported on Windows."); -} - -SEXP semaphorev_post(SEXP sid, SEXP undo) { - error("Not supported on Windows."); -} - -SEXP semaphorev_unlink(SEXP sid) { - error("Not supported on Windows."); -}