You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DirectProgramming/DPC++/CombinationalLogic/mandelbrot/README.md
+109-1Lines changed: 109 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Third party program Licenses can be found here: [third-party-programs.txt](https
40
40
The include folder is located at %ONEAPI_ROOT%\dev-utilities\latest\include on your development system.
41
41
42
42
### Running Samples In DevCloud
43
-
If running a sample in the Intel DevCloud, remember that you must specify the compute node (CPU, GPU, FPGA) and whether to run in batch or interactive mode. For more information, see the Intel® oneAPI Base Toolkit Get Started Guide (https://devcloud.intel.com/oneapi/get-started/base-toolkit/)
43
+
Running samples in the Intel DevCloud requires you to specify a compute node. For specific instructions, jump to [Run the sample in the DevCloud](#run-on-devcloud)
44
44
45
45
### On a Linux* System
46
46
Perform the following steps:
@@ -102,3 +102,111 @@ Rendered image output to file: mandelbrot.png (output too large to display in te
102
102
Parallel time: 0.00224131s
103
103
Successfully computed Mandelbrot set.
104
104
```
105
+
### Running the sample in the DevCloud<a name="run-on-devcloud"></a>
4. Change directories to the ISO3DFD OpenMP Offload sample directory.
117
+
```
118
+
cd ~/oneAPI-samples/DirectProgramming/DPC++/CombinationalLogic/mandelbrot
119
+
```
120
+
#### Build and run the sample in batch mode
121
+
The following describes the process of submitting build and run jobs to PBS.
122
+
A job is a script that is submitted to PBS through the qsub utility. By default, the qsub utility does not inherit the current environment variables or your current working directory. For this reason, it is necessary to submit jobs as scripts that handle the setup of the environment variables. In order to address the working directory issue, you can either use absolute paths or pass the -d \<dir\> option to qsub to set the working directory.
123
+
124
+
#### Create the Job Scripts
125
+
1. Create a build.sh script with your preferred text editor:
Jobs submitted in batch mode are placed in a queue waiting for the necessary resources (compute nodes) to become available. The jobs will be executed on a first come basis on the first available node(s) having the requested property or label.
155
+
1. Build the sample on a gpu node.
156
+
157
+
```
158
+
qsub -l nodes=1:gpu:ppn=2 -d . build.sh
159
+
```
160
+
161
+
Note: -l nodes=1:gpu:ppn=2 (lower case L) is used to assign one full GPU node to the job.
162
+
Note: The -d . is used to configure the current folder as the working directory for the task.
163
+
164
+
2. In order to inspect the job progress, use the qstat utility.
165
+
```
166
+
watch -n 1 qstat -n -1
167
+
```
168
+
Note: The watch -n 1 command is used to run qstat -n -1 and display its results every second.
169
+
170
+
3. When the build job completes, there will be a build.sh.oXXXXXX file in the directory. After the build job completes, run the sample on a gpu node:
171
+
```
172
+
qsub -l nodes=1:gpu:ppn=2 -d . run.sh
173
+
```
174
+
4. When a job terminates, a couple of files are written to the disk:
175
+
176
+
<script_name>.sh.eXXXX, which is the job stderr
177
+
178
+
<script_name>.sh.oXXXX, which is the job stdout
179
+
180
+
Here XXXX is the job ID, which gets printed to the screen after each qsub command.
181
+
182
+
5. Inspect the output of the sample.
183
+
```
184
+
cat run.sh.oXXXX
185
+
```
186
+
You should see output similar to this:
187
+
188
+
```
189
+
Platform Name: Intel(R) OpenCL HD Graphics
190
+
Platform Version: OpenCL 2.1
191
+
Device Name: Intel(R) Gen9 HD Graphics NEO
192
+
Max Work Group: 256
193
+
Max Compute Units: 24
194
+
195
+
Parallel Mandelbrot set using buffers.
196
+
Rendered image output to file: mandelbrot.png (output too large to display in text)
197
+
Serial time: 0.0430331s
198
+
Parallel time: 0.00224131s
199
+
Successfully computed Mandelbrot set.
200
+
```
201
+
202
+
6. Remove the stdout and stderr files and clean-up the project files.
203
+
```
204
+
rm build.sh.*; rm run.sh.*; make clean
205
+
```
206
+
7. Disconnect from the Intel DevCloud.
207
+
```
208
+
exit
209
+
```
210
+
### Build and run additional samples
211
+
Several sample programs are available for you to try, many of which can be compiled and run in a similar fashion to this sample. Experiment with running the various samples on different kinds of compute nodes or adjust their source code to experiment with different workloads.
0 commit comments