Intructions for Using Multiple Chips with GENOUD and Genetic Matching (GenMatch)

By Rocio Titiunik.

The following steps will show you how to use multiple chips in your computer when using R.
(1) In order to use multiple chips, you must use the R package 'parallel'.

(2) Create a directory to store the needed files. We will assume that this directory is called 'test'.

(3) Copy the files AutoCluster4.R and a1dual.R to the 'test' directory you just created. You can download these files from Jasjeet Sekhon's website at http://sekhon.berkeley.edu/rgenoud/test.

(4) The file a1dual.R runs GenMatch() using all or some of the chips available in your computer. Remember that in order to use multiple chips, you must load the 'parallel' library. The line 'cl <- NCPUS()' creates the cluster object by calling the function 'NCPUS()', and this object is then passed to 'GenMatch()' via the 'cluster' option.

The function 'NCPUS()' is in the file AutoCluster4.R, which you must source at the beginning of the file. If the file is in your working directory, you can source it by just typing 'source("AutoCluster4.R")'.

The 'NCPUS()' function can be called with or without arguments. When the function 'NCPUS()' is executed with no arguments, the number of chips available in the computer is automatically detected and a cluster is created using as many chips as there are available. Alternatively, the user can specify the precise number of chips to be used by passing the number of chips as an argument. For example, 'cl <- NCPUS(nchips=4)' would create a cluster using exactly four chips in the computer (assuming that the computer does have four chips). If your computer had two chips and you wanted to create a cluster using both chips, you would type 'cl <- NCPUS(nchips=2)'.

(5) Done. The file a1dual.R will run 'GenMatch()' using multiple chips in your computer.

Instructions for Windows

In Windows, the 'NCPUS()' function must be called with an argument. The user must specify the precise number of chips to be included in the cluster by passing the number of chips as an argument to the function. For example, 'cl <- NCPUS(nchips=4)' would create a cluster using exactly four chips in the computer (assuming that the computer does have four chips). If your computer had two chips and you wanted to create a cluster using both chips, you would type 'cl <- NCPUS(nchips=2)'.



Return to Jasjeet Sekhon's Homepage