Skip to content

Commit 95358a6

Browse files
committed
Change to genv
1 parent a18b62c commit 95358a6

16 files changed

+34
-20
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2015-11-01: Ver. 0.1-8
2+
* Change SPMD.CT$* to .pbd_env$SPMD.CT$*.
3+
14
2014-06-21: Ver. 0.1-7
25
* Migrate to MS-MPI.
36
* Get rid of jss.cls and jss.bst.

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ URL: http://r-pbd.org/
2525
BugReports: http://group.r-pbd.org/
2626
MailingList: Please send questions and comments regarding pbdR to
2727
28-
Packaged: 2015-09-17 18:39:55 UTC; snoweye
28+
Packaged: 2015-11-01 20:15:02 UTC; snoweye
2929
Author: Wei-Chen Chen [aut, cre],
3030
George Ostrouchov [aut]
3131
Maintainer: Wei-Chen Chen <[email protected]>

R/000_globalVariables.r

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Do not delete this file and file name!!
2+
### This file should be loaded before all other *.r files.
3+
4+
### This is to avoid the false positive messages from R CMD check.
5+
### "no visible binding for global variable"
6+
### Suggested by Prof Brian Ripley
7+
### ?globalVariables
8+
9+
if(getRversion() >= "2.15.1"){
10+
utils::globalVariables(c(".pmclustEnv", ".PMC.CT"))
11+
}

