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

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.

主站蜘蛛池模板: 长垣县| 延长县| 龙川县| 泗阳县| 根河市| 镇原县| 巴中市| 临沧市| 虞城县| 耿马| 鹰潭市| 石城县| 阳春市| 绥江县| 凤阳县| 久治县| 汾西县| 五莲县| 灵寿县| 高密市| 玛沁县| 台南市| 柳河县| 茌平县| 曲靖市| 邹城市| 秭归县| 加查县| 呼和浩特市| 昭苏县| 望都县| 民勤县| 永康市| 南城县| 绩溪县| 宣城市| 山西省| 呼和浩特市| 海淀区| 牡丹江市| 扶风县|