官术网_书友最值得收藏!

R is single-threaded

Another way in which R is CPU limited is that, by default, it runs only on a single thread on the CPU. It does not matter if you install R on a powerful server with 64 CPU cores, R will only use one of them. For example, finding the sum of a numeric vector is an operation that can be made to run in parallel in the CPU quite easily. If there are four CPU cores available, each core can be given roughly one quarter of the data to process. Each core computes the subtotal of the chunk of data it is given, and the four subtotals are then added up to find the total sum of the whole dataset. However in R, the sum() function runs serially, processing the entire dataset on one CPU core. In fact, many Big Data operations are of a similar nature to the summation example here, with the same task running independently on many subsets of data. In such a scenario, performing the operation sequentially would be an underuse of today's mostly parallel computing architectures. In Chapter 8, Multiplying Performance with Parallel Computing, we will learn how to write parallel programs in R to overcome this limitation.

主站蜘蛛池模板: 景东| 都昌县| 雅江县| 方山县| 长沙县| 潮州市| 晋江市| 呼玛县| 河曲县| 根河市| 新巴尔虎右旗| 新邵县| 上栗县| 高平市| 定兴县| 白玉县| 新巴尔虎左旗| 新河县| 运城市| 西平县| 务川| 桃园市| 黄梅县| 肃南| 东乡县| 大港区| 涟源市| 孟津县| 锡林郭勒盟| 南和县| 诸暨市| 德江县| 都兰县| 巴东县| 惠东县| 弥渡县| 通海县| 商南县| 西吉县| 砚山县| 钦州市|