
Which intermediate results of your computation depend on each other?.Does your data allow parallelization at all? If not yet, in which way does the organisation of your data have to be adapted?.Can you split your algorithm into several execution steps?.Is your program intended to run just once, or will it run regularly on a similar dataset?.Why do you want to parallelize code? In your specific case and in terms of effort, does it make sense to think about it?.If not yet done, think about how your dataset is structured as well so that it can be processed effectively by the individual agents.
PARALLEL PROCESSING OPERATING SYSTEM CODE
This helps you to split your code into smaller chunks that can be executed by an agent specialized only for this task. It is similar to changing your work perspective in a company from an ordinary worker to a manager - you will have to keep an eye on who is doing what, how long does a single step take, and what are the dependencies between the intermediate results. Using subprocesses requires you to rethink the way your program is executed, from linear to parallel.

Certain sections of code can be run simultaneusly, and allow parallelization in principle.A single process covers a piece of code that can be run separately.One solution for this is the usage of subprocesses in combination with parallel execution. This does not refer to source code, only, but also to code that is executed on your machine. The more complex a program gets the more often it is handy to divide it into smaller pieces. Example 1 shows this for an arbitrarily selected process that has the process ID #177.Įxample 1: Information that is available to a process :/proc/177 # lsĪuxv environ map_files numa_maps sched syscallĬlear_refs fd mem oom_score setgroups timersĬmdline fdinfo mountinfo oom_score_adj smaps uid_mapĬoredump_filter io mountstats personality stat Structuring Program Code and Data The entries are sorted by the process ID, which is unique to each process. This information is kept in the process file system of your UNIX/Linux system, which is a virtual file system, and accessible via the /proc directory. This "bubble" is called a process, and comprises everything which is needed to manage this program call.įor example, this so-called process environment includes the memory pages the process has in use, the file handles this process has opened, both user and group access rights, and its entire command line call, including given parameters. When you start a program on your machine it runs in its own "bubble" which is completely separate from other programs that are active at the same time.
