⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 103.html

📁 国外MPI教材
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />	<style type="text/css">	body { font-family: Verdana, Arial, Helvetica, sans-serif;}	a.at-term {	font-style: italic; }	</style>	<title>Problem encountered with mixing OpenMP and MPI</title>	<meta name="Generator" content="ATutor">	<meta name="Keywords" content=""></head><body> <h3>Environment variables may not be passed properly in MPI</h3>

<p>One problem with the various implementations of MPI and the different startup programs (mpirun, mpiexec, etc.) is that environment variables do not always get passed to the remote MPI processes correctly.&nbsp; This has negative implications for multilevel jobs because each MPI process needs to access the OMP_NUM_THREADS environment variable in order to start up the proper number of OpenMP threads.</p>

<p>The best way to avoid this potential pitfall is to always set the number of OpenMP threads within your code. This can be accomplished with the OMP_SET_NUM_threads routine.</p>

<pre><code>int nthrds
nthreads=5
call omp_set_num_threads(nthrds)</code></pre>

<p>Depending on the compiler used, additional environment variables may need to be set. For general environment variables, the "putenv" routine in the standard C library can be used to set these on each node.</p>

<h3>Calling MPI communication functions within OpenMP parallel regions</h3>

<p>Multilevel works with having OpenMP threads spawned from MPI processes. This is achieved by embedding OpenMP funtion calls and directives within MPI regions.&nbsp; Multilevel does not work the other way, calling MPI communication functions within OpenMP parallel regions.</p>

<p>Calling MPI functions from within an OpenMP parallel region will result in a runtime error.&nbsp; The exact error will differ based upon the machine.</p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -