multicore

AMD multi-core programming

▼魔方 西西 提交于 2019-12-01 05:45:34
I want to start to write applications(C++) that will utilize the additional cores to execute portions of the code that have a need to perform lots of calculations and whose computations are independent of each other. I have the following processor : x64 Family 15 Model 104 Stepping 2 Authentic AMD ~1900 Mhz running on Windows Vista Home premium 32 bit and Opensuse 11.0 64 bit. On the Intel platforms , I've used the following APIs Intel TBB, OpenMP. Do they work on AMD and does AMD have similar APIs.what has been your experience? OpenMP and TBB are both available also for AMD - it is also a

Android set thread affinity

房东的猫 提交于 2019-12-01 04:58:06
Following the answer from this StackOverflow question how do I create the proper integer for mask? I made some googling and the everything I found uses CPU_SET macro from sched.h but it operates on cpu_set_t structures which are undefined when using NDK. When try using CPU_SET linker gives me undefined reference error (even though I link against pthread). Well, in the end I found some version which was taken directly from sched.h . Im posting this here if anyone has the same problem and doesn't want to spend the time searching for it. This is quite useful. #define CPU_SETSIZE 1024 #define _

R system() process always uses same CPU, not multi-threaded/multi-core

爷,独闯天下 提交于 2019-12-01 04:03:33
In R 3.0.2 on Linux 3.12.0, I am using the system() function to execute a number of tasks. The desired effect is for each of these tasks to run as they would if I had executed them on the command-line via Rscript outside of R system(). However, when executing them inside R via system(), each task is tied to the same single CPU from the master R process. In other words: When launched via RScript directly from a bash shell, outside of R, each task runs on its own core as possible (this is desired) When launched inside R via system(), each task runs on the same single core. There is no multicore

Android set thread affinity

假如想象 提交于 2019-12-01 02:52:27
问题 Following the answer from this StackOverflow question how do I create the proper integer for mask? I made some googling and the everything I found uses CPU_SET macro from sched.h but it operates on cpu_set_t structures which are undefined when using NDK. When try using CPU_SET linker gives me undefined reference error (even though I link against pthread). 回答1: Well, in the end I found some version which was taken directly from sched.h . Im posting this here if anyone has the same problem and

How to get usage of each cpu core on android

十年热恋 提交于 2019-12-01 01:59:17
I develop a widget on Android which display many useful informations. I am trying to modify this method to return the percent of use of one cpu core, in order to have the percent of use of each core !!! On my HTC One X, i have in " /proc/stat ": cpu 183549 10728 236016 3754379 7530 41 1013 0 0 0 cpu0 141962 5990 196956 720894 3333 41 970 0 0 0 cpu1 23400 2550 23158 980901 2211 0 23 0 0 0 cpu2 13602 1637 12561 1019126 1216 0 18 0 0 0 cpu3 4585 551 3341 1033458 770 0 2 0 0 0 I use this method to return the percent of use of all cpu core. public float readUsage() { try { RandomAccessFile reader =

Multi threading which would be the best to use? (Threadpool or threads)

随声附和 提交于 2019-12-01 00:20:43
Hopefully this is a better question than my previous. I have a .exe which I will be passing different parameters (file paths) to which it will then take in and parse. So I will have a loop going, looping through the file paths in a list and passing them to this .exe file. For this to be more efficient, I want to spread the execution across multiple cores which I think you do through threading. My question is, should I use the threadpool, or multiple threads to run this .exe asynchronously? Also, depending on which one of those you guys think is the best, if you can point me to a tutorial that

Multi-threading for multi-core processors

微笑、不失礼 提交于 2019-11-30 23:54:45
I have Samsung Galaxy S3, which used its own Exynos 4 Quad processor. So I want to optimize my app, that it can use all 4 cores of processor. So I made some tests: Run task in one thread. Processing time - 8 seconds. Run task in four threads. Processing time - still 8 sec. new Thread() { public void run() { // do 1/4 of task } }.start(); new Thread() { public void run() { // do 1/4 of task } }.start(); new Thread() { public void run() { // do 1/4 of task } }.start(); new Thread() { public void run() { // do 1/4 of task } }.start(); Run task in ExecutorService. And processing time - still 8 sec

“foreach” loop : Using all cores in R (especially if we are sending sql queries inside foreach loop)

我的未来我决定 提交于 2019-11-30 23:45:23
I intend to use "foreach" to uitlize all the cores in my CPU. The catch is i need to send a sql query inside the loop. The script is working fine with normal 'for' loop, but it is giving following error when i change it to 'foreach'. The error is : select: Interrupted system call select: Interrupted system call select: Interrupted system call Error in { : task 1 failed - "expired MySQLConnection" The code i used is : library(foreach) library(doMC) library(RMySQL) library(multicore) registerDoMC(cores=6) m <- dbDriver("MySQL", max.con = 100) con <- dbConnect(m, user="*****", password = "******"

Using R Parallel with other R packages

拥有回忆 提交于 2019-11-30 22:22:04
I am working on a very time intensive analysis using the LQMM package in R. I set the model to start running on Thursday, it is now Monday, and is still running. I am confident in the model itself (tested as a standard MLM), and I am confident in my LQMM code (have run several other very similar LQMMs with the same dataset, and they all took over a day to run). But I'd really like to figure out how to make this run faster if possible using the parallel processing capabilities of the machines I have access to (note all are Microsoft Windows based). I have read through several tutorials on using

How to get usage of each cpu core on android

拟墨画扇 提交于 2019-11-30 20:30:10
问题 I develop a widget on Android which display many useful informations. I am trying to modify this method to return the percent of use of one cpu core, in order to have the percent of use of each core !!! On my HTC One X, i have in " /proc/stat ": cpu 183549 10728 236016 3754379 7530 41 1013 0 0 0 cpu0 141962 5990 196956 720894 3333 41 970 0 0 0 cpu1 23400 2550 23158 980901 2211 0 23 0 0 0 cpu2 13602 1637 12561 1019126 1216 0 18 0 0 0 cpu3 4585 551 3341 1033458 770 0 2 0 0 0 I use this method