The value of k is 18, the max of 18, 4, and 10. If maxval is replaced with minval, the value of k is 4, the min of 18, 4, and 10.
6.5 The MAXDEX and MINDEX Function
The MAXDEX (MINDEX) function returns the index of an entry where the maximum (minimum) value of the specified item occurs, among the active responders. This index is also used to retrieve the related fields.
For example: if (tail[$] .ne. 1) then /* set mask */
head[mindex(val[$])] = 1; /* get index and use it */
endif;
Before: After; (U = unchanged)

mask[$]


tail[$]

head[$]

val[$]


tail[$]

head[$]

val[$]

1


8

4

100


U

U

U

1


5

3

80


U

U

U

1


7

5

20


U

1

U

1


6

9

70


U

U

U

0


1

5

10


U

U

U

0


1

4

1


U

U

U

In this example, a minimum value for the VAL parallel values with active responders is the third row. So the contents of the HEAD variable in the third row is changed to 1.
6.6 The COUNT Function
This function returns the number of active responders.
For example: if (tail[$] == 1) then /*set mask */
k = count(them[$]); /* get the number –note use of word them*/
end;

tail[$]

mask[$]

5

0

1

1

3

0

1

1

1

1

k is set to 3.
6.7 The NTHVAL and the NTHDEX Functions xxxxxxx
The NTHVAL function returns the Nth value of an item and NTHDEX returns the index variable of that entry. The smallest is the 1^{st} .
For example: num = nthval(a[$],3); /* third smallest requested */
entry = b[nthdex(a[$],3)]; /* associated entry */

