Skip to content

Commit

Permalink
Merge pull request #32 from MonashDeepNeuron/dev
Browse files Browse the repository at this point in the history
HPC Training Book - v1.1.0
  • Loading branch information
oraqlle committed Apr 22, 2023
2 parents d55f4ba + e386efa commit a380522
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/chapter1/challenges.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ To get setup:
- Click the link above to go to the repository on GitHub.
- Click 'Use this template' button (green) and select 'Create a new repository'.
- Give it a name and make sure it is private.
- Ensure you are copying it to your personal account and not the Monash DeepNeuron organisation. There will be a dropdown next to where you give the repo a name from which you can select your account.
- Click 'Create repository from template'.
- This will open the page for the repository. Click the '<> Code' button (green), make sure you are in the HTTPS tab and copy the link.
- Open a terminal in your dev directory.
Expand Down
4 changes: 4 additions & 0 deletions src/chapter1/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ Once you have signed up for GitHub, you will need to provide your instructors wi
## Watching Repositories

GitHub allows you 'watch' repositories. This means you'll be notified of changes to the repository so that you can keep on top of is happening with various projects. You'll be using this later in your training.

## Download GitHub Mobile

We would also request you install the GitHub mobile app. This can make it easier to login to your account (2FA), interact in discussions, reply to mentions and manage repositories and projects when you aren't at your computer.
38 changes: 27 additions & 11 deletions src/chapter2/challenges.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,53 @@

The challenges for this chapter can found in the [HPC Training Challenges](https://github.com/MonashDeepNeuron/HPC-Training-Challenges) you should have cloned in the previous chapter. Remember to read the README's for each challenge for more details. Your attempts should be added and pushed to this repo in the corresponding directories and files.

> Note:
>
> Do not forget to add a `main()` function which is used to run/test your solutions.
## Overview

- [Challenges](#challenges)
- [Overview](#overview)
- [Challenge 1 - Hello World](#challenge-1---hello-world)
- [Challenge 2 - Fibonacci](#challenge-2---fibonacci)
- [Challenge 3 - GCD \& LCM](#challenge-3---gcd--lcm)
- [Challenge 4 - Bitwise Multiply](#challenge-4---bitwise-multiply)
- [Challenge 5 - Sum and Product Algorithms](#challenge-5---sum-and-product-algorithms)
- [Challenge 6 - Array Concatenation](#challenge-6---array-concatenation)
- [Challenge 2 - FizzBuzz](#challenge-2---fizzbuzz)
- [Challenge 3 - Fibonacci](#challenge-3---fibonacci)
- [Challenge 4 - GCD \& LCM](#challenge-4---gcd--lcm)
- [Challenge 5 - Bitwise Add](#challenge-5---bitwise-add)
- [Challenge 6 - Bitwise Multiply](#challenge-6---bitwise-multiply)
- [Challenge 7 - Sum and Product Algorithms](#challenge-7---sum-and-product-algorithms)
- [Challenge 8 - Array Concatenation](#challenge-8---array-concatenation)

## Challenge 1 - Hello World

You're first challenge is to build and run 'Hello World!' on your own device. This should be relatively straight forward as there are no moving parts and the instructions are explicitly given at the start oft he chapter.

## Challenge 2 - Fibonacci
## Challenge 2 - FizzBuzz

Create a program called `fizzbuzz.c` that prints the numbers from `0..100` (inclusive) but every number divisible by `3` prints `Fizz` instead and any number divisible by `5` prints `Buzz` and any number divisible by both prints `Fizzbuzz`.

## Challenge 3 - Fibonacci

Create a program called `fib.c` that calculates the first ten fibonacci numbers and prints them to the terminal. The implementation is up to you however, it cannot hard code the values into the program.

## Challenge 3 - GCD & LCM
## Challenge 4 - GCD & LCM

This challenge consists of two tasks. The first is to create the G.C.D. (Greatest Common Divisor) algorithm. This can be done using whatever techniques you want. The second is to create the L.C.M. (Least Common Multiple) algorithm. This is a bit less common than G.C.D. so you may need to research a bit about it first.

## Challenge 4 - Bitwise Multiply
## Challenge 5 - Bitwise Add

For this challenge you have to implement a function called `bitwise_add()` which, given two integers returns their sum using bitwise arithmetic. Any bitwise operators are allowed as well as conditional operators (eg. `==`, `<`). You can use regular arithmetic operators (eg. `+`, `*`) if it is necessary to perform other intermediate calculations but it is possible to solve this challenge without them.

## Challenge 6 - Bitwise Multiply

This challenge is similar to the last but instead of implementing `+` you must implement `*` (product). Your implementation should be contained in a function called `bitwise_multiply()`. You can use any bitwise or conditional operators.

For this challenge you have to implement a function called `bitwise_multiply()` which, given two integers returns their product using bitwise arithmetic. Other operators are allowed, just not binary `*`.
> Note: If you need `+` you can reimplement it internally in `bitwise_multiply` based on your solution from the previous challenge, import it to a header in this challenges folder and include it or copy it to this folder. Ask a trainer if you get stuck with this.
## Challenge 5 - Sum and Product Algorithms
## Challenge 7 - Sum and Product Algorithms

This challenge involves implementing the sum and product reductions on an array or memory block of integers. As a bonus challenge, try and make the algorithms more generic and work with any binary operator.

## Challenge 6 - Array Concatenation
## Challenge 8 - Array Concatenation

In this challenge you have to implement a general array concatenation function. This should join two arrays of the same type into a single array similar to `strcat()`. As an extra challenge, implement this concatenation algorithm so that if the destination buffer is not large enough, a new buffer of the required size is created and returns the pointer to the new buffer.
4 changes: 2 additions & 2 deletions src/chapter4/multithreading.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Before you run your job, it’s important to check the available resources.

Command:
```bash
#SBATCH`--flag=value
#SBATCH --flag=value
```

![sbatch Command](imgs/sbatch%20Command.png)
Expand All @@ -62,4 +62,4 @@ squeue -u <username>
![squeue Command](imgs/squeue%20Command.png)

After you submitted your job, you can use the command squeue to monitor your job
you can see the status of your job to check whether it’s pending or running and also how long has it been since the job has started.
you can see the status of your job to check whether it’s pending or running and also how long has it been since the job has started.
2 changes: 1 addition & 1 deletion src/version.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 1.0.0
version: 1.1.0

0 comments on commit a380522

Please sign in to comment.