Problem
Compute C = A × B efficiently when a client and one or more servers are available. We want to:
- Exploit all CPU cores on the server.
- Split work so the client contributes some fraction and servers do the rest.
- Keep the protocol simple and deterministic.
Server Logs in another laptop (PORT Forwarded using ngrok):

Client Code running on my machine to get raw data:

Final Graph with the raw data received above:

Go Server
Code of Go Server
- Endpoints
- GET /:
- Health/info: returns message and CPU core count.
- GET /cores:
- Returns { "cores": <NumCPU> } so clients can size their split dynamically.
- POST /multiply:
- Body: { "A": number[][], "B": number[][] }
- Response: { "result": number[][], "workers": number }
- Validates that columns(A) == rows(B).
- Parallelization model
- Uses a worker-pool sized to the server’s CPU cores by default (configurable via ?workers=N).
- Rows of A are the unit of work. Each worker:
- Receives a row index from a channel.
- Computes that full row of C using all columns of B.
- Writes directly into the correct output row (no locks needed because each row is unique to a worker).
- Synchronization is via a sync.WaitGroup: increment once per worker, Done() when a worker exits, Wait() before responding.
- Logging: each worker prints which “core” is processing which row, e.g. core 3/8 processing row 42.
- Operational details
- CORS enabled for simple client testing.
- PORT environment variable supported; defaults to 3000.
Client2