[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface : Subroutine Reference

Chapter 18. Distributed Application Processing (DAP)

The subroutines in this section initiate and terminate a distributed application process.

GPEXAP - Execute Application Process

GPEXAP (apid, ncid, size, namel, name, parmt, parml, parm, xferflag, useridl, userid, passwordl, password)

Purpose

Use GPEXAP to execute a Distributed Application Process (DAP) through a connected nucleus on a local or remote node. Depending upon the value of the transfer and/or execute parameter (xferflag), the DAP specified through the name parameter either is executed if the DAP already resides on the node or is transferred to the nucleus's node and then is executed.

If the xferflag parameter is set to 2=TRANSFER_EXECUTE , then the name parameter is interpreted to be the path and filename of the DAP object code on the shell's file system. DAPs transferred to the 6095 nucleus's file system are loaded into memory. DAPs transferred to the RISC System/6000 nucleus's file system are placed in a unique temporary directory and erased when the DAP is terminated. By default this will be the /tmp/.gP/ xxxxx directory where xxxxx is the concatenation of the nucleus identifier and the DAP resource identifier. This will insure that the path to the DAP is unique for all DAPs on a RISC System/6000. In order to provide the user control of the size of the directory that will contain the downloaded DAPs, you may override /tmp/.gP/ with your own path by specifying the DAPPATH default in the External Defaults File (EDF) or by using the -p option of the gPinit command (see The graPHIGS Programming Interface: Technical Reference for information on the gPinit command)

If the xferflag parameter is set to 1=EXECUTE_ONLY , then the name parameter is interpreted to be the path and filename of the DAP object code on the nucleus's file system.

For DAPs targeted for the RISC System/6000, where the xferflag is set to either 1=EXECUTE_ONLY or 2=TRANSFER_EXECUTE , a userid and password on the nucleus's node must be provided for the operation to be performed. The DAPs must be prelinked with any required libraries.

For DAPs targeted for the IBM 6095, the xferflag, userid, and password parameters are ignored and the DAP is transferred and executed in a manner equivalent to the Initiate Application Process (GPINAP) subroutine. The DAPs must be prelinked with any required nonshared libraries. System memory with the specified size is allocated, the specified program module is loaded into the memory and the module is started with the passing of the specified data as its parameter. The program module must reside on a disk that is accessible from the shell as a single file with a format that can be loaded by the control program in the 6090.

As with the GPINAP subroutine, DAPs started with the GPEXAP subroutine can be terminated with the Terminate Application Process (GPTMAP) subroutine.

Parameters

apid -- specified by user, fullword integer

Application process identifier.

ncid -- specified by user, fullword integer

Nucleus identifier.

size -- specified by user, fullword integer

Size of the memory allocated for the application process in bytes (>=0) The size must be large enough to contain the program module itself and all storage used by the application process. This parameter is ignored if the nucleus is running on a RISC System/6000.

namel -- specified by user, fullword integer

Length of the file name in bytes (0<=namel<=80)

name -- specified by user, variable length character string

Name of the file that contains the program module of the application process. If the xferflag parameter is set to 1=EXECUTE_ONLY , then name is interpreted to be the path and filename of the DAP object code on the nucleus's file system. If the xferflag parameter is set to 2=TRANSFER_EXECUTE , then name is interpreted to be the path and filename of the DAP object code on the shell's file system. This parameter looks like a Unix AIX file descriptor which consists of a [/path/]filename[.extension] Path is the route of directories through the file system on an AIX system. It is optional and is ignored for MVS and VM.

Following is an example of a full file descriptor:

/dap/appl1.o

  • path = /dap/ which says go from the root directory to directory dap

  • filename = appl1

  • extension = .o
  • If the xferflag parameter is set to 1=EXECUTE_ONLY , then the name is passed to the nucleus as specified by the application. If the xferflag parameter is set to 2=TRANSFER_EXECUTE , then the following rules apply to the name parameter depending on which system the shell is running:

  • AIX

  • filename - The filename must be supplied.

  • extension - The extension is optional.

  • path - The path is optional. If the path is not included, then the default directory at the time of the execution of the function will be used.
  • MVS, MVS/XA

  • filename - The filename must be supplied and it is a member name within a partition data set if the extension is included. If the extension is not included, then the filename is the DD-name of the partition data set.

  • extension - The extension is optional. If specified it is the DD-name of the partition data set including the member filename.

  • the recommended file format for DAP object files targeted for AIX is V or VB and for the 6095 is F or FB

  • the recommended record length for DAP object files targeted for AIX is 2052 and for the 6095 is 80.
  • VM/CMS

  • filename - The filename must be supplied.

  • extension - The extension is optional. If it is not included, then an extension of .COF is used.

  • the filename.extension will be folded to upper case.

  • the recommended file format for DAP object files targeted for AIX is V and for the 6095 is F

  • the recommended record length for DAP object files targeted for AIX is 8192 and for the 6095 is 80.
  • parmt -- specified by user, fullword integer

    Format of the parameter data and method of passing it to the main entry point of the application process. The following options are available:

    0 =

    No parameters are to be passed to the application process. Parameters parml and parm are ignored.

    1 =

    The parameter data consists of a single string. This string will be split into strings which contains no white space (blanks, newline, tabs, etc.) before being passed to the application process. The application entry point will receive two parameters. The first parameter will contain the number of strings resulting from the parsing operation described above. The second parameter will contain a list of pointers to each of the strings. The main entry declaration could be coded in "C" as follows:
          void main( argc, argv )
             int    argc;
             char * argv[[default]

    On a RISC System/6000, the path and filename of the executing DAP is

       arg[o]
    The arguments specified by the parm parameter are
       arg[1..n]

    On an IBM 6095 system, the arguments specified by the parm parameter are

       arg[0.. n]

    2 =

    The parameter data contains arbitrary information which has content that is only understood by the application processes. A pointer to the data and the amount of data is passed to the application process when it is started. The main entry declaration could be coded in "C" as follows:
          void main( parmlen, parmptr )
             int    parmlen;
             char * parmptr;
     

    Note:

    This parameter is not supported by a nucleus running on a RISC System/6000 and if it is specified an error will be generated. For this option, it is the application's responsibility to perform character code, floating-point, and byte order conversion, if needed, between the two environments in which the application processes are executing.

    parml -- specified by user, fullword integer

    Length of data to be passed to the process as its invocation parameter in bytes (>=0)

    parm -- specified by user, variable length character or byte string

    Data to be passed to the process as its invocation parameter. The format of the data contained in this parameter is defined by parmt

    xferflag -- specified by user, fullword integer

    Transfer and/or execute flag (1=EXECUTE_ONLY , 2=TRANSFER_EXECUTE ) Only option 2=TRANSFER_EXECUTE is valid if the nucleus is running on a IBM 6095 system.

    useridl -- specified by user, fullword integer

    Length of userid string. This parameter is ignored if the nucleus is running on a IBM 6095 system.

    userid -- specified by user, variable length character string

    Userid of a user on the nucleus's node. This parameter is ignored if the nucleus is running on a IBM 6095 system.

    Notes:

    1. The nucleus targeted to execute the DAP must be a remote nucleus and be enabled to support DAP execution (see gPinit in The graPHIGS Programming Interface: Technical Reference

    2. The userid specified though the userid parameter, does not have to be the userid under which the nucleus is running.

    3. The DAP will be executed under the specified userid.
    4. passwordl -- specified by user, fullword integer

      Length of password string. This parameter is ignored if the nucleus is running on a IBM 6095 system.

      password -- specified by user, variable length character string

      The password corresponding to the userid supplied through the userid parameter. This parameter is ignored if the nucleus is running on an IBM 6095 system.

      Note:

      AIX passwords within the AFS system cannot be verified and will result in error 210. In AFS, only locally defined passwords are accessible to the graPHIGS nucleus for validation.

      Error Codes

      202
      SPECIFIED NUCLEUS DOES NOT EXIST
      210
      RESOURCE CREATION DETECTED AN INVALID USERID/PASSWORD
      217
      RESOURCE CREATION REQUEST EXCEEDS NUCLEUS TABLE CAPACITY
      1132
      RESOURCE CREATION AFS USERID/PASSWORD VALIDATION SUBSYSTEM TIMEOUT
      1133
      RESOURCE CREATION REQUIRED AN AFS TOKEN THAT DOES NOT EXIST
      1301
      SPECIFIED APPLICATION PROCESS ID ALREADY IN USE
      1303
      SIZE OF APPLICATION PROCESS REGION IS TOO LARGE
      1304
      APPLICATION PROCESS REQUEST EXCEEDS NUCLEUS CAPACITY
      1305
      LENGTH OF APPLICATION MODULE NAME IS INVALID
      1307
      APPLICATION MODULE HAS UNRESOLVED EXTERNAL REFERENCE a1
      1308
      PARAMETER TYPE IS INVALID
      1309
      PARAMETER LENGTH < ZERO
      1310
      APPLICATION MODULE SIZE > REGION SIZE
      1311
      APPLICATION LOAD MODULE IS INVALID
      1316
      APPLICATION PROCESS ID=n1 EXITED WITH CODE=n2
      1317
      FLAG PARAMETER IS INVALID

      Related Subroutines

      GPQNCE
      Inquire Nucleus Environment

      RCP code

      201342468 (X'0C003E04')


      [ Previous | Next | Contents | Glossary | Home | Search ]