ASC Programming Michael C. Scherger Department of Computer Science Kent State University September 27, 2002.

Slides:



Advertisements
Similar presentations
Lab7: Introduction to Arduino
Advertisements

Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
C++ Basics Prof. Shermane Austin. Learning Programming Language Basics Data Types – simple Expressions Relational and Logical Operators Conditional Statements.
Data Parallel Languages ASC multiC Fortran 90 & HPF.
ASC Language 1 Additional ASC Programming Comments NOTE: These are additional notes to be added to “ASC Programming” slides by Michael Scherger. Comparison.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
COMP2004 Programming Practice Sam Holden Department of Computer Science University of Sydney.
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
An Associative Program for the MST Problem Part 2 of Associative Computing.
Guide To UNIX Using Linux Third Edition
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Data Parallel Languages (Chapter 4) ASC Language multiC Fortran 90 and HPF.
CS 117 Section 2 + KNET Computer accounts – ed to KNET students –Change password Homework 1 Lab Tutors –In lab for next 2 weeks –Will help you with.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Chapter 2: Algorithm Discovery and Design
Prof. R. Willingale Department of Physics and Astronomy 2nd Year C+R 2 nd Year C and R Workshop Part of module PA2930 – 2.5 credits Venue: Computer terminal.
Console and File I/O - Basics Rudra Dutta CSC Spring 2007, Section 001.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CMSC 104, Version 8/061L18Functions1.ppt Functions, Part 1 of 4 Topics Using Predefined Functions Programmer-Defined Functions Using Input Parameters Function.
Computer Science 101 Introduction to Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
CS140: Intro to CS An Overview of Programming in C by Erin Chambers.
High-Level Programming Languages: C++
Introduction to Shell Script Programming
October 4, 2005ICP: Chapter 4: For Loops, Strings, and Tuples 1 Introduction to Computer Programming Chapter 4: For Loops, Strings, and Tuples Michael.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Computer Science 101 Introduction to Programming.
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Computer Science 101 Introduction to Programming.
EZYFLO. Aim of EZYFLO To draw simple flowcharts To reduce the memory size of the flowchart To create a software which runs in DOS environment also.
Meet Perl, Part 2 Flow of Control and I/O. Perl Statements Lots of different ways to write similar statements –Can make your code look more like natural.
I Power Int 2 Computing Software Development High Level Language Constructs.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
How to start Visual Studio 2008 or 2010 (command-line program)
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)
CS285 Visual Basic 2 Department of Computing UniS 1 Statements in Visual Basic A statement is the fundamental syntactical element of a program smallest.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
C++ Programming Basic Learning Prepared By The Smartpath Information systems
The ASC Language Part 2 of Associative Computing.
1. Understand the application of Pseudo Code for programming purposes 2. Be able to write algorithms in Pseudo Code.
I Power Higher Computing Software Development High Level Language Constructs.
Java Basics Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Introduction to Combinational Verilog EECS270 rev 9/25/12.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Announcements Assignment 1 due Wednesday at 11:59PM Quiz 1 on Thursday 1.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Chapter 1: Introduction to Computers and Programming.
Chapter 1 slides1 What is C? A high-level language that is extremely useful for engineering computations. A computer language that has endured for almost.
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Govt. Polytechnic,Dhangar
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
High-Level Programming Languages
Chapter 1 c++ structure C++ Input / Output
Getting Started With Coding
Presentation transcript:

ASC Programming Michael C. Scherger Department of Computer Science Kent State University September 27, 2002

Contents Software Location and Installation Basic Program Structure Data Types and Variables Associations and Setscope Input / Output Control Structures Looping Performance Monitor

Software Compiler and Emulator  DOS/Windows, UNIX (Linux)  WaveTracer  Connection Machine PACL/downloads.htm PACL/downloads.htm Use any text editor.  Careful moving files between DOS and UNIX! ASC Compiler ASC Emulator Anyprog.asc Anyprog.iob Standard I/OFile I/O -e -wt -cm -e -wt -cm

Software Example:  To compile your program…  % asc1.exe –e shapes.asc  To execute your program…  % asc2.exe –e shapes.iob  % asc2.exe –e shapes.iob < shapes.dat  % asc2.exe –e shapes.iob shapes.out

Basic Program Structure Main program_name  Constants;  Varaibles;  Associations;  Body; End;

Basic Program Structure Example:  Consider an ASC Program that computes the area of various simple shapes (circle, rectangle, triangle). Here is an example shapes.ascshapes.asc Here is the data shapes.datshapes.dat Here is the shapes.outshapes.out

Data Types and Variables ASC has eight data types…  int, real, hex, oct, bin, card, char, logical, index. Variables can either be scalar or parallel.  Scalar variables are in the IS. Parallel variables are in the cells.  Parallel variables have the suffix “[$]” at the end of the identifier.  Can specify the length (in bits) of parallel variables. Default length works fine for most programs.

Data Types and Variables int scalar a, b, c; int parallel p[$], q[$], r[$], pp[$,4]; index parallel xx[$], yy[$]; a+bscalar a+p[$]parallel a+p[xx]scalar pp[xx,b]*3+q[$]parallel p[xx]+pp[yy,b]scalar q[$]+r[$]parallel a+pp[xx,b]*3scalar More Examples on page 9-10

Associations and Setscope There are no “structs” or “classes” in ASC.  Create an association between parallel variables and a parallel logical variables. Example on page 8. Setscope  Selects or “marks” a set of active cells. Example on page 15

Input / Output READ  Page  Must have an ASSOCIATE statement.  Input file must have blank line at end of data set.  Read from “standard input” or from data file re-directed from command line.

Input / Output PRINT  Page 13  Must have an ASSOCIATE statement.  Does not output user specified strings. I.e. User text messages. Only outputs the values of parallel variables.

Input / Output MSG  Page  Used to display user text messages.  Used to display values of scalar variables.  Used to display a dump of the parallel variables.

Control Structures IF-THEN-ELSE  Scalar version similar to other sequential programming languages. Either executes the body of the IF, OR executes the body of the ELSE.  Parallel version is more “sequence-like”. Executes body of the IF followed by body of ELSE. Masking operation.

Control Structures Relational operators on page 40. Example on page 16. IF-NOT-ANY on page ANY on page

Looping Sequential looping  Loop-Until Example on page 20. Two types of parallel looping constructs:  Parallel For-Loop Conditional is evaluated only once. Example on page 21.  Parallel While-Loop Conditional is evaluated every iteration. Example on page

Performance Monitor Keeps track of number of scalar and parallel operations.  PERFORM = 1;  PERFORM = 0;  MSG PA_PERFORM;  MSG SC_PERFORM;