| | 1830 | | pprime = 0; |
| | 1831 | | |
| | 1832 | | while (1) { |
| | 1833 | | FD_ZERO(&rfds);
|
| | 1834 | | FD_SET(ppnetsock, &rfds);
|
| | 1835 | | t.tv_sec = 0; |
| | 1836 | | t.tv_usec = 0; |
| | 1837 | | cc = select(ppnetsock + 1, |
| | 1838 | | #ifdef FDSETISINT |
| | 1839 | | (int *)&rfds, (int *)0, (int *)0, |
| | 1840 | | #else |
| | 1841 | | (fd_set *)&rfds, (fd_set *)0, (fd_set *)0, |
| | 1842 | | #endif |
| | 1843 | | &t); |
| | 1844 | | if (cc == 1) { |
| | 1845 | | oslen = sizeof(osad); |
| | 1846 | | recvfrom(ppnetsock, buf, sizeof(buf), |
| | 1847 | | 0, (struct sockaddr*)&osad, &oslen); |
| | 1848 | | |
| | 1849 | | } else if (cc != -1 || errno != EINTR)
|
| | 1850 | | break; |
| | 1851 | | } |
| | 1852 | | |
| | 1853 | | } else { |
| | 1854 | | if (tp = task_findpid(deads[rdead].dd_pid)) { |
| | 1855 | | |
| | 1856 | | |
| | 1857 | | |
| | 1858 | | |
| | 1859 | | |
| | 1860 | | tp->t_status = deads[rdead].dd_es; |
| | 1861 | | tp->t_utime = deads[rdead].dd_ut; |
| | 1862 | | tp->t_stime = deads[rdead].dd_st; |
| | 1863 | | while (tp->t_out >= 0) { |
| | 1864 | | |
| | 1865 | | #ifdef FDSETNOTSTRUCT |
| | 1866 | | fd_set rfds; |
| | 1867 | | #else |
| | 1868 | | struct fd_set rfds; |
| | 1869 | | #endif |
| | 1870 | | |
| | 1871 | | FD_ZERO(&rfds);
|
| | 1872 | | FD_SET(tp->t_out, &rfds);
|
| | 1873 | | TVCLEAR(&tout);
|
| | 1874 | | if (select(tp->t_out + 1, |
| | 1875 | | #ifdef FDSETISINT |
| | 1876 | | (int *)&rfds, (int *)0, (int *)0, |
| | 1877 | | #else |
| | 1878 | | (fd_set *)&rfds, (fd_set *)0, (fd_set *)0, |
| | 1879 | | #endif |
| | 1880 | | &tout) == 1) |
| | 1881 | | loclstout(tp); |
| | 1882 | | |
| | 1883 | | else |
| | 1884 | | break; |
| | 1885 | | } |
| | 1886 | | #if defined(IMA_PGON) || defined(IMA_SP2MPI) || defined(IMA_AIX4SP2) \ |
| | 1887 | | || defined(IMA_AIX5SP2) || defined(IMA_BEOLIN) |
| | 1888 | | mpp_free(tp); |
| | 1889 | | #endif |
| | 1890 | | task_cleanup(tp); |
| | 1891 | | task_free(tp); |
| | 1892 | | } |
| | 1893 | | } |
| | 1894 | | if (++rdead >= ndead) |
| | 1895 | | rdead = 0; |
| | 1896 | | } |
| | 1897 | | |
| | 1898 | | netoutput(); |
| | 1899 | | |
| | 1900 | | if (runstate == PVMDHALTING) {
|
| | 1901 | | pvmlogerror("work() pvmd halting\n"); |
| | 1902 | | pvmbailout(0); |
| | 1903 | | } |
| | 1904 | | |
| | 1905 | | |
| | 1906 | | pvmgetclock(&tnow); |
| | 1907 | | if (runstate == PVMDSTARTUP && TVXLTY(&tbail, &tnow)) {
|
| | 1908 | | pvmlogerror("work() run = STARTUP, timed out waiting for master\n"); |
| | 1909 | | pvmbailout(0); |
| | 1910 | | } |
| | 1911 | | |
| | 1912 | | |
| | 1913 | | |
| | 1914 | | |
| | 1915 | | if (TVXLTY(&tping, &tnow)) {
|
| | 1916 | | if (pvmdebmask & (PDMPACKET|PDMSELECT))
|
| | 1917 | | pvmlogerror("work() ping timer\n"); |
| | 1918 | | if (runstate == PVMDNORMAL || runstate == PVMDHTUPD) {
|
| | 1919 | | do { |
| | 1920 | | if (++lastpinged > hosts->ht_last) |
| | 1921 | | lastpinged = 1; |
| | 1922 | | } while (!(hp = hosts->ht_hosts[lastpinged])); |
| | 1923 | | |
| | 1924 | | if (hp->hd_hostpart != myhostpart |
| | 1925 | | && hp->hd_txq->pk_link == hp->hd_txq) { |
| | 1926 | | mp = mesg_new(0); |
| | 1927 | | mp->m_tag = DM_NULL;
|
| | 1928 | | mp->m_dst = hp->hd_hostpart | TIDPVMD;
|
| | 1929 | | sendmessage(mp); |
| | 1930 | | } |
| | 1931 | | } |
| | 1932 | | tout.tv_sec = DDPINGTIME;
|
| | 1933 | | tout.tv_usec = 0; |
| | 1934 | | TVXADDY(&tping, &tnow, &tout);
|
| | 1935 | | } |
| | 1936 | | |
| | 1937 | | |
| | 1938 | | |
| | 1939 | | |
| | 1940 | | |
| | 1941 | | if (opq->pk_tlink == opq) |
| | 1942 | | tout = tping; |
| | 1943 | | else |
| *opq->pk_tlink is freed | 1944 | | tout = opq->pk_tlink->pk_rtv; |