! ******************************************************************************************************************************** ! Created: 30-AUG-2007 11:29:56 by OpenVMS SDL IA64-2 ! Source: 30-AUG-2007 11:29:56 GEM$:[GEMGROUP.SHEILAM.FORSYSDEF.IVMS-V83]PPL$ROUTINES.SDI;1 ! ******************************************************************************************************************************** !*** MODULE ppl$routines *** !DEC$ OPTIONS/ALIGN=(RECORDS=PACKED,COMMONS=PACKED)/NOWARN ! *************************************************************************** ! * ! COPYRIGHT (c) 1988 BY * ! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * ! ALL RIGHTS RESERVED. * ! * ! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * ! ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * ! INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * ! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * ! OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * ! TRANSFERRED. * ! * ! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * ! AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * ! CORPORATION. * ! * ! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * ! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. * ! * ! * ! *************************************************************************** ! PPL$ADJUST_SEMAPHORE_MAXIMUM ! ! Adjust a Semaphore Maximum ! ! The Adjust a Semaphore Maximum routine increments or decrements the maximum ! associated with a semaphore. ! INTEGER*4 ppl$adjust_semaphore_maximum EXTERNAL ppl$adjust_semaphore_maximum ! PPL$ADJUST_QUORUM ! ! Adjust Barrier Quorum ! ! The Adjust Barrier Quorum routine increments or decrements the quorum ! associated with a barrier. ! INTEGER*4 ppl$adjust_quorum EXTERNAL ppl$adjust_quorum ! PPL$AWAIT_EVENT ! ! Await Event Occurrence ! ! The Await Event Occurrence routine blocks the caller until an event ! occurs. ! INTEGER*4 ppl$await_event EXTERNAL ppl$await_event ! PPL$CREATE_APPLICATION ! ! Form or Join a PPL$ Application ! ! The Form or Join a PPL$ Application routine informs the PPL$ facility ! that the calling process is forming or joining a parallel application. ! INTEGER*4 ppl$create_application EXTERNAL ppl$create_application ! PPL$CREATE_BARRIER ! ! Create a Barrier ! ! The Create a Barrier routine creates and initializes a ! barrier, and returns the barrier identifier. ! You use the barrier identifier to perform all operations on that ! barrier. ! INTEGER*4 ppl$create_barrier EXTERNAL ppl$create_barrier ! PPL$CREATE_EVENT ! ! Create an Event ! ! The Create an Event routine creates an arbitrary user-defined event ! and returns the event identifier. You use the event identifier to ! perform all operations on that event. ! INTEGER*4 ppl$create_event EXTERNAL ppl$create_event ! PPL$CREATE_SPIN_LOCK ! ! Create Spin Lock ! ! The Create Spin Lock routine creates and initializes a simple (spin) ! lock, and returns the lock identifier. You use that lock identifier to ! get and free the lock. ! INTEGER*4 ppl$create_spin_lock EXTERNAL ppl$create_spin_lock ! PPL$CREATE_SHARED_MEMORY ! ! Create Shared Memory ! ! The Create Shared Memory routine creates (if necessary) and maps a ! section of memory that can be shared by multiple processes. ! INTEGER*4 ppl$create_shared_memory EXTERNAL ppl$create_shared_memory ! PPL$CREATE_WORK_QUEUE ! ! Create a Work Queue ! ! The Create a Work Queue routine creates and initializes a work queue, and ! returns the work queue identifier. ! INTEGER*4 ppl$create_work_queue EXTERNAL ppl$create_work_queue ! PPL$CREATE_SEMAPHORE ! ! Create a Semaphore ! ! The Create a Semaphore routine creates and initializes a ! semaphore with a waiting queue, and returns the semaphore identifier. ! You use the semaphore identifier to perform all operations on that ! semaphore. ! INTEGER*4 ppl$create_semaphore EXTERNAL ppl$create_semaphore ! PPL$CREATE_VM_ZONE ! ! Create a New Virtual Memory Zone ! ! The Create a New Virtual Memory Zone routine creates a new storage ! zone, according to specified arguments, which is available to all ! participants in the application. ! INTEGER*4 ppl$create_vm_zone EXTERNAL ppl$create_vm_zone ! PPL$DELETE_APPLICATION ! ! Delete a PPL$ Application ! ! The Delete a PPL$ Application routine marks all shared memory for ! deletion and prevents additional processes from joining the application. ! INTEGER*4 ppl$delete_application EXTERNAL ppl$delete_application ! PPL$DECREMENT_SEMAPHORE ! ! Decrement a Semaphore ! ! The Decrement a Semaphore routine waits for a semaphore to have a ! value greater than 0, then decrements the value ! by 1 to indicate the allocation of a resource. ! INTEGER*4 ppl$decrement_semaphore EXTERNAL ppl$decrement_semaphore ! PPL$DISABLE_EVENT ! ! Disable Asynchronous Notification of an Event ! ! The Disable Asynchronous Notification of an Event routine disables delivery to a ! process of notification of an event by either AST or signal. ! INTEGER*4 ppl$disable_event EXTERNAL ppl$disable_event ! PPL$DELETE_WORK_ITEM ! ! Delete a Work Queue Item ! ! The Delete a Work Queue Item routine deletes a work item from a work ! queue. ! INTEGER*4 ppl$delete_work_item EXTERNAL ppl$delete_work_item ! PPL$DELETE_SHARED_MEMORY ! ! Delete Shared Memory ! ! The Delete Shared Memory routine deletes or unmaps from a global ! section that you created using the PPL$CREATE_SHARED_MEMORY routine. ! Optionally, this routine writes the contents of the global section to ! disk before deleting the section. ! INTEGER*4 ppl$delete_shared_memory EXTERNAL ppl$delete_shared_memory ! PPL$DELETE_WORK_QUEUE ! ! Delete a Work Queue ! ! The Delete a Work Queue routine deletes the specified work queue, and releases ! any storage associated with it. ! INTEGER*4 ppl$delete_work_queue EXTERNAL ppl$delete_work_queue ! PPL$ENABLE_EVENT_AST ! ! Enable AST Notification of an Event ! ! The Enable AST Notification of an Event routine specifies the address of ! an AST routine (and optionally an argument to that routine) to be delivered ! when an event occurs. ! INTEGER*4 ppl$enable_event_ast EXTERNAL ppl$enable_event_ast ! PPL$ENABLE_EVENT_SIGNAL ! ! Enable Signal Notification of an Event ! ! The Enable Signal Notification of an Event routine specifies a ! condition value to be signaled when the event occurs. ! INTEGER*4 ppl$enable_event_signal EXTERNAL ppl$enable_event_signal ! PPL$FLUSH_SHARED_MEMORY ! ! Flush Shared Memory ! ! The Flush Shared Memory routine writes (flushes) to disk the contents ! of a global section that you created using the PPL$CREATE_SHARED_MEMORY ! routine. Only pages that have been modified are flushed to disk. ! INTEGER*4 ppl$flush_shared_memory EXTERNAL ppl$flush_shared_memory ! PPL$FIND_OBJECT_ID ! ! Find Object Identification ! ! Given the name of a spin lock, semaphore, barrier, event, work queue, ! or shared memory zone, the Find Object Identification routine returns ! the identifier of the object associated with the name you specify. ! INTEGER*4 ppl$find_object_id EXTERNAL ppl$find_object_id ! PPL$FIND_SYNCH_ELEMENT_ID ! ! Find ! ! Given the name of a spin lock, semaphore, barrier, or event, the ! Find Synchronization Element Identification routine returns the ! identifier of the associated synchronization element. ! INTEGER*4 ppl$find_synch_element_id EXTERNAL ppl$find_synch_element_id ! PPL$GET_INDEX ! ! Get Index of a Participant ! ! The Get Index of a Participant routine returns an index that is unique ! within the application. A value of zero signifies the participant that ! formed the application. The other participants in the application ! always return an index greater than zero. ! INTEGER*4 ppl$get_index EXTERNAL ppl$get_index ! PPL$INSERT_WORK_ITEM ! ! Insert a Work Queue Item ! ! The Insert a Work Queue Item routine inserts a work item into the specified work ! queue. ! INTEGER*4 ppl$insert_work_item EXTERNAL ppl$insert_work_item ! PPL$INCREMENT_SEMAPHORE ! ! Increment a Semaphore ! ! The Increment a Semaphore routine increments the value of the semaphore ! by 1, analogous to the signal protocol. If any other participants ! are blocked on a call to PPL$DECREMENT_SEMAPHORE for this semaphore, ! one is removed from the queue and awakened. ! The semaphore must have been created by PPL$CREATE_SEMAPHORE. ! INTEGER*4 ppl$increment_semaphore EXTERNAL ppl$increment_semaphore ! PPL$INDEX_TO_PID ! ! Convert Participant Index to VMS PID ! ! The Convert Participant Index to VMS PID routine returns the VMS PID ! of the process associated with the specified index. ! INTEGER*4 ppl$index_to_pid EXTERNAL ppl$index_to_pid ! PPL$INITIALIZE ! ! Initialize the PPL$ Facility ! ! The Initialize the PPL$ Facility routine informs the PPL$ facility that the ! caller is forming or joining the parallel application. Calling this ! routine is optional, because PPL$ initializes itself at the ! first call to a PPL$ routine. ! INTEGER*4 ppl$initialize EXTERNAL ppl$initialize ! PPL$PID_TO_INDEX ! ! Convert VMS PID to Participant Index ! ! The Convert VMS PID to Participant Index routine returns the PPL$-defined ! participant index of the process associated with the ! specified VMS PID. ! INTEGER*4 ppl$pid_to_index EXTERNAL ppl$pid_to_index ! PPL$READ_BARRIER ! ! Read a Barrier ! ! The Read a Barrier routine returns the specified barrier's current quorum and ! the number of participants currently waiting (blocked) at the barrier. The ! barrier must have been created by PPL$CREATE_BARRIER. ! INTEGER*4 ppl$read_barrier EXTERNAL ppl$read_barrier ! PPL$READ_EVENT ! ! Read an Event State ! ! The Read an Event State routine returns the current state of the specified ! event. ! The state can be not_occurred or not_occurred. ! INTEGER*4 ppl$read_event EXTERNAL ppl$read_event ! PPL$READ_SEMAPHORE ! ! Read Semaphore Values ! ! The Read Semaphore Values routine returns the current or ! maximum values, or both, of the specified counting semaphore. ! The semaphore must have been created by ! PPL$CREATE_SEMAPHORE. ! INTEGER*4 ppl$read_semaphore EXTERNAL ppl$read_semaphore ! PPL$RELEASE_SPIN_LOCK ! ! Release Spin Lock ! ! The Release Spin Lock routine relinquishes the spin lock by clearing the ! bit representing the lock. The lock must have been created by ! PPL$CREATE_SPIN_LOCK. ! INTEGER*4 ppl$release_spin_lock EXTERNAL ppl$release_spin_lock ! PPL$RESET_EVENT ! ! Reset an Event ! ! The Reset an Event routine resets an event's state to ! not_occurred. ! INTEGER*4 ppl$reset_event EXTERNAL ppl$reset_event ! PPL$REMOVE_WORK_ITEM ! ! Remove a Work Queue Item ! ! The Remove a Work Queue Item routine removes the next item in order from a work ! queue. ! INTEGER*4 ppl$remove_work_item EXTERNAL ppl$remove_work_item ! PPL$READ_SPIN_LOCK ! ! Read a Spin Lock State ! ! The Read a Spin Lock State routine returns the current state of a spin ! lock. The state can be not_seized or not_seized. ! INTEGER*4 ppl$read_spin_lock EXTERNAL ppl$read_spin_lock ! PPL$READ_WORK_QUEUE ! ! Read a Work Queue ! ! The Read a Work Queue routine returns information about a work queue. ! INTEGER*4 ppl$read_work_queue EXTERNAL ppl$read_work_queue ! PPL$SET_SEMAPHORE_MAXIMUM ! ! Set a Semaphore Maximum ! ! The Set a Semaphore Maximum routine dynamically sets the maximum value of a ! semaphore. ! INTEGER*4 ppl$set_semaphore_maximum EXTERNAL ppl$set_semaphore_maximum ! PPL$SPAWN ! ! Initiate Parallel Execution ! ! The Initiate Parallel Execution routine executes code in parallel ! with the caller by creating one or more subordinate threads of execution ! (VMS subprocesses). ! INTEGER*4 ppl$spawn EXTERNAL ppl$spawn ! PPL$SET_QUORUM ! ! Set Barrier Quorum ! ! The Set Barrier Quorum routine dynamically sets a value for the ! specified barrier's quorum. ! INTEGER*4 ppl$set_quorum EXTERNAL ppl$set_quorum ! PPL$STOP ! ! Stop a Participant ! ! The Stop a Participant routine terminates the execution of the specified ! participant in this application. ! INTEGER*4 ppl$stop EXTERNAL ppl$stop ! PPL$SEIZE_SPIN_LOCK ! ! Seize Spin Lock ! ! The Seize Spin Lock routine retrieves a simple (spin) lock by waiting in a ! spin loop until the lock is free. The lock must have been created by ! PPL$CREATE_SPIN_LOCK.…/* ! INTEGER*4 ppl$seize_spin_lock EXTERNAL ppl$seize_spin_lock ! PPL$TERMINATE ! ! Abort PPL$ Participation ! ! The Abort PPL$ Participation routine ends the caller's ! participation in the application prematurely---that is, at some time ! before the caller actually completes its execution. ! INTEGER*4 ppl$terminate EXTERNAL ppl$terminate ! PPL$TRIGGER_EVENT ! ! Trigger an Event ! ! The Trigger an Event routine causes the event's state to become ! occurred. You control whether all pending actions for ! the event are processed (made to occur), or just one is processed. ! A pending action can be an AST, a signal (condition), or a wakeup. ! INTEGER*4 ppl$trigger_event EXTERNAL ppl$trigger_event ! PPL$UNIQUE_NAME ! ! Produce a Unique Name ! ! The Produce a Unique Name routine returns an application-unique name. ! A system-unique string specific to the calling application is appended ! to the string specified by the user. ! The resulting name is identical for all participants in ! the application, but different from those for all other applications on that ! system. ! INTEGER*4 ppl$unique_name EXTERNAL ppl$unique_name ! PPL$WAIT_AT_BARRIER ! ! Synchronize at a Barrier ! ! The Synchronize at a Barrier routine causes the caller to ! wait at the specified barrier. ! The barrier is in effect from the time the first participant calls ! PPL$WAIT_AT_BARRIER until each member of the ! quorum has issued the call. At that time, the wait concludes and ! all are released for further execution. ! INTEGER*4 ppl$wait_at_barrier EXTERNAL ppl$wait_at_barrier !DEC$ END OPTIONS