num is set to 1; entry is set to 2.
6.8 InterProcess Communication
The current version of ASC supports a one dimensional CPU, and a two dimensional memory configuration. So a twodimensional array declaration
int parallel arr[$, 512]
would be mapped onto memory in rows and columns. The intercolumn communication is achieved by specifying a variable or constant expression as the second column index.
For example: Adding adjacent columns, element by element in parallel
arr[$,i] + arr[$,i+1]
Interrow communication is achieved by specifying a variable or constant expression in the first dimension index. A + is a shift down;  is a shift up. For more interprocess communication see Chapter 3 of Associative Computing [8].
6.9 ASC Pronouns and Articles
To be closer to natural language ASC supports the use of associative pronouns and articles. The associative pronouns are THEM, THEIR, and ITS and the associative articles are A and THE.
THEM refers to the most recent set of responders to a logical parallel expression from a search; THERE is a possessive form of the $ notation; and ITS is an automatically declared parallel index variable. ITS is updated to the most recent index assignment in a FOR, WHILE, NEXT, or GET statement. The generic index variable EACH can be used in nonnested statements.
For example: if aa[$] .gt. 100 then
x = count(them[$]);
endif;
if node[$] .gt. 100 then
if their leftchild[$] .lt. 50 then
. . .
endif;
endif;
for xx in node[$] .gt. 100
if their leftchild[$] .lt. 50 then
. . .
endif;
endif;
for each node[$] .gt. 100
if its leftchild .lt. 50 then
. . .
endif;
endif;
THE refers to the last value of a parallel variable which was reduced to a scalar. Suppose aa[xx] is reduced most recently then THE aa may be used as an alternate form of aa[xx]. The indefinite article A refers to the first entry of an association and its used is similar to a get. (Thus, A is a reserved word and that is why variables are named aa[$], not a[$].)
For example: get xx in node[$] is the same as
k = node[xx]; k = a node; or
endget xx; k = node[a];
6.10 Dynamic Storage Allocation
ASC provides dynamic storage allocation by the ALLOCATE and the RELEASE statement. When a new association entry is needed, memory is allocated by the ALLOCATE statement. The RELEASE statement returns the cell to idle status. In general, several association entries may be released simultaneously.
FORMAT: allocate indexvariable in associationname;
statementblock
endallocate indexvariable;
release conditionalexpression from associationname;
For example: allocate xx in t[$]
aa[xx] = 100;
endallocate xx;
release aa[$] .eq. 100 from t[$];
Note that the scope of the index variable is limited to the statementblock. READs automatically allocate memory, one cell for each row input.
6.11 The ASC Performance Monitor
ASC’s performance monitor calculates the number of scalar and the number of parallel operations performed during a run. Any of the combinations parallelparallel, scalarparallel, or parallelscalar are counted as parallel operations. The monitor can be turned on and off anywhere in the program with the following statements:
PERFORM = 1; /* monitor on */
PERFORM = 0; /* monitor off */
These commands require upper case letters. The values of the scalar and parallel counts can be printed anywhere using the MSG statement as follows:
MSG “scalar count “ SC_PERFORM;
MSG “parallel count “ PA_PERFORM;
The statement enclosed with quotes is a message display. The SC_PERFORM is the counter for scalar operations and the PA_PERFORM counts parallel operations. These values will be printed on the line following the message. The monitor is turned off automatically during I/O operations. If the performance monitor is on when the program terminates, the counts will be printed automatically.
For example:
main try1
int scalar k;
int parallel aa[$], b[$], used[$];
index parallel xx[$];
logical parallel lg[$];
associate aa[$], b[$] with lg[$];
read aa[$], b[$] in lg[$];
k = 0;
PERFORM = 1; /* monitor on */
while xx in aa[$] .gt. 0 do
if aa[$] .eq. b[$] then
aa[$] = b[$] 5;
endif;
k = k + 1;
endwhile xx;
PERFORM = 0; /* monitor off*/
MSG “scalar count :” SC_PERFORM;
MSG “parallel count :” PA_PERFORM;
print aa[$], b[$] in lg[$];
end;
6.12 ASC Recursion: The STACKWHILERECURSE Construct
ASC does not support recursion. However, the STACKWHILERECURSE construct is useful when layers of nesting of logical parallel expressions are needed. A recursive while construct allows nesting to a level as deep as the data requires and the internal stack will allow. Moreover, the compactness of the recursive form greatly reduces the amount of repetitious programming effort. For more explanation about this construct see Chapter 5 [8].
6.13 Complex Searching: The ANDIF and ANDFOR Statements
Complex searching addresses searching techniques needed to accommodate rulebased pattern matching. A matching rule can be expressed in an associative parallel form using ASC ANDIF and ANDFOR statements. The nested ANDIF and ANDFOR constructs can be envisioned as tree searches to a fixed depth, with different search and action specification at every level.
FORMAT: andif logicalparallelexpression then
body
endandif;
andfor logicalparallelexpression then
body
endandfor;
In the body no control statements are allowed. Note there is also no else substatements.For more explanation and examples, see chapter 6 of [8].
6.14 ASC Debugger
Unfortunately, this is not implemented. But this normally doesn’t seem to be a problem.
Bibliography for Primer
[1] Eisenberg, Ann, (1982) Effective Technical Communication, McGraw Hill Inc.
[2] Hioe, K.H., ASPROL (Associative Programming Language), Master’s Thesis, Kent State University, August, 1986.
[3] Lee, J.J., The Design and Implementation of Parallel SIMD Algorithms for the Traveling Salesperson Problem, Master’s Thesis, Kent State University, December 1989.
[4] Michalakes, John, ASPVMS Handbook, Kent State University.
[5] Marowka, Ami, Back to ThinCore Massively Parallel Processors, IEEE Computer, December 2011, pp 4954.
[6] Potter, J.L. (1985) The Massively Parallel Processor, MIT Press.
[7] Potter, J.L. (1987) “An Associative Model of Computation”, Proceedings of the Second International Conference on Supercomputing, Volume III May 47, 1987, pp 18.
[8] Potter, J.L. (1992) “Associative Computing”, Plenum Publishing Inc. New York.
[9] Price, Jonathan (1984) How to Write a Computer Manual, The Benjamin/Cummins Publishing Company Inc.
[10] STARANE Reference Manual, Ger – 16422, Goodyear Aerospace Corp., November 1977.
Additional References

Nael B. AbuGhazaleh, Philip A. Wilsey, Jerry Potter, Robert Walker, and Johnnie Baker, "Flexible Parallel Processing in Memory: Architecture + Programming Model ", Proc. of the Third Petaflop Workshop, held in conjunction with Frontiers on Massively Parallel Computing, presented at Annapolis, MD, February 1999.

Maher M. Atwah and Johnnie W. Baker, "An Associative Dynamic Convex Hull Algorithm", Proc. of the Tenth IASTED International Conference on Parallel and Distributed Computing and Systems, pages 250254, presented at Las Vegas, NV, October 1998.

