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

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.

主站蜘蛛池模板: 郎溪县| 方正县| 龙江县| 清河县| 北宁市| 宣化县| 铁岭市| 九寨沟县| 略阳县| 阿拉善盟| 阳山县| 息烽县| 金塔县| 东乡族自治县| 方山县| 乌恰县| 宣汉县| 盐源县| 荣昌县| 肇源县| 昌平区| 汝南县| 曲周县| 鄂温| 莲花县| 张家港市| 新乐市| 沁阳市| 商都县| 湟源县| 遵义市| 阳春市| 祥云县| 同心县| 黎城县| 定陶县| 安龙县| 弥勒县| 峨眉山市| 临泽县| 渝中区|