|
Hi, William:You can take advantage of SMP and "DB2 Multisystem", if you have a system with more than one processor activated ... But, to truly take advantage of more than one processor requires designing the application to use multiple threads. Languages like C and Java support multiple threads directly. However, it is NOT a trivial exercise to design applications that can really benefit from the simultaneous execution of multiple threads. And, RPGLE and ILE COBOL have somewhat limited support for threads, so far.
And, you cannot use multi-threading in any interactive (5250 "green-screen") jobs, only in batch.
Now, consider that each OS/400 Batch job IS a separate "task", with one "thread" of execution.
Say you have a batch job that processes a very large database file or table with millions or billions of records, and it runs for many hours ... you could do something like this:
#1. create several different logical files over the base table (PF), where each LF uses select logic to select a subset of the records. For example, you might create 10 different LFs where each LF selects 10% of the records in the base table.
#2. then, you can submit 10 different copies of your batch job, all running the same exact RPG program, but each job does an OVRDBF to use a different one of the above LFs, so that each job now works on only a "subset" of the data. (You might want to pass the name of the LF to use as a parameter to the "wrapper" CL for the batch job, so it can do something like this in the wrapper CLP: PGM PARM(&FILENAME)
DCL VAR(&FILENAME) TYPE(*CHAR) LEN(10) ... OVRDBF FILE(thefile) TOFILE(*LIBL/&FILENAME) CALL PGM(yourprogram) ...#3. finally, you may need a "final" job to consolidate the results, for example, if you are going to produce a report with totals, etc. (You might have to modify your program slightly, e.g. to write the results of each batch job to a temporary results file, for use by the "finalization" job to total up all of the subtotals, etc.)
The idea here is, if you have multiple processors activated (and on the larger iSeries and i5 models, such as 550, 570 or 595s, you can have up to 32 or more processors), each job can be running simultaneously on a different processor.
Also, even on a single processor machine, when one job is waiting for I/O, one of the other jobs can be running, although I might not create 10 LFs in that case, but perhaps only 4, each with 25% of the total # of records. The idea here is, while one job waits for I/O, one of the other jobs can be "processing." (Recall that every AS/400 model, from the first generation and smallest models, to the latest and largest, have many IOPs and IOAs installed, and these I/O Processors are really separate processors that "off-load" much of the work of I/O from the main or central processor(s), leaving them free to work on other jobs. So, that is how you can see greatly improved performance by splitting up jobs in this way, even on the smaller models, with only one physical processor.)
The "big idea" here is, this is an easy way to get many of the same benefits of multiple threads, even in languages that do not directly support threads, such as OPM RPG/400 or COBOL/400, or ILE RPGLE or COBOL, which support a limited version of threads. (And, you don't have to learn many of the complexities of how to write programs that are multi-threaded.)
I know of some customers who achieved dramatic results using these simple techniques. For example, a batch job that was running overnight, and was beginning to run so long that it was still running the next morning, was reduced to running in just one or two hours, using this approach.
To give credit where credit is due, I learned this technique from one of the "masters," Dick Bains of IBM Rochester, while attending a session he presented at COMMON in Anaheim in 1993(?) ... ;-)
Hope that helps, Mark S. Waterbury > William N. Harrell, Jr. wrote:
With the advent of the new hardware 5 or so years back, SQLs take advantage of Symmetrical Multi-Processing, as long as the system attributes are set correctly. Is there any way to code any RPG programs to take advantage of Symmetrical Multi Processing? Or would it just be RPGILE with embedded SQL? I had some old links to IBM on the subject 5 or so years back but they are now are broken on the IBM support site.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.