Maher M. Atwah and Johnnie W. Baker "An Associative Static and Dynamic Convex Hull Algorithm", Proc. of the 16th International Parallel and Distributed Processing Symposium (IEEE Workshop on Massively Parallel Processing), abstract on page 249, full text on CDROM, presented Ft. Lauderdale, FL, April 2002.

Maher M. Atwah and Johnnie W. Baker, "An Associative Implementation of a Parallel Convex Hull Algorithm", Proc. of the 15th International Parallel and Distributed Processing Symposium (IEEE Workshop on Massively Parallel Processing), full text on CDROM, presented San Francisco, CA, April 2001.

Maher Atwah, Johnnie Baker, and Selim Akl, An Associative Implementation of Classical Convex Hull Algorithms, Proceedings of the IASTED International Conference on Parallel and Distributed Computing and Systems, 1996, 435438.

Maher M. Atwah, Johnnie W. Baker, and Selim Akl, "An Associative Implementation of Graham's Convex Hull Algorithm", Proc. of the Seventh IASTED International Conference on Parallel and Distributed Computing and Systems, pages 273276, presented at George Mason University, October 1995.

Johnnie Baker and Mingxian Jin, Simulation of Enhanced Meshes with MASC, a MSIMD Model, Proc. of the Eleventh IASTED International Conference on Parallel and Distributed Computing and Systems, Nov. 1999, 511516.