R/00_pmclust.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pmclust <- function(X = NULL, K = 2, MU = NULL,
44
algorithm = .PMC.CT$algorithm, RndEM.iter = .PMC.CT$RndEM.iter,
55
CONTROL = .PMC.CT$CONTROL, method.own.X = .PMC.CT$method.own.X,
6-
rank.own.X = .SPMD.CT$rank.source, comm = .SPMD.CT$comm){
6+
rank.own.X = .pbd_env$SPMD.CT$rank.source, comm = .pbd_env$SPMD.CT$comm){
77
if(comm.all(is.null(X))){
88
# Check global matrix.
99
A <- exists("X.spmd", envir = .GlobalEnv)
@@ -68,7 +68,7 @@ pmclust <- function(X = NULL, K = 2, MU = NULL,
6868
pkmeans <- function(X = NULL, K = 2, MU = NULL,
6969
algorithm = c("kmeans", "kmeans.dmat"),
7070
CONTROL = .PMC.CT$CONTROL, method.own.X = .PMC.CT$method.own.X,
71-
rank.own.X = .SPMD.CT$rank.source, comm = .SPMD.CT$comm){
71+
rank.own.X = .pbd_env$SPMD.CT$rank.source, comm = .pbd_env$SPMD.CT$comm){
7272
if(comm.all(is.null(X))){
7373
# Check global matrix.
7474
A <- exists("X.spmd", envir = .GlobalEnv)

R/00_pmclust_internal.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pmclust.internal <- function(X = NULL, K = 2, MU = NULL,
44
algorithm = .PMC.CT$algorithm.gbd, RndEM.iter = .PMC.CT$RndEM.iter,
55
CONTROL = .PMC.CT$CONTROL, method.own.X = .PMC.CT$method.own.X,
6-
rank.own.X = .SPMD.CT$rank.source, comm = .SPMD.CT$comm){
6+
rank.own.X = .pbd_env$SPMD.CT$rank.source, comm = .pbd_env$SPMD.CT$comm){
77
# Check.
88
if(! (algorithm[1] %in% .PMC.CT$algorithm.gbd)){
99
comm.stop("The algorithm is not supported")

R/00_pmclust_internal_dmat.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pmclust.internal.dmat <- function(X = NULL, K = 2, MU = NULL,
44
algorithm = .PMC.CT$algorithm.dmat, RndEM.iter = .PMC.CT$RndEM.iter,
55
CONTROL = .PMC.CT$CONTROL, method.own.X = .PMC.CT$method.own.X,
6-
rank.own.X = .SPMD.CT$rank.source, comm = .SPMD.CT$comm){
6+
rank.own.X = .pbd_env$SPMD.CT$rank.source, comm = .pbd_env$SPMD.CT$comm){
77
# Check.
88
if(! (algorithm[1] %in% .PMC.CT$algorithm.dmat)){
99
comm.stop("The algorithm is not supported.")

R/01_as_dmat.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Convert X.spmd to X.dmat
22

33
as.dmat <- function(X.spmd, bldim = pbdDMAT::.BLDIM, ICTXT = pbdDMAT::.ICTXT,
4-
comm = .SPMD.CT$comm){
4+
comm = .pbd_env$SPMD.CT$comm){
55
X.spmd <- load.balance(X.spmd, comm = comm)
66

77
N.spmd <- nrow(X.spmd)

R/01_as_spmd.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Convert X.dmat to X.spmd
22

3-
as.spmd <- function(X.dmat, comm = .SPMD.CT$comm){
3+
as.spmd <- function(X.dmat, comm = .pbd_env$SPMD.CT$comm){
44
COMM.SIZE <- comm.size(comm)
55

66
### check data.
@@ -12,7 +12,7 @@ as.spmd <- function(X.dmat, comm = .SPMD.CT$comm){
1212

1313
### block-cyclic in context 2.
1414
bldim.new <- c(ceiling(nrow(X.dmat) / COMM.SIZE), ncol(X.dmat))
15-
X.dmat <- pbdDMAT::dmat.reblock(X.dmat, bldim = bldim.new, ICTXT = 2)
15+
X.dmat <- pbdDMAT::reblock(X.dmat, bldim = bldim.new, ICTXT = 2)
1616

1717
### copy to spmd.
1818
if(pbdBASE::base.ownany(dim(X.dmat), pbdDMAT::bldim(X.dmat), ICTXT = 2)){

R/02_convert_data.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### For general methods.
22

33
convert.data <- function(X, method.own.X = .PMC.CT$method.own.X,
4-
rank.own.X = .SPMD.CT$rank.source, comm = .SPMD.CT$comm){
4+
rank.own.X = .pbd_env$SPMD.CT$rank.source, comm = .pbd_env$SPMD.CT$comm){
55
COMM.SIZE <- spmd.comm.size(comm)
66
COMM.RANK <- spmd.comm.rank(comm)
77

R/02_load_balance.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### This file contains functions to load balance of data X.spmd.
22

3-
balance.info <- function(X.spmd, comm = .SPMD.CT$comm,
3+
balance.info <- function(X.spmd, comm = .pbd_env$SPMD.CT$comm,
44
spmd.major = 1, method = c("block.cyclic", "block0")){
55
COMM.SIZE <- spmd.comm.size(comm)
66
COMM.RANK <- spmd.comm.rank(comm)
@@ -64,7 +64,7 @@ balance.info <- function(X.spmd, comm = .SPMD.CT$comm,
6464
} # End of balance.info()
6565

6666

67-
load.balance <- function(X.spmd, bal.info = NULL, comm = .SPMD.CT$comm,
67+
load.balance <- function(X.spmd, bal.info = NULL, comm = .pbd_env$SPMD.CT$comm,
6868
spmd.major = 1){
6969
COMM.RANK <- spmd.comm.rank(comm)
7070
if(is.null(bal.info)){
@@ -149,7 +149,7 @@ load.balance <- function(X.spmd, bal.info = NULL, comm = .SPMD.CT$comm,
149149
} # End of load.balance().
150150

151151

152-
unload.balance <- function(new.X.spmd, bal.info, comm = .SPMD.CT$comm){
152+
unload.balance <- function(new.X.spmd, bal.info, comm = .pbd_env$SPMD.CT$comm){
153153
rev.bal.info <- list(send = data.frame(org = bal.info$recv$belong,
154154
belong = bal.info$recv$org),
155155
recv = data.frame(org = bal.info$send$belong,

0 commit comments

Comments
 (0)