Yiling's Tech Zone

Tech blogger, University of Western Australia postgraduate student. Machine Learning/Data Structure & Algorithms/Python/C#/Web backend/JS/Java/R

Leetcode 115. Distinct Subsequences - Python Solution

Leetcode Python Solution

This tutorial comes from my own Medium blog which is no longer to be use. Problem could be found on Leetcode Here Problem Description Given a string S and a string T, count the number of distinc...

Leetcode 268. Missing Number (Python) - Four ways to solve it

Leetcode Python Solution

This tutorial is from my Medium blog, I will no longer to use it because it is not as flexible as markdown format. Problem could be found on Leetcode Here Problem Description Given an array cont...

Enable MPI in Visual Studio

High Performance Computing

Download MPI for Windows(Microsoft MPI) https://www.microsoft.com/en-us/download/details.aspx?id=57467 Run both .exe and .msi file, they will install Microsoft MPI under C:\Program Files\Microsof...

OpenMP - Task and Sections

High Performance Computing

Sections omp sections is quite similar with omp for but much flexible for small number of tasks without iteration relation. It could be seen as a special kind of omp for. Example: #include <s...

OpenMP - Scheduling(static, dynamic, guided, runtime, auto)

High Performance Computing

What is Scheduling in OpenMP Scheduling is a method in OpenMP to distribute iterations to different threads in for loop. The basic form of OpenMP scheduling is #pragma omp parallel for schedule(s...

Enable OpenMP in Visual Studio

High Performance Computing

To use OpenMP in Visual Studio Code, watch tutorial HERE Select Project on the menu, and click project_name Properties inside drop-down window Click C/C++, select Language, change Open MP Suppor...

OpenMP - firstprivate and lastprivate

High Performance Computing

Background We already learned that variables in private is stateless in the previous post OpenMP Private Variable - Understand Why you got error while using it Code we use in the last post: #inclu...

Reduction in OpenMP

High Performance Computing

About Reduction reduction is a key in OpenMP to apply multi-thread technique automatically during cumulative operation. It assign private variables to each thread with a initial value, do the ope...

First Python Project - Configure A Hero - Part D

Tutorial for newbies to programming

Related links for this tutorial could be found HERE Import Data From a File Now you are much lazier than before. You asks your friend to provide msgs in the form of: 1000, 0.2 1200, 0.1 500, 0.5...

OpenMP Private Variable - Understand Why you got error while using it

High Performance Computing

For beginners, the following code seems good. int main() { omp_set_num_threads(4); int A = 100; #pragma omp parallel for private(A) for (int i = 0; i < 10; i++) { int num = omp_get_thread_...