Johnnie W. Baker and Mingxian Jin, "Simulations Between Enhanced Meshes and the Multiple Associative Computing (MASC) Model", Proc. of the 1999 Midwest Workshop on Parallel Processing (MWPP'99), presented at Kent, OH, August 1999.

Johnnie W. Baker and Andrew Miller, "A Parallel Production System Extending OPS5", Proceedings of the 3rd Symposium on the Frontiers of Massively Parallel Computation, edited by Joseph JaJa, pages 110118, paper presented at The University of Maryland at College Park, October, 1990.

Wittaya Chantamas, Johnnie Baker, and Michael Scherger, "An Extension of the ASC Language Compiler to Support Multiple Instruction Streams in the MASC Model using the ManagerWorker Paradigm,", Proc. of the 2006 International Conference on Parallel and Distributed Processing Techniques and Applications (PDPTA 2006), 7 pages in proceedings CD, June 2006.

Wittaya Chantamas and Johnnie Baker, "A Multiple Associative Model to Support Branches in Data Parallel Applications using the ManagerWorker Paradigm", Proc. of the 19th International Parallel and Distributed Processing Symposium (IEEE WMPP Workshop), 8 pages, April 2005.

Paul Durand, Rohit Pasari, Johnnie W. Baker, and Chunche Tsai, "An Efficient Algorithm for Similarity Analysis of Molecules", Internet Journal of Chemistry (IJC), Vol. 2, Article 17, 16 pages,, Online by subscription at http://www.ijc.com/article/1999v2/17/. Unofficial copy at http://www.cs.kent.edu/~jbaker/paper, 1999.

Mary Esenwein and Johnnie W. Baker, "VLCD String Matching for Associative Computing and Multiple Broadcast Mesh", Proc. of the IASTED International Conference on Parallel and Distributed Computing and Systems, pages 6974, presented at George Washington University, October, 1997.

Mingxian Jin and Johnnie W. Baker "Two Graph Algorithms on an Associative Computing Model", 2007 International Conference on Parallel and Distributed Processing Techniques and Applications (PDPTA'07), Las Vegas, 7 pages, June 2528, 2007.

Mingxian Jin, Johnnie Baker, and Kenneth Batcher, Timings for Associative Operations on the MASC Model, Proc. of the 15th International Parallel and Distributed Processing Symposium, Workshop on Massively Parallel Processing, San Francisco, April 2001.

Mingxian Jin, Johnnie W. Baker, and Will C. Meilander, "The Power of SIMDs vs. MIMDs in RealTime Scheduling", , in Proc. of the 16th International Parallel and Distributed Processing Symposium (IEEE Workshop on Massively Parallel Processing), abstract on page 248, full text on CDROM, presented Ft. Lauderdale, FL, April 2002.

Will C. Meilander and Johnnie W. Baker, "ATC Architecture Computers Yesterday, Today, Tomorrow", 43rd Annual Air Traffic Control Association Fall Conference Proceedings, pages 9195, 1998.

Will Meilander, Johnnie Baker, and Mingxian Jin, "Importance of SIMD Computation Reconsidered", Proc. of the 17th International Parallel and Distributed Processing Symposium (IEEE Workshop on Massively Parallel Processing), abstract on page 266, full text on CDROM , presented at Nice, France, April 2003.

Will Meilander, Johnnie Baker, and Mingxian Jin, "Predictable RealTime Scheduling for Air Traffic Control", Proc. of the 15th International Conference of Systems Engineering, pages 533539, presented at Las Vegas, NV, August 2002.

Will C. Meilander, Mingxian Jin, and Johnnie W. Baker, "Tractable RealTime Air Traffic Control Automation", Proc. of the 14th IASTED International Conference on Parallel and Distributed Computing and Systems, pg 483488, Cambridge, MA, November 2002.

Will C. Meilander, Johnnie W. Baker, and Jerry Potter, "Predictability for RealTime Command and Control", Proc. of the 15th International Parallel and Distributed Processing Symposium (IEEE Workshop on Massively Parallel Processing), abstract on page 194, full text on CDROM, presented San Francisco, CA, April 2001.

Will C. Meilander, Jerry L. Potter, Kathy J. Liszka, and Johnnie W. Baker, "RealTime Scheduling in Command and Control", in Proc. of the 1999 Midwest Workshop on Parallel Processing, (MWPP'99), presented at Kent, OH, August 1999.

Mark Merry and Johnnie W. Baker, "A Constant Time Algorithm for Computing the Hough Transform on a Reconfigurable Mesh", Image and Vision Computing Journal, vol. 14, 1996, pages 3537, 1996

Mark S. Merry and Johnnie W. Baker, "A Constant Time Sorting Algorithm for a ThreeDimensional Mesh and Reconfigurable Network, Parallel Processing Letters, 5(3), pages 401412, 1995.

Mark S. Merry and Johnnie W. Baker "A Constant Time Algorithm for the Channel Assignment Problem Using the Reconfigurable Mesh", in Journal of Parallel Algorithms and Applications, Vol 6, pages 259271, 1995.

Yi Pan , Selim Akl, and Johnnie W. Baker, Coeditors, "Computing on BusBased Architectures", Parallel Processing Letters, Special issue, 8(2), 1998.

Jerry Potter, Johnnie Baker, Stephen Scott, Arvind Bansal, Chokchai Leangsuksun, and Chandra Asthagiri, An Associative Computing Paradigm, Special Issue on Associative Processing, IEEE Computer, 27(11):1925, Nov. 1994.

Jerry Potter, Johnnie Baker, Stephen Scott, Arvind Bansal, Chokchai Leangsuksun, and Chandra Asthagiri, "ASC: An Associative Computing Paradigm, Associative Processing and Processors", Associative Processing and Processors, editors: A. Krikelei and C.C.Weems, IEEE Computer Society Press, pages 188194, 1997.

Stewart Reddaway, Will Meilander, Johnnie Baker, and Justin Kidman, "Overview of Air Traffic Control Using an SIMD COTS System", International Parallel and Distributed Processing Symposium, 9 pages, Published on CD, April 2005.

Michael Scherger, Johnnie Baker, and Jerry Potter, "Multiple Instruction Stream Control for an Associative Model of Parallel Computation", Proc. of the 17th International Parallel and Distributed Processing Symposium (IEEE Workshop on Massively Parallel Processing), abstract on page 266, full text on CDROM, presented at Nice, France, April 2003.

Michael Scherger, Johnnie Baker, and Jerry Potter, "An Object Oriented Framework for and Associative Model of Parallel Computation", Proc. of the 17th International Parallel and Distributed Processing Symposium (Workshop in Advances in Parallel and Distributed Computational Models), abstract on page 166 , full text on CDROM, presented at Nice, France, April 2003.

Michael Scherger, Jerry Potter, and Johnnie W. Baker, "On Using the UML to Describe the BSP Model of Parallel Computation", in Proc. of the 2002 International Conference on Parallel and Distributed Processing Techniques and Applications (PDPTA'2002), volume II, pages 578583, presented Las Vegas, NV, June 2002.

Michael Scherger, Jerry Potter, and Johnnie Baker, "On Using UML to Describe the MASC Model of Parallel Computation", Proc. of the 2000 International Conference on Parallel and Distributed Processing Techniques and Applications (PDPTA '2000), volume V, pages 26392645, presented Las Vegas, NV, June 2000.

Stephen Scott and Johnnie W. Baker , "Embedding the Hypercube into the 3Dimensional Mesh" , Proceedings of the 4th Symposium on the Frontiers of Massively Parallel Computation, Edited by H. J. Siegel, pages 5778, paper presented at Goddard Space Flight Center in McLean VA, October, 1992.

Shannon Steinfadt and Johnnie. W. Baker, "SWAMP: SmithWaterman using Associative Massive Parallelism", IEEE Workshop on Parallel and Distributed Scientific and Engineering Computing, 2008 International Parallel and Distributed Processing Symposium (IPDPS) at Miami, 8 pages, published on CD, April 1418, 2008.

Shannon Steinfadt, Michael Scherger, and Johnnie W. Baker, "A Local Sequence Alignment Algorithm Using an Associative Model of Parallel Computation", Proc. of IASTED Computational and Systems Biology (CASB 2006), Dallas, pp. 3843, Nov. 1314, 2006.

Jerry Trahan, Mingxian Jin, Wittaya Chantamas, and Johnnie Baker, "Relating the Power of the Multiple Associative Computing Model (MASC) to that of Reconfigurable BusBased Models", Journal of Parallel & Distributed Computing 70(2010), pgs 458466, Elsevier Publishers, Available online at ScienceDirect: www.sciencedirect.com, May, 2010.

Darrell Ulm and Johnnie W. Baker, Virtual Parallelism by Self Simulation of the Multiple Instruction Stream Associative Model", in Proc. of the International Conference on Parallel and Distributed Processing Techniques and Applications, pages 14211430, presented Sunnyvale, CA, August, 1996.

Darrell Ulm and Johnnie W. Baker, "Solving a 2D Knapsack Problem on an Associative Computer Augmented with a Linear Network", Proc. of the International Conference on Parallel and Distributed Processing Techniques and Applications, pages 2932, presented Sunnyvale, CA, August, 1996.

Darrell Ulm and Johnnie Baker, "Solving a TwoDimensional Knapsack Problem on a Mesh with Multiple Buses", Proc. of the International Conference on Parallel Processing, vol. 3, pages 168171, paper presented in Wisconsin, August, 1995.

Darrell Ulm and Johnnie Baker, "Simulating PRAM with a MSIMD Model (ASC)", Proc. of the International Conference on Parallel Processing, pages 310, presented at Minneapolis, MN, August, 1998

Darrell Ulm, Johnnie Baker, and Michael Scherger, "Solving a 2D Knapsack Problem Using a Hybrid DataParallel/ControlParallel Style of Computing", Proc of the 18th International Parallel and Distributed Processing Symposium, (IEEE Workshop on Massively Parallel Processing), Santa Fe, NM,, May 2004.

Mike Yuan, Johnnie Baker, Frank Drews, Lev Neiman, and Will Meilander, "An Efficient Associative Processor Solution to an Air Traffic Control Problem", Large Scale Parallel Processing IEEE Workshop at the International Parallel and Distributed Computing Symposium (IPDPS2010), published on IPDPS2010 CDROM and in the IEEE Digital Library with other IPDPS2010 publications, 8 pages, April 2010.

Mike Yuan, Johnnie Baker, Frank Drews, Will Meilander, and Kevin Shaffer, "System Design and Algorithms for an Air Traffic Control Prototype using an Associative Processor with Timings and Comparisons", IEEE Transactions of Parallel and Distributed Systems (TPDS), Currently revising to meet reviewers' requests

Mike Yuan, Johnnie Baker, Frank Drews, Lev Neiman, and Will Meilander, Scalable and Efficient Associative Processor Solution to Guarantee RealTime Requirements for Air Traffic Control Systems, Large Scale Parallel Processing IEEE Workshop at the International Parallel and Distributed Computing Symposium (IPDPS2011), published on IPDPS2011 CDROM and in the IEEE Digital Library with other IPDPS2011 publications, 8 pages,
Share with your friends: 