高性能计算习题及答案

  • 格式:doc
  • 大小:1.47 MB
  • 文档页数:15

高性能计算练习题 1、 一下哪种编程方式适合在单机内并行?哪种适合在多机间并行? 单机:Threading线程、OpenMP;多机:MPI。 2、 例题:HPC集群的峰值计算能力: 一套配置256个双路X5670处理器计算节点的HPC集群。X5560:2.93GHz Intel XS5670 Westmere六核处理器,目前主流的Intel处理器每时钟周期提供4个双精度浮点计算。峰值计算性能:2.93GHz*4Flops/Hz*6Core*2CPU*256节点=36003.8GFlops。Gflops=10亿次,所以36003Gflops=36.003TFlops=36.003万亿次每秒的峰值性能。 3、 Top500排名的依据是什么?High Performance Linpack(HPL)测试结果 4、 目前最流行的GPU开发环境是什么?CUDA 5、 一套配置200TFlops的HPC集群,如果用双路2.93GHz Intel westmere六核处理器X5670来构建,需要用多少个计算节点? 计算节点数=200TFlops/(2*2.93GHz*6*4Flops/Hz)=1422 6、 天河1A参与TOP500排名的实测速度是多少,效率是多少? 2.57PFlops 55% 7、 RDMA如何实现? RDMA(Remote Direct Memory Access),数据发送接收时,不用将数据拷贝到缓冲区中,而直接将数据发送到对方。绕过了核心,实现了零拷贝。 8、InfiniBand的最低通讯延迟是多少? 1-1.3usec MPI end-to-end, 0.9-1us InfiniBand latency for RDMA operations 9、GPU-Direct如何加速应用程序运行速度? 通过除去InfiniBand和GPU之间的内存拷贝来加速程序运行。 •GPUs provide cost effective way for building supercomputers 【GPUs提供高效方式建立超级计算机】 •Dense packaging of compute flops with high memory bandwidth 【使用高端内存带宽的密级封装浮点计算】 10、网络设备的哪个特性决定了MPI_Allreduce性能?集群大小,Time for MPI_Allreduce keeps increasing as cluster size scales,也就是说集群的规模决定了MPI_Allreduce的性能。 11、现排名世界第一的超级计算机的运行速度?K computer: 10PFlops 也就是10千万亿次,93% 12、以下哪些可以算作是嵌入式设备: A 路由器 B机器人 C微波炉 D笔记本电脑 13、选择嵌入式操作系统的头两个因素是: A 成本 B 售后服务 C可获得源代码 D相关社区 E开发工具 14、构建嵌入式Linux的主要挑战是: A 需要广博的知识面 B深度定制的复杂性 C日益增加的维护成本 D稳定性与安全性 E开源项目通常质量低下 15、The Yocto Project的主要目的是: A. 构建一个统一的嵌入式Linux社区 B. 提供高质量的工具帮助你轻松构建嵌入式Linux, 从而专注于其上的研究工作 C. 包括一组经过测试的metadata,指导最核心的一些开源项目的交叉编译过程 D. 提供灵活的扩展接口,可以方便的导入新的项目, 或是新的板级支持包(BSP) 16、请描述交叉编译一个开源项目需要完成哪些工作? Patch-Configure-Compile-Install-Sysroot-Package-Do_rootfs 17. Top500排名的依据是什么? 答:High Performance Linpack(HPL)测试结果 18.Write codes to create a thread to compute the sum of the elements of an array. 答:Create a thread to complete the sum of the elements of an array. struct arguments { double *array; int size; double *sum; } int main(int argc, char *argv) { double array[100]; double sum; pthread_t worker_thread; struct arguments *arg;

arg = (struct arguments *)calloc(1, sizeof(struct arguments)); arg->array = array; arg->size=100; arg->sum = ∑

if (pthread_create(&worker_thread, NULL, do_work, (void *)arg)) { fprintf(stderr,”Error while creating thread\n”); exit(1); } ... }

void *do_work(void *arg) { struct arguments *argument; int i, size; double *array; double *sum;

argument = (struct arguments*)arg;

size = argument->size; array = argument->array; sum = argument->sum;

*sum = 0; for (i=0;i *sum += array[i];

return NULL; } 19. Give a good option to compute for load balancing. (n=16 and there are 4 processors)

20.Please list the ways for improving performance. Option #1: Buy Faster Hardware Option #2: Modify the algorithm Option #3: Modify the data structures Option #4: Modify the implementation Option #5: Use concurrency

21、If a code is 10% sequential, and there are 4 processors, please calculate the speedup. F=10% T1=0.1T1+0.9T1 T4=0.1T1+0.9T1/4=0.325T1 Speedup=T1/T4=3.077

22.Please show the process of n-pipelined execution of 4 tasks to achieve higher throughput (i.e. number of tasks per time unit) if each task has 4 sequential stages which take 1, 2, 5, 1 time unit respectively.

time=1+2+5*4+1=24 23.128个双路2.66GHz Intel Nehalem 四核处理器计算节点的HPC集群,其峰值计算是多少 128*2*2.66G*4*4(一个时钟周期可进行4次浮点运算)=10,895GFlops

24.并行计算提出的原因 提高性能和存储能力;使用户和计算机之间相互协调;获得一个问题的逻辑结构;处理独立的物理设备 25. 并行的三大问题:性能,准确性,可编程性Programmability RISC :Reduced Instruction Set Computing CISC :Complex Instruction Set Computer MIPS:Million Instructions Per Second ILP :Instruction Level Parallelism 指令层并行. SMT :Simultaneous Multi Threading 同时多线程 SMP :Symmetric Multi-Processors SISD :Single instruction single data SIMD :Single instruction multiple data 单指令流多数据流 MIMD :Multiple instructions multiple data MISD:Multiple instructions single data MPP :Massively Parallel Processor大规模并行处理器 26. 在一个CPU中可通过几种技术实现并发机制 流水线:Pipelining , RISC体系结构 如果一个处理器要处理若干个任务,且每个任务有相同的n个步骤组成,不同部分又可同时执行,则处理器可采取流水线方式处理这些任务。流水线的任务是获得高的吞吐量。当任务数很多时,系统吞吐量接近于 1 / 最大子任务持续时间

RISC的思想是:使所有指令由相同数量的持续时间相同的步骤。