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

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.

主站蜘蛛池模板: 南江县| 蓬溪县| 富蕴县| 平山县| 磐石市| 青铜峡市| 南澳县| 虎林市| 天气| 珠海市| 白城市| 楚雄市| 常熟市| 罗甸县| 徐汇区| 东方市| 开鲁县| 南城县| 嘉义县| 澎湖县| 沙田区| 沁水县| 三明市| 杭州市| 双城市| 明溪县| 鸡西市| 德钦县| 龙山县| 汨罗市| 年辖:市辖区| 蓬溪县| 天等县| 荆门市| 兰坪| 西乌珠穆沁旗| 涡阳县| 内丘县| 定西市| 福泉市| 乌兰察布市|