Skip to content

Chen123321123/parallel_programing

Repository files navigation

Parallel Programming — A1 (C++11 Threads)

C++11 multithreaded implementations of four workloads with per-thread timing and Slurm-ready builds. Focus: work partitioning, synchronization, cache locality, and false-sharing avoidance.

What’s implemented

  • Monte Carlo π (pi_calculation_parallel.cpp)
    Parallel random-point generation (≈ n/T per thread), per-thread counts & timers, global reduction.
  • Triangle Counting (triangle_counting_parallel.cpp)
    Vertex-range partitioning over CSR/CSC; thread-local counts → single reduction; unique triangles reported.
  • PageRank w/ Locks (page_rank_parallel.cpp)
    Push model, double buffers, barrier between scatter/gather, std::mutex for shared updates; per-thread time + PR sum.
  • PageRank w/ Atomics (page_rank_parallel_atomic.cpp)
    Lock-free accumulation via std::atomic/CAS; same iteration/barrier structure and metrics.

Techniques & practices

  • C++11 std::thread, std::mutex, CustomBarrier, std::atomic
  • Thread-local stats, padded structs to mitigate false sharing
  • CSR/CSC traversal for sequential memory access
  • Fine-grained timers for total & per-thread regions
  • Slurm-friendly CLI: --nWorkers, --nPoints/--nIterations, --inputFile

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published