Count a single WPAR from the Global WPAR

The following program is an example of a count of a single WPAR from the global WPAR.

main ()
{
        pm_prog_t prog;
        pm_wpar_ctx_info_t wp_list;
        int nwpars = 1;
        cid_t cid;

        /* set programming for WPAR ``wpar1'' */
        getcorralid("wpar1", &cid);
        pm_set_program_wp(cid, &prog);

        pm_start_wp(cid);
        ... workload ...
        pm_stop_wp(cid);

        /* retrieve data for WPAR ``wpar1'' */
        pm_get_wplist("wpar1", &wp_list, &nwpars);
        pm_get_data_wp(wp_list.wp_handle, &data);

        pm_delete_program_wp(cid);
}