convert \ original.jpg \ -quality 85 \ -colorspace rgb \ -profile /var/tmp/sRGB.icm \ -strip \ -profile /var/tmp/sRGB.icm \ -filter Lanczos \ -write mpr:17JPCONV1-original \ +delete \ mpr:17JPCONV1-original -crop '3000x2001+0+491' -resize '190x126!>' -write thumbWide.jpg +delete \ mpr:17JPCONV1-original -crop '2981x2983+8+0' -resize '75x75!>' -write thumbStandard.jpg +delete \ mpr:17JPCONV1-original -crop '3000x2983+0+0' -resize '163x163!>' -write hpSmall.jpg +delete \ mpr:17JPCONV1-original -crop '3000x2983+0+0' -resize '1024x1019!>' -write jumbo.jpg +delete \ mpr:17JPCONV1-original -crop '3000x2983+0+0' -resize '190x189!>' -write articleInline.jpg +delete \ mpr:17JPCONV1-original -crop '3000x2983+0+0' -resize …
我试图找到在 GNU/linux 中进行全屏连续截图的最快方法,而无需任何人工干预。到目前为止,我得到:
$ time for i in {1..10}; do import -window root test-$i.png; done
real 0m9.742s
user 0m11.324s
sys 0m0.584s
$ time for i in {1..10}; do scrot test-$i.png; done
real 0m1.686s
user 0m1.528s
sys 0m0.060s
Run Code Online (Sandbox Code Playgroud)
但是,我想要比 scrot 更快的东西。系统时间是在一台不错的(硬件方面的)台式电脑(运行 Ubuntu Linux)中进行的。有趣的是它托管了一个 kvm 机器(CrunchBang Linux),它返回:
$ time for i in {1..10}; do import -window root test-$i.png; done
real 0m7.591s
user 0m6.096s
sys 0m0.196s
$ time for i in {1..10}; do scrot test-$i.png; done
real 0m2.921s
user 0m2.440s
sys 0m0.120s
Run Code Online (Sandbox Code Playgroud)
因此, …
我刚用一个简单的c程序尝试过OpenMP
test() {
for(int i=0;i<100000000;i++);
}
main() {
printf("Num of CPU: %d\n", omp_get_num_procs());
#pragma omp parallel for num_threads(4)
for(int i=0;i<100;i++) test();
}
Run Code Online (Sandbox Code Playgroud)
编译g++ -fopenmp.它可以正确打印出我有4个CPU,但所有测试功能都在运行thread 0.
我试着修改了OMP_NUM_THREADS.但它也没有效果.
我有一切与在线示例相同,但为什么我不能让它工作?