Skip to content

Commit

Permalink
Merge pull request #142 from codeplaysoftware/rod-090522
Browse files Browse the repository at this point in the history
Updates to instructions for DevCloud and adding q files that are a bi…
  • Loading branch information
rodburns authored May 9, 2022
2 parents 3c19693 + 9c119e4 commit 8699afb
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 5 deletions.
49 changes: 49 additions & 0 deletions Code_Exercises/Exercise_02_Hello_World/q
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
#==========================================
# Copyright © Intel Corporation
#
# SPDX-License-Identifier: MIT
#==========================================
# Script to submit job in Intel(R) DevCloud
# Version: 0.71
#==========================================
if [ -z "$1" ]; then
echo "Missing script argument, Usage: ./q run.sh"
elif [ ! -f "$1" ]; then
echo "File $1 does not exist"
else
echo "Job has been submitted to Intel(R) DevCloud and will execute soon."
echo ""
script=$1
# Remove old output files
rm *.sh.* > /dev/null 2>&1
# Submit job using qsub
qsub_id=`qsub -l nodes=1:gpu:ppn=2 -d . $script`
job_id="$(cut -d'.' -f1 <<<"$qsub_id")"
# Print qstat output
qstat
# Wait for output file to be generated and display
echo ""
echo -ne "Waiting for Output "
until [ -f $script.o$job_id ]; do
sleep 1
echo -ne ""
((timeout++))
# Timeout if no output file generated within 60 seconds
if [ $timeout == 70 ]; then
echo ""
echo ""
echo "TimeOut 60 seconds: Job is still queued for execution, check for output file later ($script.o$job_id)"
echo ""
break
fi
done
# Print output and error file content if exist
if [ -n "$(find -name '*.sh.o'$job_id)" ]; then
echo " Done⬇"
cat $script.o$job_id
cat $script.e$job_id
echo "Job Completed in $timeout seconds."
rm *.sh.*$job_id > /dev/null 2>&1
fi
fi
49 changes: 49 additions & 0 deletions Code_Exercises/Exercise_03_Scalar_Add/q
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
#==========================================
# Copyright © Intel Corporation
#
# SPDX-License-Identifier: MIT
#==========================================
# Script to submit job in Intel(R) DevCloud
# Version: 0.71
#==========================================
if [ -z "$1" ]; then
echo "Missing script argument, Usage: ./q run.sh"
elif [ ! -f "$1" ]; then
echo "File $1 does not exist"
else
echo "Job has been submitted to Intel(R) DevCloud and will execute soon."
echo ""
script=$1
# Remove old output files
rm *.sh.* > /dev/null 2>&1
# Submit job using qsub
qsub_id=`qsub -l nodes=1:gpu:ppn=2 -d . $script`
job_id="$(cut -d'.' -f1 <<<"$qsub_id")"
# Print qstat output
qstat
# Wait for output file to be generated and display
echo ""
echo -ne "Waiting for Output "
until [ -f $script.o$job_id ]; do
sleep 1
echo -ne ""
((timeout++))
# Timeout if no output file generated within 60 seconds
if [ $timeout == 70 ]; then
echo ""
echo ""
echo "TimeOut 60 seconds: Job is still queued for execution, check for output file later ($script.o$job_id)"
echo ""
break
fi
done
# Print output and error file content if exist
if [ -n "$(find -name '*.sh.o'$job_id)" ]; then
echo " Done⬇"
cat $script.o$job_id
cat $script.e$job_id
echo "Job Completed in $timeout seconds."
rm *.sh.*$job_id > /dev/null 2>&1
fi
fi
49 changes: 49 additions & 0 deletions Code_Exercises/Exercise_04_ND_Range_Kernel/q
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
#==========================================
# Copyright © Intel Corporation
#
# SPDX-License-Identifier: MIT
#==========================================
# Script to submit job in Intel(R) DevCloud
# Version: 0.71
#==========================================
if [ -z "$1" ]; then
echo "Missing script argument, Usage: ./q run.sh"
elif [ ! -f "$1" ]; then
echo "File $1 does not exist"
else
echo "Job has been submitted to Intel(R) DevCloud and will execute soon."
echo ""
script=$1
# Remove old output files
rm *.sh.* > /dev/null 2>&1
# Submit job using qsub
qsub_id=`qsub -l nodes=1:gpu:ppn=2 -d . $script`
job_id="$(cut -d'.' -f1 <<<"$qsub_id")"
# Print qstat output
qstat
# Wait for output file to be generated and display
echo ""
echo -ne "Waiting for Output "
until [ -f $script.o$job_id ]; do
sleep 1
echo -ne ""
((timeout++))
# Timeout if no output file generated within 60 seconds
if [ $timeout == 70 ]; then
echo ""
echo ""
echo "TimeOut 60 seconds: Job is still queued for execution, check for output file later ($script.o$job_id)"
echo ""
break
fi
done
# Print output and error file content if exist
if [ -n "$(find -name '*.sh.o'$job_id)" ]; then
echo " Done⬇"
cat $script.o$job_id
cat $script.e$job_id
echo "Job Completed in $timeout seconds."
rm *.sh.*$job_id > /dev/null 2>&1
fi
fi
49 changes: 49 additions & 0 deletions Code_Exercises/Exercise_05_Image_Convolution/q
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
#==========================================
# Copyright © Intel Corporation
#
# SPDX-License-Identifier: MIT
#==========================================
# Script to submit job in Intel(R) DevCloud
# Version: 0.71
#==========================================
if [ -z "$1" ]; then
echo "Missing script argument, Usage: ./q run.sh"
elif [ ! -f "$1" ]; then
echo "File $1 does not exist"
else
echo "Job has been submitted to Intel(R) DevCloud and will execute soon."
echo ""
script=$1
# Remove old output files
rm *.sh.* > /dev/null 2>&1
# Submit job using qsub
qsub_id=`qsub -l nodes=1:gpu:ppn=2 -d . $script`
job_id="$(cut -d'.' -f1 <<<"$qsub_id")"
# Print qstat output
qstat
# Wait for output file to be generated and display
echo ""
echo -ne "Waiting for Output "
until [ -f $script.o$job_id ]; do
sleep 1
echo -ne ""
((timeout++))
# Timeout if no output file generated within 60 seconds
if [ $timeout == 70 ]; then
echo ""
echo ""
echo "TimeOut 60 seconds: Job is still queued for execution, check for output file later ($script.o$job_id)"
echo ""
break
fi
done
# Print output and error file content if exist
if [ -n "$(find -name '*.sh.o'$job_id)" ]; then
echo " Done⬇"
cat $script.o$job_id
cat $script.e$job_id
echo "Job Completed in $timeout seconds."
rm *.sh.*$job_id > /dev/null 2>&1
fi
fi
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ topic. Each exercise has a markdown document instructing what to do in the
exercise, a source file to start with and a solution file to provide an
example implementation to compare against.

