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++/ParallelPatterns/histogram/README.md
+108-1Lines changed: 108 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,11 @@ Code samples are licensed under the MIT license. See
30
30
Third party program Licenses can be found here: [third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt)
31
31
32
32
## Building the histogram program for CPU and GPU
33
-
On a Linux* System
33
+
34
+
### Running Samples In DevCloud
35
+
Running samples in the Intel DevCloud requires you to specify a compute node. For specific instructions, jump to [Run the Histogram sample on the DevCloud](#run-histogram-on-devcloud)
4. Change directories to the Hidden Markov Model sample directory.
95
+
```
96
+
cd ~/oneAPI-samples/DirectProgramming/DPC++/ParallelPatterns/histogram
97
+
```
98
+
#### Build and run the sample in batch mode
99
+
The following describes the process of submitting build and run jobs to PBS.
100
+
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.
101
+
102
+
#### Create the Job Scripts
103
+
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.
133
+
1. Build the sample on a gpu node.
134
+
135
+
```
136
+
qsub -l nodes=1:gpu:ppn=2 -d . build.sh
137
+
```
138
+
139
+
Note: -l nodes=1:gpu:ppn=2 (lower case L) is used to assign one full GPU node to the job.
140
+
Note: The -d . is used to configure the current folder as the working directory for the task.
141
+
142
+
2. In order to inspect the job progress, use the qstat utility.
143
+
```
144
+
watch -n 1 qstat -n -1
145
+
```
146
+
Note: The watch -n 1 command is used to run qstat -n -1 and display its results every second. If no results are displayed, the job has completed.
147
+
148
+
3. After the build job completes successfully, run the sample on a gpu node:
149
+
```
150
+
qsub -l nodes=1:gpu:ppn=2 -d . run.sh
151
+
```
152
+
4. When a job terminates, a couple of files are written to the disk:
153
+
154
+
<script_name>.sh.eXXXX, which is the job stderr
155
+
156
+
<script_name>.sh.oXXXX, which is the job stdout
157
+
158
+
Here XXXX is the job ID, which gets printed to the screen after each qsub command.
6. Remove the stdout and stderr files and clean-up the project files.
177
+
```
178
+
rm build.sh.*; rm run.sh.*; make clean
179
+
```
180
+
7. Disconnect from the Intel DevCloud.
181
+
```
182
+
exit
183
+
```
184
+
### Build and run additional samples
185
+
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