Focal Point
[CLOSED] Running fex program parallely, Running two or more program together

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4677038595

December 23, 2010, 09:00 PM
MKS
[CLOSED] Running fex program parallely, Running two or more program together
Is it POssible to run two or more fex program together, in any possible manner.

I have a main program main.fex in which i need to call 3 child program and i would like to excute these child program simultaneously so that it reduces the total time need for the whole report to complete. In usual manner we use -INCLUDE to include the child in main program, but this wouldn't run the program in parallel.

This message has been edited. Last edited by: Kerry,


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
December 23, 2010, 09:13 PM
Waz
By default you will not be able to run parts of the fex concurrently.

You will also be limited in what you can do with V5.2.5.

Why do you need these to be run concurrently ?, How long does it run ?

Is each part long running ?

Keep in mind, that if you are able to run multiple processes, there will need to be avaiable agents on the server.

Also do the three fexs supply data to the main.fex for later processing ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 23, 2010, 09:22 PM
MKS
The data size is huge more than 50K, and i suspect that the report will take huge time to complete. So to avoid that, it will be better if the report is run parallely for 10K each.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
December 23, 2010, 09:29 PM
Waz
quote:
The data size is huge more than 50K


50,000 records ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 23, 2010, 09:30 PM
MKS
yes


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
December 23, 2010, 09:42 PM
Waz
50,000 isn't very large, and I would expect WebFOCUS on HP-UX would handle it quite easily.

Are you doing any complex joins with the data ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 28, 2010, 12:11 PM
N.Selph
Run them simultaineously on Report Caster in different jobs. If they are long running, that is probably better anyway.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
December 30, 2010, 07:25 PM
Waz
I've just spotted a function called SPAWN, that may do what you want.

Syntax is SPAWN(inlength, command, outcode)

Check it out in the documentation.

The call will be difficult, if 5.2.5 has it, as you will have to call edastart with either -f {script} or -x {focus command}.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 31, 2010, 03:09 AM
Ram Prasad E
Yes its possible using HTMLFORM and iframes. But in Internet explorer there is a limitation of 2 parallel execution, which can be modified in registry. http://support.microsoft.com/kb/282402


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
December 31, 2010, 05:00 AM
<JG>
The problem with SPAWN is that it can only be called from a DEFINE or COMPUTE
so it's not going help MKS's problem.

What MKS does not say if the 3 called procedures are generating 3 outputs
or if they are processing to supply data for the "whole report"

If it’s the 1st then it’s not possible as an edastart session cannot return output to a browser.

The major issue with parallel running is that you must wait for all to complete before you can finalize
The output.
This means that they need to be executed with a loop that checks for completion of each
Component.

The only real way to do this is via an edastart –f passing it a script or edastart –x passing it a command
And you must remember that these will not generate output to the browser they can only generate hold files.

What’s more there are a number of issues that you need to take into account.

1. edastart -f/-x do not execute any profiles e.g. site.wfs, edasprof.prf etc.

2. They will use the directory from where the edastart is called as the ‘edatemp’ directory
so you must ensure that unique names are used for any hold files.

3. They will not know any variables that have been set in the parent procedure;
they must be passed via the calling process if you want to use them.

As Waz says 50K rows is peanuts from a WebFOCUS perspective, unless you are using ridiculous
Cross platform JOINs.

My advice is, the pain and aggravation associated with trying to do this is so great don’t bother trying.
January 02, 2011, 12:55 PM
j.gross
"Is it possible to run two or more fex program together, in any possible manner."

Is this to run online (with the eventual output directed to the browser) -- or batch (scheduled in Reportcaster)?

For an online report, here is a method I used several years ago.

Have the "parent" fex return an initial html page, which on load submits N forms, one for each of the "child" fexes, to run them in parallel. That allows them to run in parallel, on individual "agents" in WFRS. Each of those N forms directs its output to a separate iframe in the initial page, which (on load) runs a function located in the parent document. That function bumps a counter, and if the counter has reached N submits a request to run the final report fex, which utilizes the outputs of the child processes and produces the final output (replacing the initial html page)

Essentially, the initial html page is acting as a controller (which is why this method cannot work in batch), initiating all the parallel processes, and allowing the last one in to turn on the lights.

The child proceeses have to be designed so that
(a) their output remains accessible to the final report exec;
(b) they operate independently of each other; and
(c) multiple users can exercise this structure without interfering with each other.
-- but that is true in any event.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
January 02, 2011, 03:18 PM
<JG>
quote:
But in Internet explorer there is a limitation of 2 parallel execution


Ram, "That's not entirely correct" (Sorry just re-watched Independance Day).

The limit is on the number of parallel downloads to the browser, not the requests to generate the downloads.
If you have multiple iFrames requesting data it will take the first 2 or 6 as default for download
then automatically download the next 2 or 6 (browser version dependant).

Jack, Hidden iFrame approach + script counter. Never thought of that.
Now that Foccache is available, That's got to be much more viable and easy.
January 03, 2011, 05:35 AM
j.gross
In development I kept the frames small but visible, which allowed access to the echo of each child process fex.

It's still subject to the browser's timeout limits; but at least you can identify which horse never finished.
January 06, 2011, 04:22 AM
MKS
This is not a online report, reports are generated in hold files. and each of the program creates different output with different hold file name.

JG's suggestion on using edastart -f looks promising. Can you please explain a little more on it?


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
February 03, 2011, 01:03 AM
MKS
Used "nohup" to run several edastart in background, by creating separate fex program for each edastart running in background.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
February 03, 2011, 02:23 AM
Ramkumar - Webfous
Going for two ReportCaster scheduler Jobs, will be one quite easy option I guess...

Or You can write a Batch or Shell or any OS Native script to run two or more procs at single point in time.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
April 22, 2011, 03:05 AM
MKS
I have now new trouble with this. Since using TABLE FILE, I am getting some error as below

04/21/2011 07:42:10 u=abcd, pid=8544: errmes: "baserr: ERROR page number 1, hfoc_flags = 0, flags = 1"
04/21/2011 07:42:10 u=abcd, pid=8544: errmes: "ERRNO code = 2 No such file or directory"
04/21/2011 07:42:10 u=abcd, pid=8544: errmes: " 6010784768 bytes free "
04/21/2011 07:42:10 u=abcd, pid=8544: errmes: "error in basrd: read error: FOCSORT "
04/21/2011 07:42:21 u=abcd, pid=8546: errmes: "Error accessing FOCUS file /abcd/wf_temp/test/conf1/focsort.foc, FOCUS name FOC
SORT "
04/21/2011 07:42:21 u=abcd, pid=8546: errmes: "baserr: ERROR page number 1, hfoc_flags = 0, flags = 1"
04/21/2011 07:42:21 u=abcd, pid=8546: errmes: "ERRNO code = 2 No such file or directory"
04/21/2011 07:42:21 u=abcd, pid=8546: errmes: " 6010784768 bytes free "
04/21/2011 07:42:21 u=abcd, pid=8546: errmes: "error in basrd: read error: FOCSORT "

It Looks like the FOCSORT file is getting rewritten for each parallel process.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
April 24, 2011, 05:15 AM
<JG>
quote:
It Looks like the FOCSORT file is getting rewritten for each parallel process.
Quite correct.
If you are starting multiple processes then you must make sure that each one has it's own workspace (edatemp).