Unit 1 - Lesson 3: The Partition
Page 1 of 1

Author:  tlwiechmann [ Thu May 19, 2011 6:33 am ]
Post subject:  Unit 1 - Lesson 3: The Partition

The concept of a partition goes back to the beginning of MUMPS. It's important to understand that the partition is a logical concept and is not a part of the standard. For this course it is meant as a teaching device. It is not given any attention in the standard and is only mentioned in the definitions section of the 1995 language specification. So, look at the partition as a logical concept for teaching, not a physical concept for implementation.

Please note: Under the Associated Routine section, reference is made to non-standard commands ZRemove, ZLoad, ZSave. Command, Function, Special Variable and Structured System Variable names that begin with Z are nonstandard. These commands originated in DEC's MUMPS-11 and were perpetuated through DSM-11 and it's derivatives and clones VAX DSM, MSM and all of InterSystems implementations. GT.M and MUMPSV1 do not use them.

Generally study this section and understand the contents of the partition.

Author:  pkmccann [ Wed Jun 01, 2011 5:29 pm ]
Post subject:  Re: Unit 1 - Lesson 3: The Partition

Hi Terry,
I hope this is the place to ask questions. I am curious about the "Associated Routine". Is this a routine that is executed when you login to a namespace? If so, how is it "triggered" or is my understanding of this routine not correct?
Thank you,

Author:  tlwiechmann [ Thu Jun 02, 2011 10:06 am ]
Post subject:  Re: Unit 1 - Lesson 3: The Partition

Thank you for the question. It points out the fact that this section in the guide should be rewritten.

A little bit of history. The original MUMPS systems did not run on general purpose operating systems as they do now. They took over a machine and had there own OS built in. Everything was self contained.

The information given in the Associated Routines section is basically a relic of that era. It applies to all derivative systems of DSM-11 (physically or cloned) but not GT.M or MUMPSV1. The associated routine concept came from the fact that a partition had a routine buffer associated with it where the routine was loaded and executed. Routines were generally stored under the Global Module(the database). They could be loaded, edited and deleted using these Z commands within this buffer. It was the workplace for the programmer.

Since it was incredibly expensive to dedicate a machine to MUMPS only, MUMPS implementations migrated to general purpose OS's where other applications could be run. This gave the implementers choices as to how they wanted to handle creating, editing and executing a routine(s). Some stuck with the Z command approach. GT.M moved the routines to the file system to take advantage of the available editing tools, etc.

The bottom line is that routines are associated with a process through the execution process. Here's the explanation that applies to all MUMPS systems. What happens under the hood is irrelevant.

For any MUMPS process, you can execute a MUMPS program. The program consists of one or more MUMPS routines that call each other according to how the programmer designed them. Every program has as (at least) one entry point where execution starts. There are two modes in which execution can begin. First, when you are in programming mode, that is, when working at the ">" prompt. Second, in application mode where the program is executed from the actual MUMPS command line typically from a script.

Lets take the programming mode approach. To execute the routine, you would enter enter one of two commands:

> DO entryref
> GOTO entryref

without getting into the standard definitional formality of it, an entryref can be:

label [ +integer] [ ^routinename ]
or simply

That is:

where PATENT is the entry point routine. Execution will begin with the first line.
where execution will begin at the line with the label ENTER.
DO ENTER+3^PATENT where execution will begin 3 lines beyond ENTER. This not recommended!
DO ENTER where it is assumed that the execution context is within the routine ^PATENT.

Before executing a routine, there is no routine associated with the process (or partition).When executed, the routine(s) are associated with the process. How this happens is implementation specific.

When executed in application mode, the entry point is specified on the MUMPS command line. An implicit DO is performed.

I hope this did not confuse you further. This seems like a perfect place for certain implementers to jump in.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group