## Setting up the Intel DevCloud

There are multiple SYCL implementations but for simplicity due to the limited
time during the SYCLcon training we will use the Intel DevCloud which is
pre-configured with the DPC++ compiler.

Go to the [Intel DevCloud](https://tinyurl.com/getdevcloud) to set up your
environment. You will need to register or log in.

There are two options to connect to the DevCloud: via SSH or using JupyterLab.
It is recommended to use the JupyterLab terminal for simplicity.

Go to [this page](https://devcloud.intel.com/oneapi/get_started/) and scroll to the
bottom of the page. Then click on the 'Launch JupyterLab*' link on the bottom of the
page to connect with the Jupyter* Lab.

You will then see a "Welcome to Jupyter Notebooks on the Intel DevCloud for oneAPI
Projects!" document which covers the basics of the JupyterLab access to the Intel
DevCloud for oneAPI Projects.

**To do the exercises for this tutorial select File -> New -> Terminal and open a
terminal window. This gives you command line access to the cloud machine.**

## Lesson Curriculum for IWOCL & SYCLcon 22

The SYCL Academy curriculum is divided up into a number of short lessons
Expand All @@ -51,11 +74,6 @@ support both academic and training style teaching environments.

The exercises can be built using the command listed in the individual exercise README.

### Supported Platforms

For simplicity, attendees of the tutorial will use the [Intel DevCloud](https://tinyurl.com/getdevcloud)
for the exercises. Go to this url to set up your environment.

## What is SYCL?

If you're not familiar with SYCL or would like some further resources for
Expand Down

0 comments on commit 8699afb

Please sign in to comment.