Application: GUI program (use eeml_Init() to register to session manager as a application), and Application includes Job
Job: Non-GUI program (use esmg_jobinit() to register to session manager as a job)
There are different sets of functions provided under IMAGINE to build APPLICATIONS and JOBS.
1. Application - Every program which calls the function eeml_Init() is registered by the IMAGINE Session Manager as an APPLICATION. The communication between the Application and the Session Manager is two-way (i.e. the Session Manager sends/receives commands to/from an application). An application can call all of the documented toolkit functions in the eeml package. Applications can freely exit with the C system call exit() any time they need to exit. The Session Manager will automatically detect the application's exit.
2. Job - Every program which calls the function esmg_JobInit() is registered by the IMAGINE Session Manager as a JOB. The Session Manager automatically displays a progress meter for every job. A job can regularly call esmg_JobProgress() to report the status of task to the IMAGINE Session manager which, in turn, displayed the progress in the progress meter for that job. A job should call the esmg_InterruptQuery() function regularly during its processing. This function will inform the job if the user decides to cancel the job through the Cancel button provided by Session Manager in the progress meter. After it has completed, the job must call esmg_JobEnd() to signal the Session Manager that it is exiting. The communication between a job and the Session Manager is one-way most of the time (i.e., the job sends commands to the Session Manager). For certain query commands, the Session Manager will send a reply back to the job.
Jobs should not call any functions designed for Applications (i.e., functions documented in the eeml package). Conversely, Applications should not call functions designed for Jobs, such as esmg_JobInit, esmg_JobState, esmg_JobProgress, esmg_JobEnd, etc.