WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

ZakariaHanani/distributed-cpu-montecarlo-traffic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Distributed CPU Monte Carlo Traffic

Grid Computing Simulation Platform

Grid Computing Java RMI Next.js Distributed Systems


๐Ÿ“‹ Table of Contents

  1. Project Overview
  2. System Architecture
  3. How It Works
  4. Technologies Used
  5. Installation & Execution
  6. Network Configuration
  7. Scalability & Multi-Workers
  8. Future Improvements
  9. Contact

๐Ÿš€ Project Overview

Distributed CPU Monte Carlo Traffic is a high-performance Grid Computing platform designed to distribute CPU-intensive Monte Carlo simulations across multiple machines (Workers) managed by a central Master node.

๐ŸŽฏ Goals

  • Leverage distributed CPU power across multiple nodes
  • Execute simulations in parallel for faster computation
  • Aggregate results efficiently with minimal overhead
  • Provide a modern user interface using Next.js for visualization
  • Support dynamic worker scaling for on-demand computation

๐Ÿ—๏ธ System Architecture

graph TB
    subgraph "Frontend Layer"
        F[Next.js Client]
    end
    
    subgraph "Coordination Layer"
        R[RMI Registry]
    end
    
    subgraph "Control Layer"
        M[Master Node]
    end
    
    subgraph "Computation Layer"
        W1[Worker Node 1]
        W2[Worker Node 2]
        W3[Worker Node N...]
    end
    
    F -->|Start Simulation| M
    R -->|Service Discovery| M
    R -->|Service Registration| W1
    R -->|Service Registration| W2
    R -->|Service Registration| W3
    M -->|Distribute Tasks| W1
    M -->|Distribute Tasks| W2
    M -->|Distribute Tasks| W3
    W1 -->|Return Results| M
    W2 -->|Return Results| M
    W3 -->|Return Results| M
    M -->|Aggregate & Display| F
Loading

Architecture Components

Component Role Description
RMI Registry Service Discovery Central registry for coordinating nodes
Master Node Task Manager Splits simulations, assigns tasks, aggregates results
Worker Nodes Computation Units Perform CPU-intensive calculations
Client/Frontend User Interface Next.js app for simulation control and visualization

โš™๏ธ How It Works

Workflow Overview

sequenceDiagram
    participant C as Client
    participant R as RMI Registry
    participant M as Master
    participant W1 as Worker 1
    participant W2 as Worker 2
    
    Note over R: 1. Start RMI Registry
    Note over M: 2. Master registers with Registry
    Note over W1,W2: 3. Workers register with Registry
    
    C->>M: 4. Launch Simulation
    M->>M: 5. Split into Tasks
    M->>W1: 6. Assign Task 1
    M->>W2: 7. Assign Task 2
    par Parallel Execution
        W1->>W1: Compute Task 1
        W2->>W2: Compute Task 2
    end
    W1->>M: 8. Return Results
    W2->>M: 9. Return Results
    M->>M: 10. Aggregate Results
    M->>C: 11. Display Final Results
Loading

Key Features

  • Asynchronous execution - Workers process tasks independently
  • Dynamic scaling - Workers can join/leave during execution
  • Fault tolerance - System continues if workers disconnect
  • Load balancing - Tasks distributed based on worker availability

๐Ÿ› ๏ธ Technologies Used

Backend (Grid Computing)

Java RMI Maven Concurrency

Frontend

Next.js React TypeScript

Tools & Environment

Git Bash Linux



๐Ÿš€ Installation & Execution

1. Clone the Repository

git clone https://github.com/ZakariaHanani/distributed-cpu-montecarlo-traffic.git
cd distributed-cpu-montecarlo-traffic

2. Build the Project

mvn clean install

3. Start the RMI Registry

./scripts/run-registry.sh

Output: โœ… RMI Registry started on port 1099

4. Start the Master Node

./scripts/run-master.sh

Output: โœ… Master registered successfully

5. Configure and Start Workers

โš ๏ธ Each worker must define its own machine IP address

Edit scripts/run-worker.sh:

WORKER_IP=192.168.1.10  # Replace with your machine IP

Start the worker:

./scripts/run-worker.sh

Output: โœ… Worker registered: [email protected]

6. Launch the Client

./scripts/run-client.sh

7. Access the Web Interface

cd frontend
npm run dev

Visit: http://localhost:3000


๐ŸŒ Network Configuration

Worker Configuration

