超级计算机上的 OpenMP
OpenMP on super computer
在我的本地集群上,我可以使用此脚本跨 36 个内核并行化我的 OpenMP 代码
#$ -S /bin/bash
#$ -N name_of_project
#$ -o output.out
#$ -pe orte 36
#$ -V
#$ -cwd
export OMP_NUM_THREADS=36
./my_programme
我可以 运行 一个 OpenMP c++ 代码,跨 36 个内核和 4 个节点...
但是,在作为 XSEDE 一部分的超级计算设施上:
https://portal.xsede.org/tacc-stampede
我被告知我只能 运行 OpenMP 跨越具有 16 个内核的 1 个节点。我有点困惑,所以如果我想让我的程序有效地并行化超过 17 个线程,我必须将我的程序重新编码为 MPI 程序吗?
请问将OpenMP程序转换为MPI程序有多难?谢谢。
If I would like parallelize my programme with effectively more than 17
threads, I have to recode my programme into an MPI programme ?
是的,您需要编写一些 MPI 代码才能利用您可以支配的节点。
OpenMP 以共享内存架构为目标,您需要一个消息传递库以便在节点之间进行通信。
并行化分布式架构是不同的(你不能像在 OpenMP 中那样进行 for 循环并行化),因为每个节点都有自己的共享内存,并且一个节点无法知道其他节点的状态以同步工作。你必须自己做。
I would like to ask how difficult it is to convert a OpenMP programme
into an MPI programme?
MPI 并行化可能非常简单,具体取决于您的应用程序和您编写代码的方式。您应该详细说明您的算法以便进行判断。大行是:
- Embarrasingly parallel problem with static load of work : every MPI node has the same amount of work and do the same job with no or very few interactions with other nodes. If your application enter this category then the parallelization is straighforward and can be done with collective MPI routines。尽管如此,您仍需要编写并理解 MPI 的工作原理。
- 更复杂的并行问题/工作的动态负载:您的问题需要同步,节点之间的一些通信and/or工作量未知,您需要负载平衡策略。这就是 HPC 家伙谋生的方式:)
希望你能进入第一组!
最后,乐趣从这里开始,为了获得良好的加速,您将需要找到折衷方案并尝试一些事情,因为您将拥有混合 OpenMP/MPI 并行化。
在我的本地集群上,我可以使用此脚本跨 36 个内核并行化我的 OpenMP 代码
#$ -S /bin/bash
#$ -N name_of_project
#$ -o output.out
#$ -pe orte 36
#$ -V
#$ -cwd
export OMP_NUM_THREADS=36
./my_programme
我可以 运行 一个 OpenMP c++ 代码,跨 36 个内核和 4 个节点...
但是,在作为 XSEDE 一部分的超级计算设施上:
https://portal.xsede.org/tacc-stampede
我被告知我只能 运行 OpenMP 跨越具有 16 个内核的 1 个节点。我有点困惑,所以如果我想让我的程序有效地并行化超过 17 个线程,我必须将我的程序重新编码为 MPI 程序吗?
请问将OpenMP程序转换为MPI程序有多难?谢谢。
If I would like parallelize my programme with effectively more than 17 threads, I have to recode my programme into an MPI programme ?
是的,您需要编写一些 MPI 代码才能利用您可以支配的节点。 OpenMP 以共享内存架构为目标,您需要一个消息传递库以便在节点之间进行通信。
并行化分布式架构是不同的(你不能像在 OpenMP 中那样进行 for 循环并行化),因为每个节点都有自己的共享内存,并且一个节点无法知道其他节点的状态以同步工作。你必须自己做。
I would like to ask how difficult it is to convert a OpenMP programme into an MPI programme?
MPI 并行化可能非常简单,具体取决于您的应用程序和您编写代码的方式。您应该详细说明您的算法以便进行判断。大行是:
- Embarrasingly parallel problem with static load of work : every MPI node has the same amount of work and do the same job with no or very few interactions with other nodes. If your application enter this category then the parallelization is straighforward and can be done with collective MPI routines。尽管如此,您仍需要编写并理解 MPI 的工作原理。
- 更复杂的并行问题/工作的动态负载:您的问题需要同步,节点之间的一些通信and/or工作量未知,您需要负载平衡策略。这就是 HPC 家伙谋生的方式:)
希望你能进入第一组!
最后,乐趣从这里开始,为了获得良好的加速,您将需要找到折衷方案并尝试一些事情,因为您将拥有混合 OpenMP/MPI 并行化。