PCN Release 2.0 Changes from v2.0b2 -> v2.0 ======================================= * Fixed a bug in code that determines when to do heap expansion. If a PCN program tried to allocate a large array (where "large" means a number greater than the address of the top of the heap), it would cause the test for the need to expand the heap to fail due to integer arithmetic wraparound. Therefore, the heap would not get expanded as it should, and the subsequent array allocation would cause a segmentation fault. The test now accounts for arithmetic wraparound. * Modified sys:distribute() -- the stream distributor: - Added range checking - Added broadcasting. It you send {"all",msg} into the distributor, then msg will be put onto all of the distributor output streams. * Modified pcnlink to produce shorter pcnt files (about 30% smaller). The was achieved through the use of macros in the pcn_structs.h header file to shorten commonly used symbols, and by removing extraneous white space and comments. * Added PCN_FPRINTF_HACK as a G_DEFS configuration option. On some machines (NeXT running 3.0, Sequent Symmetry running Dynix (not PTX), fprintf() does not return the number of characters that were printed. On these machines, stdio:fprintf() is hacked to return non-zero upon non-failure so that it is at least somewhat compatible with other machines. However, the returned value may not be correct. * Modified pcncomp: - Added help. - Added -noflags argument to turn off debug cflags or fflags. * Updated src/runtime/sr_doc.h, which contains information about the send/receive module that would be useful to anyone trying to port PCN to a new machine. * Modified PDB: - All procedures have debugging enabled upon startup (i.e., debug *:*) - If you try to set a breakpoint (using "break") on a procedure that doesn't exist, it will tell you instead of doing nothing. * Fixed #ifdefs throughout the runtime system so that it will compile with the sr_null module (which does an #undef PARALLEL). This should allow uniprocessor versions to build properly. * Modified the Makefiles throughout the src tree to use the configuration name (G_CONFIG) instead of the architecture type (G_ARCH) in the library suffixes. So now all names should be keyed off the configuration name only. * Updated the docs, examples, man, and tests directories. * Added a configuration for the Sequent Symmetry running Dynix (not PTX). * Changed the arguments to stdio:freopen() to more closely match the C equivalent of that procedure. * Added variables to src/include/pcn_structs.h when compiling pcnt files that will cause ld to fail is the pcnt.c file is compiled with one combination of -profile and/or -pdb flags, but the link is done with a different combination. Previously, this link would succeed and would result in the runtime system dying because the runtime system data structures would not match the pcnt file's data structures. (Yes, someone got bit by this...) Changes from v2.0b1 -> v2.0b2 ======================================= * Added the gauge X windows based profile analysis tool to the release. Changes from v2.0a9 -> v2.0b1 ======================================= * Fixed a PCN compiler parser bug. Character constants of the form 'a' were not getting parsed correctly. (This was apparently introduced when we switched from flex to lex.) * Fixed a race condition is the dumping of Gauge profiles. Previously, a node could send a MSG_EXIT message before the host had gotten all of its MSG_GAUGE messages. * Fixed several bugs in the ipsc860 Gauge profiler. * Changed the way model information is saved in .pam files and in how the linker uses them to create the pcnt file. The ispc860 could not handle long strings (it was croaking on the models to some long procedures). The fix was to break the model information up into a bunch of shorter strings that wouldn't kill the compiler. So now the model field of a proc_header is a pointer to an array of character strings, rather than directly to a character string. * Add -nmp and -no_nmp to the PCN linker (and to pcncomp, of course). "nmp" stands for No Module Profile. The "-nmp " flag tell the linker to NOT generate Gauge profiler model information for procedures in the specified module. If is something like "vt_*", then all modules whose names start with "vt_" will have their model information ignored. By default, the following modules are ignored: vt_* vts boot co_msg co_run The -no_nmp flag says to get rid of these defaults (and any previously listed -nmp arguments), so that you can profile all modules including these system modules. * In the SGI Iris configuration, the -cckr flag was removed from the CFLAGS parameters. This flag tells the compiler to conform to old K&R C, which was causing the '\a' character constant to break. This flag was relic from days gone by when the runtime source wasn't quite so ANSI compliant. (Actually, it still doesn't use argument prototyping, but you can blame that on the bundled Sun C compiler in SunOS 4.1.2 which doesn't support ANSI prototyping...) Changes from v2.0a8 -> v2.0a9 ======================================= * Added full Gauge support to the runtime system. See the RELEASE_NOTES for more information on using Gauge. * Added full Upshot support to the runtime system. See the RELEASE_NOTES for more information on using Upshot. * A -signal runtime flag has been added. When this flag is used, all signal handlers in the emulator will be turned off. This can occasionally be useful in finding bugs. * Fixed a compiler parser bug where a syntax error would not cause the compiler to exit with a non-zero exit code under certain circumstances. * Fixed a PCN compiler bug dealing with transforming functions. You should now be able to ignore the return value. For example, if f() is a function, then "{|| f() }" will work correctly, and its return argument will just be ignored. * Fixed a bug in the delta configuration. Changes from v2.0a7 -> v2.0a8 ======================================= * Added delta support * In ipsc860 version, fixed two bugs: - In includes/pcn_structs.h, there was an #ifdef ipsc860 there that shouldn't have been, which was causing ipsc860 links to fail. - stdio:rename() and stdio:remove() should now work. The ipsc860 does not have the ANSI procedures that these calls wrap, so they had to be written in terms of link() and unlink() on this machine. * Fixed a dynamic linking bug relating to correctly resolving foreign calls. * In general, compiling for the ipsc860 and delta can be annoying because they require an environment variable (PGI) to be set to different values. To make things "just work", the configurations for these two machines now sets the appropriate environment variable. Then, whenever you cross compile a program (.pcn, .c, or .f) for the ipsc860 or delta via pcncomp, this environment variable will get set correctly, and the correct compiler will get called. No more having to manually change your environment and path in order to switch from one to the other. It "just works"... * Changed all Makefiles to use pcncomp when compiling .c files, instead of calling the C compiler directory. This was done so that the configuration file would get sourced (to set environment variables for ipsc860 and delta compiles) and so that G_DEFS (from the config file) would automatically be added to the compiler line. * Changed all of the G_DEGS to have a PCN_ prefix. Since pcncomp automatically adds these to .pcn and .c compile lines, I didn't want to take the chance of them clashing with a user's defines. * Much of the virtual topology (vt) server has been rewritten, yet again. In particular, remaps and shutdown have been made even more efficient. However, this is an entirely behind the scenes change -- the syntax and semantics of vt as far as the user is concerned are unchanged. Changes from v2.0a6 -> v2.0a7 ======================================= * The compiler driver, pcncomp, has been completely rewritten as a shell script. This new driver also drive pcnlink, so a user should never have to run pcnlink directly. Other related changes: - pcnlink no longer runs the compile of the pcnt file or the link step. This is now handled by the pcncomp shell script. - pcncomp's arguments are modelled after cc. For example, to compile a .pcn to a .pam, you would now run "pcncomp -c file.pcn". - pcncomp will run the C or Fortran compiler is it gets a .c or .f file, respectively, as an argument. * Cross compilation to the Intel iPSC/860 is now supported. To cross compile to that machine run you pcncomp's with a "-target ipsc860" flag. Support for new cross compilations targets has now been made quite easy to implement as overlay's over existing installations. * Added IBM RS/6000 support. * Much of the virtual topology (vt) server has been rewritten. In particular, remaps are no longer an O(n^3) operation where n is the number of vt nodes in the new topology. However, this is an entirely behind the scenes change -- the syntax and semantics of vt as far as the user is concerned are unchanged. * Dynamic loading of .pam files is now supported in the PDB version of the emulator. See the RELEASE_NOTES for more information on this. * In the PDB version of the emulator, the header and trailer cells (the words immediately before and after the data structure) of all arguments passed to foreigns are checked for correctness, both before and after calling the foreign. This will help track down code that writes off the end of an array. If it finds a problem, it prints a warning like: (0,51) Warning while exiting foreign procedure f(). The word immediately after the data structure that is passed as argument 1 of 1 to f() is corrupt. This was likely caused by writing out of the bounds of an array. This may cause a subsequent crash of this program. * Also in the PDB version, a command line argument, "-gc_after_foreign", has been added. This causes the garbage collector to get called immediately after every call to a foreign procedure. Since the gc does a very thorough consistency check on the heap, if a foreign procedure trashes the heap then the gc will fatal error out, and a message saying what the last foreign call was will be printed: (pelican)(1279)% ./array_overrun -pcn -gc_after_foreign (0) reduction 52 Fatal error: Node 0: Aborting on signal 10 (0) Last foreign called before fatal error: f (pelican)(1280)% Since the gc will get called immediately after every foreign call, we can be reasonably confident that it was this last foreign procedure that did the trashing. Of course, the assumption on which this is based is that it is hard to trash the heap from pure PCN code in the PDB version of the emulator, since it will catch such things as out of bounds array operations from PCN code. However, experience has shown that this is generally a good assumption. Changes from v2.0a5 -> v2.0a6 (9/25/92) ======================================= * By default, all PCN programs are compiled and linked with support for virtual topologies. Therefore, vt compiles no longer require the -vt flag, and vt links no longer need -plvt to link against the vt library. And all of the standard libraries have compiled with vt support. * Many bugs relating to the parallel aspects of the new garbage collector have been fixed. (The parallel stuff had not been tested in v2.0a5.) Except for one remaining known vt runtime bug, everything is running perfectly in parallel now on networks of workstations. * Dynamic heap resizing has been added. On machines that support virtual memory, if the heap fills up the garbage collector will automatically increase the size of the heap and continue running. Look at the various -heap_* flags on the runtime system and linker. * pcnlink bug fixes/changes: - bug with -nocreate flag fixed -- no longer hangs the linker - unresolved -proc_metacalls() targets no longer yield define errors during linking - vt library added to the list of default libraries that are linked into an executable * pcncomp bug fixes/changes: - the -vt flag is now the default - the compiler will be silent (other than Error, Warning, and Notice, of course) messages, unless a -v flag is added to the pcnlink command line - @0 and @`n` mapping are now supported by the vt compiler for backwards compatibility with PCN v1.x. They are equivalent to @vts:node(0%nodes()) and @vts:node(n%nodes()), respectively. - a compile with the -novt flag of source that contains mapping (i.e., @whatever) no longer hangs the compiler * All of the -heap_* and -gc_slack arguments were changed to use units of cells, rather than kilo-cells. * The .pam files are effectively incompatible with those of previous release, since now all PCN programs are compiled with the VT compiler. Changes from v2.0a4 -> v2.0a5 (9/11/92) ======================================= * New compacting garbage collector, based on the Morris gc algorithm. * Garbage collection detection is now safe. That is, you can never blow out of the top of the heap under certain circumstances like you could in the previous releases. * The .pam files are incompatible with those of previous releases. This was necessitated by the tag structure of the new garbage collector. Changes from v2.0a3 -> v2.0a4 (8/15/92) ======================================= * Added support for the iris (SGI Iris and Indigo). This included: - adding an include for alloca.h into the bison grammer - adding the SHELL variable to the makefiles, so that it would always use /bin/sh. (The path of the shell to use is now settable in the config file.) * Fixed several foreign procedures that took integers are arguments to use int_t and u_int_t, as defined in pcn_types.h. This is done for portability to 64 bit machines. Changes were made in the files: src/pcno/pcno.c src/pipe/pipe.c src/runtime/args.c compiler/ptn_trans/ptn.c compiler/ptn_trans/co_fileio.c * Fixed pcncomp to get the path to the C preprocessor, as well as the installation directory (for the -I flag that is automatically added), from the configuration file. * Fixed a bug in src/compiler/lint/co_foreign.ptn that would cause the following runtime warning to be printed: (0,893808) Warning: comparison operation on non-numeric value in co_foreign:check_dim * Started laying some groundwork in the runtime system to accomidate the new compacting garbage collector (Morris algorithm based). The new gc is coming soon to a theater near you... * If pcnlink encounters a module name more than once, it will only link the first occurrance of that module. This allows you to override a module that is in a library, simply by putting your version of the module on the pcnlink command line before the library. Changes from v2.0a2 -> v2.0a3 (7/29/92) ======================================= * Sped up the pcnlink some more: * Changed more stdio:sprintf() calls to be calls to a foreign procedure that calls the C sprintf(). * Put in hash table for procedure lookups. This should make a difference on big links. * If the -oc flag is not used, the pcnt* files are put in /tmp, so that it doesn't have to go across the network to build and compile this file. * Shortened the pcnt*.c file by about 30%. * Fixed the "Call to foreign procedure" message from pcncomp so that it would print out normally. * Fixed stdio:sprintf(buf,"%t",{t},_). There was a bug in the format extraction code that caused this to make buf=="", no matter what 't' was. * Added the procedures: exit_from_pcn(int_t *) exit_from_c(int) exit_from_fortran(int *) to the runtime system. These procedures can be called from end user PCN, C, and Fortran code, respectively, in order to cleanly exit out of the running parallel program with an exit code. This should be used instead of using exit() directly, since it will shut down the emulator in whatever manner is appropriate for the particular machine. Changes from v2.0a1 -> v2.0a2 (7/13/92) ======================================= * Fixed stdio bug in printing characters has been fixed. Here's the original bug report: > Suppose you have the following program: > > p() > char c; > {; > c := 42, > stdio:printf("char=\"%c\", int=%d\n", {c, c}, _) > } > > If you run it, it will output something like: > > char="", int=704643072 > > However it should output: > > char="*", int=42 > > Reported on 1/16/92 * Fixed bug in copy_mut instruction, when copying an integer to a character, has been fixed. * Fixed bug in run instruction. It wasn't suspending if the module and/or procedure names were not defined. * Fixed gc bug. In the non-pdb version, proc_records did not have a tag cell on them. Therefore, when the main scan loop of the gc encountered a process record, it would try to follow the proc_header pointer. However, since proc_headers a now no longer on the heap, this was screwing it up, making it think that it was data that needed to be copied onto the new heap. So it would call copy_ds_to_new_space() which would hit an illegal tag, since proc_headers aren't tagged. This bug did not occur in the pdb version, since proc_records are tagged in that version -- so during the gc scan it will just skip over proc_records. The solution was to always use tags on the proc_records, even in the non-pdb version. Changes from v1.2.2 -> v2.0a1 (6/30/92) ======================================= * Standalone system: All that this entails... * Compiler is at least 4-5 times faster, due to standalone linkage. * New parser: Better error message, faster, more maintainable, etc... * C preprocessor flags are now passed to cpp correctly. * The unary negation ('-') operator works on variables and expressions, not just numbers. * Lint bug fixed: Consider the program: p(c,i) char c[10]; {? c[i] == 5 -> ... } This would cause a lint warning, saying that this guard test will always fail. In fact, it will not, since a character array element such as c[i] is extracted into an integer. Changes from v1.2.1 -> v1.2.2 (5/6/92) ======================================= * Nested expressions compiler bug: The compiler now properly handles expressions within an array subscript or as an argument to a foreign procedure. For example, the old compiler would generate incorrect PCN abstract machine code for the following two procedures: test1(ws,i,n,c) double ws[],c; {? i < n -> {; c := 1.0, ws[i*2] := c, ws[i*2+1] := c, test1(ws,i+1,n,c) } } test2(in,out) double a,b; { ; a := in, c_cos(a*2,b), out = b } In test1(), the expressions that are used as subscipts for ws[] were not correctly handled. In test2(), the expression used in the call to the foreign procedure, c_cos(), was not correctly handled by the compiler. Both of these cases are now fixed. * Bug in -n flag to pcncc on network version of PCN: pcncc -n 2 should cause the creation of a custom emulator that defaults to having two nodes. This was broken in v1.2.1 and earlier, and has now been fixed. * The use of free() in sr_bsdipc.c on a Sun: The use of free() in this file was changed so that it no longer expects a return code on the Sun. In certain Sun configurations, this caused a build problem. Now, free() never expects a return code. * IBM RS/6000 configuration file change: The Configs/rs6000 configuration file was changed to compile the runtime system with the -O flag on the C compiler. Before IBM AIX version 3.2, compiling the runtime system with this optimizer flag caused it to crash. This IBM C compiler optimizer bug appears to have been fixed under AIX v3.2 and later. * The intel386 configuration (Intel 386 Unix PC, running System V3.2 -- the System Resource Manager for an iPSC/860) is no longer a supported configuration. To develop code for the iPSC/860 you must use the cross compiler tools from a Sun. You really do not want to run PCN on an SRM anyway... * A new version of the virtual topology (VT) compiler and libraries. Changes from v1.2 -> v1.2.1 (5/1/92) ======================================= * Parser bug fix: The compiler will report multiple parse errors in a single file, instead of dying after the first parse error. * Global suspension queue rescheduling fix: Under v1.2 and earlier, the processes on the global suspension queue were only rescheduled when the active queue became empty. This could cause a process to never get rescheduled even if its data was available. Now, processes on the global suspension queue are also automatically rescheduled periodically (by default, every 1000 reductions). The -gri command line argument (Global suspension queue Reschedule Interval) specifies the number of reductions between this automatic rescheduling. This fix only affects procedures in which different guards in the procedure suspend on different variables. For example, in the procedure: react(in1, in2) {? in1 ?= [ in1_data | in1_tail ] -> {|| react_to_input1(in1_data), react(in1_tail, in2) }, in2 ?= [ in2_data | in2_tail ] -> {|| react_to_input2(in2_data), react(in1, in2_tail) } } If both in1 and in2 are undefined, then this procedure will suspend on the global suspension queue. Changes from v1.2 beta14 -> v1.2 (3/4/92) ======================================= The following is a list of fixes/enhancements to the v1.2 compiler: * Multiple default's in a choice block should get warning and skipped (only the first default is used). * No new lines are printed to the screen when doing things like transform("foo"). * It should say unknown primitive print/2 when you have print(X,Y). * In Lint, foreign(a+1) is dealt with correctly * Lint does not complain about data(mutable) * Lint does not do type checking for definitions and assignments. * The compiler will stop after the parse phase if the parser detects errors. The following "new" features are supported by the compiler: * tcomp/form will run the code through lint now * ftcomp/fform will not run the code through lint * tlint is used to lint PTN programs Other fixes and changes: * sys: This module has been completely rewritten. It contains many new operations, and has new names for some of the old ones. However, backward compatibility with the old sys module has been maintained. * stdio: fread() and fwrite() have been added. They are defined as follows: fread(buf, size, nitems, fd, status) Read in 'nitems', each of size 'size' from 'fd'. Define 'buf' to be a character array containing the read in data. (So 'buf' should be an undefined variable when this is called.) 'status' is defined to be the number of items actually read, or 0 upon end of file or error. fwrite(buf, size, nitems, fd, status) Write 'nitems', each of size 'size' to 'fd'. 'buf' is assumed to be a character array. 'status' is defined to be the number of items actually written, or 0 upon end of file or error. * Suppose you have the following program: p() char w[4], c; {; c := 42, w[0] := c } When run under PDB, this will yield a "put_element: Illegal tag" error message. This is because put_element did not have a case for putting a character into a character array element. (It only had a case for putting an integer into a character array element.) Solution: Fixed put_element so that it does all of the type casts that can be done in copy_mut. * Suppose you have the following program: p(X) X ?= {_} -> N = X[0] + 1 When run under PDB this generates a "get_element: Illegal tag" error message because. The problem is that get_tuple does not dereference the register containing X, but get_element assumes the register will already be dereferenced when it is called. Solution: It was fixed by changing the get_tuple instruction so that it writes the dereferenced value back into the register. Thus, get_tuple now does a full data check. (i.e., It checks for suspension and dereferences the register.) * xpcn has been updated to include fixes that should: - allow it to compile and run under X11R5 (in addition to X11R4) - allow it to compile and run on a DECstation - allow it to compile and run on a NeXT - fix a number of other bugs * Numerous internal changes to support future development...