Each worker must:

  • Use its local machine IP (not localhost)
  • Be reachable over the network
  • Have appropriate firewall rules

Central Configuration

The Master and Registry can load network settings from:

# config.properties
registry.host=192.168.1.1
registry.port=1099
master.host=192.168.1.2
worker.pool.size=10

Benefits:

  • Single configuration file
  • No code changes for network adjustments
  • Easy deployment across environments

๐Ÿ“ˆ Scalability & Multi-Workers

Dynamic Scaling

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          Master Node                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚    Task Queue              โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Task 1 โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Worker 1 โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Task 2 โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Worker 2 โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Task 3 โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Worker 3 โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Task 4 โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Worker 4 โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Performance Benefits

Workers Speed Increase Use Case
1 Worker 1x Baseline Development
4 Workers ~3.8x Faster Small cluster
10 Workers ~9.5x Faster Medium cluster
50+ Workers Linear Scaling Cloud deployment

Formula: Speedup โ‰ˆ N / (1 + (N-1)*f) where f is parallelizable fraction

Features

  • โœ… Dynamic worker joining/leaving
  • โœ… Automatic task redistribution
  • โœ… Load balancing
  • โœ… Fault tolerance
  • โœ… Minimal coordination overhead

Best Practices

  1. Branch Naming: feature/, fix/, docs/, refactor/
  2. Commit Messages: Use conventional commits
  3. Code Reviews: All PRs require review
  4. Testing: Distributed testing across multiple machines

๐Ÿ”ฎ Future Improvements

Planned Features

Feature Status Expected
Automatic Worker Discovery Planned 2026
Advanced Load Balancing Planned 2026
Fault Tolerance & Health Monitoring Research 2026
Real-time Dashboard Planned 2026
Docker/Kubernetes Deployment Planned 2026
GPU Acceleration Support Research 2026

Research Areas

  • Machine Learning for optimal task distribution
  • Blockchain for worker verification and trust
  • Edge Computing integration for IoT devices
  • Quantum Computing readiness

๐Ÿ“ž Contact

Project Maintainer

๐Ÿ‘จโ€๐Ÿ’ป Zakaria HANANI

Platform Link
GitHub github.com/ZakariaHanani
Email [email protected]
LinkedIn linkedin.com/in/zakaria-hanani

๐Ÿ‘จโ€๐Ÿ’ป Mohamed OUIJJANE

Platform Link
GitHub github.com/MohamedOuijjane
Email [email protected]
LinkedIn [linkedin.com/in/mohamedouijjane

๐Ÿ‘จโ€๐Ÿ’ป Ayoub Karkouri

Platform Link
GitHub github.com/MohamedOuijjane
Email [email protected]
LinkedIn linkedin.com/in/ayoubkarkouri

๐Ÿ‘จโ€๐Ÿ’ป Ahmed LAHMAINE

Platform Link
GitHub github.com/ahmed-la14
Email [email protected]

๐Ÿ‘จโ€๐Ÿ’ป Ali HALLA

Platform Link
GitHub github.com/Alihalla
Email [email protected]

๐Ÿ‘จโ€๐Ÿ’ป Hmad AIT LAHMOUSS

Platform Link
GitHub github.com/hmad-ait-lahmous
Email [email protected]

๐Ÿ‘จโ€๐Ÿ’ป Mohamed OUADRA

Platform Link
GitHub github.com/MohamedOuadra
Email [email protected]

Contribution

We welcome contributions! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a Pull Request
  4. Join our discussions


๐ŸŽฏ Quick Start Summary

# 1. Clone & Build
git clone https://github.com/ZakariaHanani/distributed-cpu-montecarlo-traffic && cd repo
mvn clean install

# 2. Start Services (in separate terminals)
./scripts/run-registry.sh
./scripts/run-master.sh
./scripts/run-worker.sh  # Repeat for each worker

# 3. Launch Interface
cd frontend && npm run dev

# 4. Open browser: http://localhost:3000

๐Ÿ“œ License

ยฉ 2025 โ€“ Distributed CPU Monte Carlo Traffic
Grid Computing โ€ข Java RMI โ€ข High-Performance Computing


๐ŸŒŸ Star us on GitHub if you find this project useful!

GitHub Stars

"Harnessing distributed power for complex simulations"


Tags: grid-computing monte-carlo java-rmi distributed-systems nextjs high-performance parallel-computing simulation


Built with โค๏ธ by the distributed computing community