510 likes | 651 Views
Towards programming environment for personal supercomputing. Nikolay Mirenkov, Rentaro Yoshioka, and Yutaka Watanobe University of Aizu. Aizu-Wakamatsu. Tokyo. Introduction Examples of programs of a new type Visual symbols of an icon language
E N D
Towards programming environment for personal supercomputing Nikolay Mirenkov, Rentaro Yoshioka, and Yutaka Watanobe University of Aizu
Aizu-Wakamatsu Tokyo IFIP
Introduction Examples of programs of a new type Visual symbols of an icon language Filmification of methods and self-explanatory components Conclusion Outline IFIP
Programming languages are good for computers, but they are not so good for people: unfriendly, unnatural, and difficult to use, These features are main reasons of existing software engineering difficulties. Our present New programming languages should be, in a sense, for people (!) communication. IFIP
Personal supercomputers, Terascale embedded systems, Super-intelligent agents and global knowledge integration, Networks of smart devices as planetary creature organisms. Our future We need a really new programming environment and formats for data/knowledge representation. IFIP
PCs are on track to keep adding processing power as Intel, AMD, and IBM add more cores to chips, perhaps hundreds within a decade will be available. PCs are becoming supercomputers and we need breakthrough research and more training in the programming that's necessary to tap that horsepower. Cell Processor of Playstation3 is a real example. More about our future IFIP
Our approach • Multiple view formats, • Self-explanatory components, and • Filmification of methods. IFIP
A multi-grid method for boundary value problems Numerical Recipes in C: The art of scientific computing, William H. Press and others, Cambridge University Press, 2nd edition IFIP
A multi-grid method for boundary value problems Icon language program: IFIP
Dijkstra’s algorithm for finding the shortest path #include<studio's> #include<stl.h> #include<vector> #include<slist> /** * class: graph * usage: #include <slist> */ class graph { public: vector<vector<int> > m; vector<vector<int> > adj; vector<vector<int>::iterator> pos; /** * Constructor * @param the number of nodes */ graph(){} graph( int n ){ resize(n); } /** * @param the number of node */ void resize( int n ){ m.resize(n), adj.resize(n), pos.resize(n); for ( int i = 0; i < n; i++ ){ m[i].resize(n); fill( m[i].begin(), m[i].end(), 0 ); adj[i].clear(); } } /** * @return the number of node */ int size(){ return m.size(); } /** * insert e between i and j; * @param i, j, e(weight) * if it is non-weighted graph, e should be 1. * if it is undirected graph, Do insert(i, j, e) and insert(j, i, e). */ void insert( int i, int j, int e ){ m[i][j] = e; adj[i].push_back(j); } /** * refer to weight. * usage: using g[i][j], edge weight can be refered. */ vector<int> & operator[](int i){ return m[i]; } /** * refere to adjacency list of node i, and move one. */ int next( int i ){ if( pos[i]==adj[i].end() ) return -1; return *pos[i]++; } /** * begin again of adjacency list reference of node i. */ void reset(int i){ pos[i] = adj[i].begin(); } /** * begin again of adjacency list reference of all node. * Before use graph, it must be called !!!. */ void reset(){ for(int i=0; i<size(); i++) reset(i); } /* less used methods */ void erase( int i, int j ){ m[i][j] = 0; for ( slist<int>::iterator it = adj[i].begin(); it != adj[i].end(); it++ ){ if ( *it == j ){ adj[i].erase( it ); break; } } } /** clear all nodes */ void clear(){ m.clear(), adj.clear(), pos.clear(); } }; #include<stdio.h> /************* * Dijkstra * ************/ #include "graph.h" graph g; int n; void dijkstra(graph &g, vector<int> &pi, vector<int> &d, int s); /** * Dijkstra * @param * pi: previous node * -1 --> source and not visited node * cost: distance from source * 0 --> source * INT_MAX --> not visited node * Solved 10171, */ void dijkstra( graph &g, vector<int> &pi, vector<int> &cost, int s ){ cost.resize( g.size(), INT_MAX ); pi.resize( g.size(), -1 ); vector<int> visited( g.size(), 0 ); cost[s] = 0; g.reset(); while ( 1 ){ int min = INT_MAX; int x; for ( int i = 0; i < g.size(); i++ ){ if ( visited[i] == 0 && min > cost[i] ){ min = cost[i]; x = i; } } if( min == INT_MAX ) break; visited[x] = 1; int v; while ( ( v = g.next(x) ) != -1 ){ if( !visited[v] && cost[x] + g.m[x][v] < cost[v] ){ cost[v] = cost[x] + g.m[x][v]; pi[v] = x; } } } } void read(){ int i, j, e; cin >> n; g = graph(n); while(1){ cin >> i >> j >> e; if( cin.eof() ) break; g.insert(i, j, e); g.insert(j, i, e); } } main(){ read(); /* read graph */ vector<int> pi, cost; g.reset(); dijkstra(g, pi, cost, 0); cout << "pi: "; for(int i=0; i<n; i++) printf("%3d", pi[i]); cout << endl; cout << "cost : "; for(int i=0; i<n; i++) printf("%3d", cost[i]); cout << endl; } C++ code for the Dijkstra’s algorithm with a general graph structure IFIP
Dijkstra’s algorithm for finding the shortest path Icon language code for the Dijkstra’s algorithm with a general graph structure IFIP
These visual programs are physically much smaller than the text they replace because: High level representation of computational structures, activities on these structures, branching statements, etc. Reduced number of variables, Simplified index expressions and formulas, etc. Compactness of the new type programs IFIP
Part 1 IFIP
A 2D scheme: example IFIP
A pyramid scheme IFIP
Flash types IFIP
All they can be reduced to 1-D, 2-D, and 3-D structures like lists, queues, stacks, grids, trees, general graphs, pyramids, multistage-networks, some lines, surfaces, moving particles, and compositions of these structures, and to partial orders of structure node (particle) traversals represented by explicit or implicit forms. Observation of computational schemes IFIP
Self-explanatory components in cyberFilm formats, cyberFilm management systems and adaptive human-computer interface, cyberFilm databases and data/ knowledge acquisition. A basis of our project IFIP
A cyberFilmis a set of series of color pictures, A pictureis to represent a view (a feature) of an object or process, A series of picturesis to represent a multiple view (a lot of features) of an object or process. CyberFilm concept IFIP
Multiple viewis to make the corresponding object or process be self-explained, Self-explained film means that the associated pictures are organized and presented in such a way that the semantic richness of data/ knowledge is clearly brought out. Self-explanatory concept IFIP
Algorithmic cyberFilms Algorithmic Skeleton Variables Activity I/O Operations Integrated feature • Presented/Specified rather independently by special multimedia language and subsystem, • Automatic frame creation, • One construct can be used to explain meaning of other’s. IFIP
Algorithmic Skeletons View • structures and flows of computation IFIP
Algorithmic action View • Examples: indexing iu[ i ][ j ] = 0.5 x ( iu[ i – 1 ][ j ] + iu[ i + 1 ][ j ] ) IFIP
Algorithmic action view • Examples of formulas: iu[i-1][j] + iu[i-1][j-1] + iu[i+1][j+1] + iu[i+1][j] + iu[i+1][j-1] + iu[i+1][j+1] + iu[i][j-1] + iu[i][j+1] – 4*iu[i][j] IFIP
Integrated View • compact form of: algorithmic skeletons, variables/formulas, I/O In fact, our icon language allows programming of a conventional text type, but with characters and symbols of much higher level. Other views of the program are used to explain its features. IFIP
Background & Foreground • Background & Foreground Images • Decrease abstractness of contents, • Simplify understanding of the contents, • Comments and annotations. • Control Background & Control Foreground Images • Used in reference icons of activity expressions, • Differentiate activity states. IFIP
Background images Examples: IFIP
Control Foreground/Background Images Example: IFIP
CyberFrame Examples: IFIP
Extended set of CyberFim views • the most appropriate media for each feature • right time to show an appropriate feature through a right channel • self-explanatory features IFIP
CyberFilm library Template library Programming Environment User Filmification of Methods Browsers/editors Algorithmic CyberFilm Template Program Program Generator Computer IFIP
Classification of templates and computational scenario prediction • To keepperformance: • A set of templates for each scene taking into account possible levels of parallelism should be behind. IFIP
A number of features presented by multimedia frames are assembled into a structure (cyberFilm), In right time a right group of corresponding frames is extracted and presented through a right channel. Once more about cyberFilm concept IFIP
Features of the programming environment • Acquisition of data-knowledge as self- explanatory components • CyberFilms: high performance for people, • Template programs: high performance for parallel machines. • Programming through multiple-view descriptions • Program development is split into a set of more simple tasks/views, with automatic integrations of partial decisions. • In spite of the high-level descriptions, efficiency of generated codes can be saved. IFIP
This approach allows developing more compact, understandable, and reusable software components. Different computational features can be described/specified rather independently in a set of visual languages. Acquisition of data-knowledge. The knowledge in cyberFilm format supported by a set of template programs Conclusion IFIP
Meaning is a product of thought. Multiple views minimize energy spending for this activity. Corresponding data/knowledge is easier to understand for a shorter period and remember for a prolonged period. This keeps at a minimum rote memorization. The multimedia format allow to a much larger population of users not only to improve accessibility, understandability, and usability of information resources, but also to express such things as beauty or feeling. Conclusion 2 IFIP
Thank you !! IFIP