This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MCuniverse's profile picture

Grid Computing Concept

Started by MCuniverse, 22 September 2013 - 04:48 PM
MCuniverse #1
Posted 22 September 2013 - 06:48 PM
Hello, everyone.
I've been thinking of a concept in Computercraft that already exists in the real world:
Grid Computing

Grid computing is the equivalent of the supercomputer, formed by computers all around the world. Grid computing is used to solve tasks with other computers as if they were one. Here is how it works:


1. The installed grid computing program searches for tasks available from the main tasks computer (should not be the computer itself)

2. The main tasks computer searches through the database for tasks, then assigns it to the grid computing program.

3. The grid computing program receives the task, complete with temporary programs to solve it.

4. After reading the instructions, the grid computing program begins computing using help from functions in those programs (as if the temporary programs were a function in the grid computing program itself)

5. After computing, the programs and result will be returned to the main tasks computer

Some time after, you will be given credit for ranking, if required.

A good real-life example of this is BOINC, a grid computing program that uses your computer's spare time to calculate for multiple projects. It had existed way in the past before, but now the average computing power of BOINC is almost 25% of the world's strongest supercomputers to date!
Symmetryc #2
Posted 22 September 2013 - 07:09 PM
I believe that all computers in CC in a world are running on the same level, when one computer stops, the next computer is processed, and so on (which is why you get the too long without yielding error), so this wouldn't really work. I might be wrong though, I'm not sure.
Vindex #3
Posted 22 September 2013 - 07:09 PM
What would be usage for that?
  • I would imagine some autocrafting tasks, like if you didn't have Applied Energistics (that would be sad)
  • Maybe some distributed resource loan system in multiplayer
    • everyone sets up a computer, some inventory access system
    • you request resources - other player's systems would provide those e.g. through ender chests

It would be interesting to setup effective remote communication over the distance. I did this with floppy/turtle/ender chest - it worked ok. Scalable? Not sure.
MCuniverse #4
Posted 22 September 2013 - 07:16 PM
I believe that all computers in CC in a world are running on the same level, when one computer stops, the next computer is processed, and so on (which is why you get the too long without yielding error), so this wouldn't really work. I might be wrong though, I'm not sure.
os.queueEvent("")  coroutine.yield()
I use this on very long loop processes to stop "too long without yielding" errors. XD
I learned this code when I used to ask help very frequently in the Ask A Pro section.
Symmetryc #5
Posted 22 September 2013 - 07:51 PM
I believe that all computers in CC in a world are running on the same level, when one computer stops, the next computer is processed, and so on (which is why you get the too long without yielding error), so this wouldn't really work. I might be wrong though, I'm not sure.
os.queueEvent("")  coroutine.yield()
I use this on very long loop processes to stop "too long without yielding" errors. XD
I learned this code when I used to ask help very frequently in the Ask A Pro section.
I know, but it still wouldn't increase the efficiency if what I saw was true, because that would slow down the other computers.
Lyqyd #6
Posted 22 September 2013 - 08:08 PM
This wouldn't do anything useful since only one computer runs at a time anyway. A system like this would likely be a net loss over simply performing the computation on one computer.
MCuniverse #7
Posted 22 September 2013 - 09:02 PM
Well, if it's like that, then scratch this concept. After all, it's just a method of possible multitasking. Besides, there are very few operating systems that I know has neat multi-tasking option Ehh, true. The fact that there's Parallel API already makes me sort of stupid not thinking this through. Thanks for reminding me, anyway.
Cranium #8
Posted 23 September 2013 - 11:48 AM
Well, even so. The way it's implemented, each task is only calculated in sequence with our computers. There's nothing that you can di with grid/cloud computing that wouldn't be better handled with one computer.
nutcase84 #9
Posted 25 September 2013 - 01:56 PM
If the storage is limited, then you can make a grid storage thing.
M4sh3dP0t4t03 #10
Posted 25 September 2013 - 04:08 PM
While this doesn't improve performance, this could be used for a lot of other stuff like opening/closing doors far away from your main computer or firing many TNT cannons that are controlled by just one computer or syncing passwords between computers.
Vindex #11
Posted 25 September 2013 - 05:07 PM
While this doesn't improve performance, this could be used for a lot of other stuff like opening/closing doors far away from your main computer or firing many TNT cannons that are controlled by just one computer or syncing passwords between computers.
This is more networking than grid computing (poster asks about grid computing), but I'm with you - I see main power in easy remote communication of computers.

What would make performance benefit is creating a grid of non-CC machines controlled by CC computers - those machines can run in parallel.
For some setups you could even program a turtle to build individual nodes of the grid. That turtle could even craft individual machines from raw materials.
Cranium #12
Posted 25 September 2013 - 06:35 PM
Again.
All computers in the entire world/server on ComputerCraft only run each task ONE AT A TIME. None of them can run simultaneously/in parallel.
Grid/cloud computing is no faster/more efficient in CC than it would be to simply assign the entire task to one computer.