Skip to content

Commit

Permalink
prepare for CRAN release v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
akersting committed Apr 9, 2023
1 parent 2ee0e49 commit 11593d0
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 85 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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

Expand Down
4 changes: 0 additions & 4 deletions configure.win
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ de
deserialized
dev
doMC
ethz
etry
https
hyperthread
idx
implementational
Expand All @@ -34,7 +32,6 @@ md
muffleMessage
muffleWarning
parallelization
pipermail
prescheduling
radix
rchk
Expand All @@ -44,6 +41,7 @@ sem
semv
shm
sinked
src
stderr
stdout
tmpfs
Expand Down
38 changes: 28 additions & 10 deletions src/copy2shm.c
Original file line number Diff line number Diff line change
@@ -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 <R_ext/Rallocators.h>
#include <R_ext/Altrep.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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);
Expand All @@ -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
22 changes: 0 additions & 22 deletions src/copy2shm.c.windows

This file was deleted.

32 changes: 31 additions & 1 deletion src/sem.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#define _GNU_SOURCE

#include "bettermc.h"

#ifndef _WIN32

#include <stdlib.h>
#include <semaphore.h>
#include <fcntl.h>
Expand Down Expand Up @@ -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
25 changes: 0 additions & 25 deletions src/sem.c.windows

This file was deleted.

22 changes: 22 additions & 0 deletions src/semv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "bettermc.h"

#ifndef _WIN32

#include <sys/types.h>
#include <sys/sem.h>
#include <errno.h>
Expand Down Expand Up @@ -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
17 changes: 0 additions & 17 deletions src/semv.c.windows

This file was deleted.

0 comments on commit 11593d0

Please sign in to comment.