Skip to content Skip to navigation Skip to collection information

Connexions

You are here: Home » Content » Introduction to G Programming » Parallel Programming

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • NSF Partnership display tagshide tags

    This collection is included inLens: NSF Partnership in Signal Processing
    By: Sidney Burrus

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Featured Content display tagshide tags

    This collection is included inLens: Connexions Featured Content
    By: Connexions

    Click the "Featured Content" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Parallel Programming

Module by: Eduardo Perez. E-mail the author

Summary: The creation of this content was supported in some part by NSF grant 0538934.

In 1985, by design, G was developed to address and simplify parallel programming. If you have gone through the examples in this book, you have already developed various parallel programs.

In the following example, we will develop a simple program where interactivity and parallelism are part of the program.

Figure 1: Select Diagram for Parallel Programming
A diagram of Parallel Programming. The diagram consists of two rows of icons. The upper row from left to right consist of an orange box contina '0.02' over a blue box containg 'i'. lines connect these icons to a triangular icon with apex pointing right and it contains 'x'. A line connects this to a graph icon and then that is connected to another triangle icon and that triangle that points to a final graph icon labeled 'sine wave'. The bottom row of icons consist of an orange icon labeled 'amplitude' which connects via a line to the second triangle in the upper row. To the right of the 'Amplitude' icon is  'stop' button icon.

From the menu select Edit >> Copy.

Figure 2: Copy Selected Diagram
A typical edit menu in Windows with the item 'copy' highlighted.

Create a copy of the while loop and its contents by selecting Edit >> Paste. Organize the diagram as shown in the figure below.

Figure 3: Paste Diagram
A diagram of two Parallel Programming diagrams. The diagrams consist of two rows of icons and are idenitical except for a names of icons. The upper row from left to right they consist of an orange box contina '0.02' over a blue box containg 'i'. lines connect these icons to a triangular icon with apex pointing right and it contains 'x'. A line connects this to a graph icon and then that is connected to another triangle icon and that triangle that points to a final graph icon labeled 'sine wave'. In the second diagram the final icon is labeled 'sine wave 2'. The bottom row of icons consist of an orange icon labeled 'amplitude' or 'amplitude 2' for the second diagram which connects via a line to the second triangle in the upper row. To the right of the 'Amplitude' icon is  'stop' button icon.

Go the Front Panel window and organize the input and output controls as shown in the figure below.

Figure 4: Parallel G Program
Two parallel empty graphs.

You have just completed your first parallel interactive program using G. Save the program, run it and interact with it.

Figure 5: Parallel Interactive G Program
Two parallel graphs containing sine waves. The graph on the left contains a sine wave with a large amplitude than the one on the rightt.

To end this program click on the stop and stop 2 terminals.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks