{"id":36688455,"url":"https://github.com/converged-computing/distributed-fractal","last_synced_at":"2026-01-12T11:17:07.603Z","repository":{"id":228117280,"uuid":"773160483","full_name":"converged-computing/distributed-fractal","owner":"converged-computing","description":"Distributed Go (leader and worker design) using GRPC to generate fractals!","archived":false,"fork":false,"pushed_at":"2024-03-18T01:09:01.000Z","size":16538,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-10T05:37:02.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/converged-computing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":"COPYRIGHT","agents":null,"dco":null,"cla":null}},"created_at":"2024-03-16T22:54:04.000Z","updated_at":"2024-03-17T11:09:14.000Z","dependencies_parsed_at":"2025-09-10T04:19:41.485Z","dependency_job_id":null,"html_url":"https://github.com/converged-computing/distributed-fractal","commit_stats":null,"previous_names":["converged-computing/distributed-fractal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/converged-computing/distributed-fractal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fdistributed-fractal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fdistributed-fractal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fdistributed-fractal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fdistributed-fractal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/converged-computing","download_url":"https://codeload.github.com/converged-computing/distributed-fractal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fdistributed-fractal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T11:17:06.801Z","updated_at":"2026-01-12T11:17:07.586Z","avatar_url":"https://github.com/converged-computing.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed Fractale\n\nI wanted a distributed, grpc-based application for testing compatibility metadata with a scheduler in the cloud.\nI wanted it to improve with strong scaling, and have network as a variable. I think Go is also interesting\nfor how it uses memory and garbage collection, etc.\nSo here we have, distributed fractal! This is so much cooler (and less annoying) than LAMMPS. Sorry LAMMPS...\n\n![mandelbrot.png](mandelbrot.png)\n\n## Usage\n\nThe default commands in the [Makefile](Makefile) for `make leader` and `make worker` generate metrics, primarily for the leader.\nThis is what the output looks like for the leader after a run is finished:\n\n```bash\nfractal leader --metrics --quiet\n```\n```console\nMETRICS LEADER time: 38.35129787s\nMETRICS LEADER /cgo/go-to-c-calls:calls: 1\nMETRICS LEADER /cpu/classes/gc/mark/assist:cpu-seconds: 0.003188\nMETRICS LEADER /cpu/classes/gc/mark/dedicated:cpu-seconds: 0.056393\nMETRICS LEADER /cpu/classes/gc/mark/idle:cpu-seconds: 0.106529\nMETRICS LEADER /cpu/classes/gc/pause:cpu-seconds: 0.015728\nMETRICS LEADER /cpu/classes/gc/total:cpu-seconds: 0.181838\nMETRICS LEADER /cpu/classes/idle:cpu-seconds: 454.936002\nMETRICS LEADER /cpu/classes/scavenge/assist:cpu-seconds: 0.000000\nMETRICS LEADER /cpu/classes/scavenge/background:cpu-seconds: 0.000000\nMETRICS LEADER /cpu/classes/scavenge/total:cpu-seconds: 0.000001\nMETRICS LEADER /cpu/classes/total:cpu-seconds: 499.728416\nMETRICS LEADER /cpu/classes/user:cpu-seconds: 44.610576\nMETRICS LEADER /gc/cycles/automatic:gc-cycles: 19\nMETRICS LEADER /gc/cycles/forced:gc-cycles: 0\nMETRICS LEADER /gc/cycles/total:gc-cycles: 19\nMETRICS LEADER /gc/heap/allocs-by-size:bytes: 9.000000\nMETRICS LEADER /gc/heap/allocs:bytes: 3800955080\nMETRICS LEADER /gc/heap/allocs:objects: 13332537\nMETRICS LEADER /gc/heap/frees-by-size:bytes: 9.000000\nMETRICS LEADER /gc/heap/frees:bytes: 3419495792\nMETRICS LEADER /gc/heap/frees:objects: 12665006\nMETRICS LEADER /gc/heap/goal:bytes: 411198456\nMETRICS LEADER /gc/heap/objects:objects: 667531\nMETRICS LEADER /gc/heap/tiny/allocs:objects: 37795374\nMETRICS LEADER /gc/limiter/last-enabled:gc-cycle: 0\nMETRICS LEADER /gc/pauses:seconds: 0.000025\nMETRICS LEADER /gc/stack/starting-size:bytes: 2048\nMETRICS LEADER /memory/classes/heap/free:bytes: 32071680\nMETRICS LEADER /memory/classes/heap/objects:bytes: 381459288\nMETRICS LEADER /memory/classes/heap/released:bytes: 294912\nMETRICS LEADER /memory/classes/heap/stacks:bytes: 4423680\nMETRICS LEADER /memory/classes/heap/unused:bytes: 5375144\nMETRICS LEADER /memory/classes/metadata/mcache/free:bytes: 1200\nMETRICS LEADER /memory/classes/metadata/mcache/inuse:bytes: 14400\nMETRICS LEADER /memory/classes/metadata/mspan/free:bytes: 189920\nMETRICS LEADER /memory/classes/metadata/mspan/inuse:bytes: 1017760\nMETRICS LEADER /memory/classes/metadata/other:bytes: 16400736\nMETRICS LEADER /memory/classes/os-stacks:bytes: 0\nMETRICS LEADER /memory/classes/other:bytes: 2213187\nMETRICS LEADER /memory/classes/profiling/buckets:bytes: 4957\nMETRICS LEADER /memory/classes/total:bytes: 443466864\nMETRICS LEADER /sched/gomaxprocs:threads: 12\nMETRICS LEADER /sched/goroutines:goroutines: 7\nMETRICS LEADER /sched/latencies:seconds: 0.000000\nMETRICS LEADER /sync/mutex/wait/total:seconds: 0.000440\n```\n\nI haven't found a good way to ping the worker that everything is done (to output metrics) but probably there is a good way -\nI thought maybe the total tasks could at least be sent over to the node, but I'm not sure where I'd keep them (there is no state).\nI'm thinking maybe they could be streamed over and then retrieved before exit.\n\nNote that you can read about the metrics [here](https://go.dev/src/runtime/metrics/description.go) - some are indeed cumulative!\nNote that this example shows running in non quiet mode, and without metrics. The default in the Makefile uses quiet mode\nand metrics. Run the leader:\n\n```bash\nmake leader\n```\n\nAnd as many workers as you like:\n\n```console\n# in separate terminals\nmake worker\nmake worker\n```\n\nAnd watch the generation happen! Here is the leader:\n\n```console\n$ make leader\nmkdir -p /home/vanessa/Desktop/Code/distributed-fractal/bin\nGO111MODULE=\"on\" go build -o /home/vanessa/Desktop/Code/distributed-fractal/bin/fractal ./cmd/fractal/fractal.go\n/home/vanessa/Desktop/Code/distributed-fractal/bin/fractal leader\n\n[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\n - using env:   export GIN_MODE=release\n - using code:  gin.SetMode(gin.ReleaseMode)\n\n[GIN-debug] POST   /start                    --\u003e github.com/converged-computing/distributed-fractal/pkg/core.(*Leader).Init.func1 (3 handlers)\n[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\nPlease check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.\n[GIN-debug] Listening and serving HTTP on :9092\nRendering image....[GIN] 2024/03/16 - 16:51:25 | 200 |  5.689972138s |             ::1 | POST     \"/start\"\n...\n\nMandelbrot set rendered into `mandelbrot.png`\n```\n\nAnd a worker (you'll notice they receive different shards of work, and one can finish before another):\n\n```console\nReceived work: xmin:-0.0655945 ymin:0.741986625 xmax:0.060094499999999995 ymax:0.8362533750000001 iy:5900 iters:800 width:8192\nReceived work: xmin:-0.0655945 ymin:0.741986625 xmax:0.060094499999999995 ymax:0.8362533750000001 iy:5901 iters:800 width:8192\n```\n\nAnd right now I'm pinging an http endpoint to start, likely I can add params here instead:\n\n```console\ncurl -X POST http://localhost:9092/start\n```\n\nAnd then you get the beautiful image after the workers finish! They are designed to process one row (Y) of the height at a time (across X).\nI tried it first by pixel and it was horrificly slow, heh. To use in a headless environment and force exit:\n\n```bash\nfractal leader --force-exit\nfractal leader --force-exit || true\n```\n\nI'm sure there are better ways to do that, I'm just too tired to figure it out fully now.\n\n## Images\n\nHere are some to generate:\n\n```bash\nmkdir -p ./img\n./bin/fractal leader --palette \"Hippi\" --xpos -0.0091275 --ypos 0.7899912 --escape-radius .01401245 --outfile \"img/mandelbrot.png\"\n./bin/fractal leader --palette \"Plan9\" --xpos -0.0091275 --ypos 0.7899912 --escape-radius .01401245 --outfile \"img/test2.png\"\n./bin/fractal leader --palette \"Vivid\" --xpos -0.00991275 --ypos 0.7899912 --escape-radius .02401245 --outfile \"img/test3.png\" --iters 800 --step 600 --smoothness 10 --width 1920 --height 1080\n./bin/fractal leader --palette \"Hippi\" --xpos -0.00275 --ypos 1.012 --escape-radius .089999 --outfile \"img/test4.png\" --iters 800 --step 600 --smoothness 10 --width 1920 --height 1080\n./bin/fractal leader --palette \"Hippi\" --xpos -0.00275 --ypos 0.78912 --escape-radius .1256789 --outfile \"img/test5.png\" --iters 800 --step 6000 --smoothness 10 --width 1920 --height 1080\n./bin/fractal leader --palette \"AfternoonBlue\" --xpos -0.0091275 --ypos 0.7899912 --escape-radius .01401245 --outfile \"img/test6.png\"\n./bin/fractal leader --palette \"SummerBeach\" --xpos -0.0091275 --ypos 0.7899912 --escape-radius .01401245 --outfile \"img/test7.png\"\n./bin/fractal leader --palette \"Biochemist\" --xpos -0.0091275 --ypos 0.7899912 --escape-radius .01401245 --outfile \"img/test8.png\" --smoothness 10\n```\n\n## Thank You\n\n - I learned about the simple distributed system architecture from [this post](https://dev.to/tikazyq/golang-in-action-how-to-implement-a-simple-distributed-system-2n0n)\n - The fractale I added is derived from [here](https://github.com/esimov/gobrot) (it's beautiful) ([MIT LICENSE](https://github.com/esimov/gobrot/commit/078c5bc391a187fea2d0663d8f4192732e61869e))\n\n## License\n\nHPCIC DevTools is distributed under the terms of the MIT license.\nAll new contributions must be made under this license.\n\nSee [LICENSE](https://github.com/converged-computing/rainbow/blob/main/LICENSE),\n[COPYRIGHT](https://github.com/converged-computing/rainbow/blob/main/COPYRIGHT), and\n[NOTICE](https://github.com/converged-computing/rainbow/blob/main/NOTICE) for details.\n\nSPDX-License-Identifier: (MIT)\n\nLLNL-CODE- 842614\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconverged-computing%2Fdistributed-fractal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconverged-computing%2Fdistributed-fractal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconverged-computing%2Fdistributed-fractal/lists"}