DPC-experiments
This repository hosts experiments with DPC++ (Data Parallel C++).
For more information on DPC++, see https://software.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-programming-model/data-parallel-c-dpc.html
DPCDemo
Purpose
DPCDemo is a particle simulator to test fan performance
https://devmesh.intel.com/projects/fan-efficiency-particle-simulation
While work on DPCDemo has concluded, there are many improvements that can be made. For more information, see the DevMesh project post for this project: https://devmesh.intel.com/projects/fan-efficiency-particle-simulation
Usage
- Build (See "Building" below)
- Run
DPCDemo.exe
- Specify
--device <device_type>
to use a different device. - Specify
--input <input-file>
to specify a different fan to test the performance of.
- Specify
Running on DevCloud
- Build using the "Building in DevCloud" section below.
make run
to run locally.
Queue run on a CPU
qsub -d . devcloud-run-cpu.sh
- Watch for the STDOUT output file to be created from the run.
nano devcloud-run-cpu.sh.oABCDEF
to inspect the output!
Queue run on a GPU
qsub -l nodes=1:gpu:ppn=2 -d . devcloud-run-gpu.sh
- Watch for the STDOUT output file to be created from the run.
nano devcloud-run-gpu.sh.oABCDEF
to inspect the output!
Queue run on an FPGA
Unfortunately this application appears to be too large to build for an FPGA:
$ dpcpp SimConstants.h Simulation.h Simulation.cpp Random.h Random.cpp RandData.h RandData.cpp Particle.h Particle.cpp ModelLoader.h ModelLoader.cpp FanMesh.h ExitingParticle.h DPCDemo.cpp DeviceQuerier.h DeviceQuerier.cpp -Idevcloud-dep/include -std=c++17 -fintelfpga -Xshardware
Out of memory in module quartus_sh (1023 megabytes used).
...
dpcpp: error: fpga compiler command failed with exit code 1 (use -v to see invocation)
$
Sample DevCloud Output (CPU)
See the following files:
Sample DevCloud Output (GPU)
See the following files:
Building
Because DPCDemo relies on locally-installed technologies, there's no release -- you'll need to build DPCDemo from source using the instructions below.
Build Locally (Windows, Visual Studio Community 2019)
- Install the Intel oneAPI DPC++/C++ compiler
- Get 'vcpkg' to install dependent libraries
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
- Install dependent libraries using 'vcpkg' and integrate them into Visual Studio
vcpkg install glew:x64-windows glfw3:x64-windows glm:x64-windows imgui:x64-windows libigl[imgui]:x64-windows magic-enum:x64-windows stb:x64-windows argparse:x64-windows
vcpkg integrate install
- Download this repository
git clone https://github.com/GuMiner/DPC-experiments.git
- Open in Visual Studio, build, and run!
- Edit
SimConstants.h
to change any settings as desired.
- Edit
Building in DevCloud
Setup
ssh devcloud
git clone https://github.com/GuMiner/DPC-experiments
cd DPC-experiments/DPCDemo
nano SimConstants.h
and set ENABLE_GUI to 0
Queue build
qsub -d . devcloud-build.sh
- If this is running into problems (for instance, if 'a.out' isn't generated), locally run
devcloud-build.sh
ormake all
watch -n 1 qstat -n -1
- This will show the status of the build job, if running.
Inspiration
This application was inspired by the The Great Cross Architecture Challenge.
Results
For more information on these results and what they mean, see https://devmesh.intel.com/projects/fan-efficiency-particle-simulation
Because randomness in this program is seeded, see either the CPU or GPU results in the devcloud-gpu-cpu-output folder.
For a direct link to the CPU results, use the links below: