Applaunch tutorial

From GPU

Tutorial on applaunch Applaunch, or “Application Launcher” is a GPU plugin that can call any process. With a little practice, it may be the base of your custom plugin. The terragen wrapper 'earthsim' was initally called using applaunch, until we optimized it (mainly to do multiple jobs) as dll. The advantage is that earthsim could just be developed as stand alone application.

How to use applaunch?

Basically it goes like this.

(as per gemini)

there is one plugin, 'applaunch'.
if you place a binary in the 'binexec' directory,
and call applaunch with it as gpu command, like: 
3,2,1,'mybinary',applaunch 
then gpu will execute %GPU%\binexec\mybinary.bat|exe "1" "2" "3" 
and wait for the process to terminate 
and return the exit code of the process to the user. 

Those steps will be repeated in next section guided with screen shots.

Enable the applaunch plugin

Image:Applaunchdll.png

Make sure the check box 'Enable' is checked. Applaunch itself has- no front end

Now we explore the GPU directory, and enter the binexec directory:

We start a command line console and execute 'cmd' (xp/w2k) or 'command' (win9x):

Type 'cd'<space> and drag and drop the folder name on your console's prompt. Then launch the editor with “edit filename”:

Now, we will make a very simple batch file. It asks the user for input.

Now we are finished and tested or bat, we are ready to launch it from within gpu.

We look for the gpu commands tab, and enter

'test1', launch

Note that we omit the .bat extension.

Note that hiding the application is not a job of applaunch. The application has to do that itself.

However, applaunch will minimize it. Running it will launch a dos-like windew on your taskbar:

GPU will show up the results:

As you can see, it is computing . Waiting for the job to complete.

That is true, because just a command prompt showed up, asking us something:

We enter an answer:

Hit enter, the bex terminates, and with GPU we see the results:

Batch files and application can handle 32-bit exit codes. Some exit codes are “reserved”. A batch file with an error will return 255. If all is well and you use no exit code, it defaults to zero (0). Now all that is left is copy your application to multiple hosts, and perform the same comaand, but hit the ,compute globally, button instead. All nodes with this plugin installed would prompt the user for input.

Of course, there can a lot be done. I am not a batch guru, but they may be convenient. Any application can be run like this. If the application has no native support, you may need a wrapper, that down- &upload the data files and parses commands or scripts to the actual job. However, the possibilities are endless. For optimal performance, think of many many small jobs, a dll may be more suitable then calling an executable. Compare that to running php as isapi dll or in cgi mode.