|
@@ -11,7 +11,7 @@
|
|
"cell_type": "markdown",
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"source": [
|
|
"source": [
|
|
- "This version of the lab is intended for C/C++ programmers. The Fortran version of this lab is available [here](../Fortran/jupyter_notebook/openacc_fortran_lab3.ipynb)."
|
|
|
|
|
|
+ "This version of the lab is intended for C/C++ programmers. The Fortran version of this lab is available [here](../../Fortran/jupyter_notebook/openacc_fortran_lab3.ipynb)."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -46,9 +46,9 @@
|
|
"\n",
|
|
"\n",
|
|
"## Introduction\n",
|
|
"## Introduction\n",
|
|
"\n",
|
|
"\n",
|
|
- "Our goal for this lab is to use the OpenACC Loop clauses to opimize our Parallel Loops.\n",
|
|
|
|
|
|
+ "Our goal for this lab is to use the OpenACC Loop clauses to optimize our Parallel Loops.\n",
|
|
" \n",
|
|
" \n",
|
|
- "<img src=\"../files/images/development-cycle.png\" alt=\"OpenACC development cycle\" width=\"50%\">\n",
|
|
|
|
|
|
+ "<img src=\"images/development-cycle.png\" alt=\"OpenACC development cycle\" width=\"50%\">\n",
|
|
"\n",
|
|
"\n",
|
|
"This is the OpenACC 3-Step development cycle.\n",
|
|
"This is the OpenACC 3-Step development cycle.\n",
|
|
"\n",
|
|
"\n",
|
|
@@ -78,7 +78,7 @@
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
- "!pgcc -fast -ta=tesla:cc70 -Minfo=accel -o laplace_baseline laplace2d.c jacobi.c && ./laplace_baseline"
|
|
|
|
|
|
+ "!cd ../source_code/lab3 && make clean && make && ./laplace"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -87,10 +87,10 @@
|
|
"source": [
|
|
"source": [
|
|
"### Optional: Analyze the Code\n",
|
|
"### Optional: Analyze the Code\n",
|
|
"\n",
|
|
"\n",
|
|
- "If you would like a refresher on the code files that we are working on, you may view both of them using the two links below by openning the downloaded file.\n",
|
|
|
|
|
|
+ "If you would like a refresher on the code files that we are working on, you may view both of them using the two links below by opening the downloaded file.\n",
|
|
"\n",
|
|
"\n",
|
|
- "[jacobi.c](jacobi.c) \n",
|
|
|
|
- "[laplace2d.c](laplace2d.c) "
|
|
|
|
|
|
+ "[jacobi.c](../source_code/lab3/jacobi.c) \n",
|
|
|
|
+ "[laplace2d.c](../source_code/lab3/laplace2d.c) "
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -158,7 +158,7 @@
|
|
"source": [
|
|
"source": [
|
|
"#### Implementing the Collapse Clause\n",
|
|
"#### Implementing the Collapse Clause\n",
|
|
"\n",
|
|
"\n",
|
|
- "From the top menu, click on *File*, and *Open* `laplace2d.c` from the current directory at `lab3/English/C` directory. Use the **collapse clause** to collapse our multi-dimensional loops into a single dimensional loop.\n",
|
|
|
|
|
|
+ "From the top menu, click on *File*, and *Open* `laplace2d.c` from the current directory at `English/C/source_code/lab3` directory. Use the **collapse clause** to collapse our multi-dimensional loops into a single dimensional loop.\n",
|
|
"\n",
|
|
"\n",
|
|
"Remember to **SAVE** your code after changes, before running below cells.\n",
|
|
"Remember to **SAVE** your code after changes, before running below cells.\n",
|
|
"\n",
|
|
"\n",
|
|
@@ -171,7 +171,7 @@
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
- "!pgcc -ta=tesla:cc70 -Minfo=accel -o laplace_collapse jacobi.c laplace2d.c && ./laplace_collapse"
|
|
|
|
|
|
+ "!cd ../source_code/lab3 && make clean && make && ./laplace"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -281,7 +281,7 @@
|
|
"source": [
|
|
"source": [
|
|
"#### Implementing the Tile Clause\n",
|
|
"#### Implementing the Tile Clause\n",
|
|
"\n",
|
|
"\n",
|
|
- "From the top menu, click on *File*, and *Open* `laplace2d.c` from the current directory at `lab3/English/C` directory. Replace the `collapse` clause with the `tile` clause to break our multi-dimensional loops into smaller tiles. Try using a variety of different tile sizes, but for now keep one of the dimensions as a **multiple of 32**. We will talk later about why this is important.\n",
|
|
|
|
|
|
+ "From the top menu, click on *File*, and *Open* `laplace2d.c` from the current directory at `English/C/source_code/lab3` directory. Replace the `collapse` clause with the `tile` clause to break our multi-dimensional loops into smaller tiles. Try using a variety of different tile sizes, but for now keep one of the dimensions as a **multiple of 32**. We will talk later about why this is important.\n",
|
|
"\n",
|
|
"\n",
|
|
"Remember to **SAVE** your code after changes, before running below cells.\n",
|
|
"Remember to **SAVE** your code after changes, before running below cells.\n",
|
|
"\n",
|
|
"\n",
|
|
@@ -294,7 +294,7 @@
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
- "!pgcc -ta=tesla:cc70 -Minfo=accel -o laplace_tile jacobi.c laplace2d.c && ./laplace_tile"
|
|
|
|
|
|
+ "!cd ../source_code/lab3 && make clean && make && ./laplace"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -347,7 +347,7 @@
|
|
"\n",
|
|
"\n",
|
|
"## Bonus Task (More about Gangs, Workers, and Vectors)\n",
|
|
"## Bonus Task (More about Gangs, Workers, and Vectors)\n",
|
|
"\n",
|
|
"\n",
|
|
- "This week's bonus task is to learn a bit more about how OpenACC breaks up the loop iterations into *gangs*, *workers*, and *vectors*, which was discussed very briefly in the first lab. [Click Here](Bonus.ipynb) for more information about these *levels of parallelism*.\n"
|
|
|
|
|
|
+ "This week's bonus task is to learn a bit more about how OpenACC breaks up the loop iterations into *gangs*, *workers*, and *vectors*, which was discussed very briefly in the first lab. [Click Here](openacc_c_lab3-bonus.ipynb) for more information about these *levels of parallelism*.\n"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -368,6 +368,7 @@
|
|
"outputs": [],
|
|
"outputs": [],
|
|
"source": [
|
|
"source": [
|
|
"%%bash\n",
|
|
"%%bash\n",
|
|
|
|
+ "cd ..\n",
|
|
"rm -f openacc_files.zip\n",
|
|
"rm -f openacc_files.zip\n",
|
|
"zip -r openacc_files.zip *"
|
|
"zip -r openacc_files.zip *"
|
|
]
|
|
]
|
|
@@ -376,7 +377,13 @@
|
|
"cell_type": "markdown",
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"source": [
|
|
"source": [
|
|
- "**After** executing the above zip command, you should be able to download the zip file [here](files/openacc_files.zip)"
|
|
|
|
|
|
+ "**After** executing the above zip command, you should be able to download the zip file [here](../openacc_files.zip)\n",
|
|
|
|
+ "\n",
|
|
|
|
+ "--- \n",
|
|
|
|
+ "\n",
|
|
|
|
+ "## Licensing \n",
|
|
|
|
+ "\n",
|
|
|
|
+ "This material is released by NVIDIA Corporation under the Creative Commons Attribution 4.0 International (CC BY 4.0). "
|
|
]
|
|
]
|
|
}
|
|
}
|
|
],
|
|
],
|