| true | 3945 | | pvm_archcode(arch) |
| | 3946 | | char *arch; |
| | 3947 | | { |
| | 3948 | | struct pvmhostinfo *hlist; |
| | 3949 | | int sbf, rbf, cc; |
| | 3950 | | int nhost, narch; |
| | 3951 | | int i; |
| | 3952 | | TEV_DECLS
|
| | 3953 | | |
| | 3954 | | if (TEV_EXCLUSIVE) {
|
| | 3955 | | if (TEV_DO_TRACE(TEV_ARCHCODE,TEV_EVENT_ENTRY)) {
|
| | 3956 | | TEV_PACK_STRING( TEV_DID_AN, TEV_DATA_SCALAR,
|
| | 3957 | | arch ? arch : "", 1, 1 ); |
| | 3958 | | TEV_FIN;
|
| | 3959 | | } |
| | 3960 | | } |
| | 3961 | | |
| | 3962 | | if (!arch) |
| | 3963 | | cc = PvmBadParam;
|
| | 3964 | | |
| | 3965 | | else |
| | 3966 | | { |
| | 3967 | | |
| | 3968 | | |
| | 3969 | | |
| | 3970 | | |
| | 3971 | | if (!(cc = BEATASK)) {
|
| | 3972 | | sbf = pvm_setsbuf(pvm_mkbuf(PvmDataFoo));
|
| | 3973 | | rbf = pvm_setrbuf(0); |
| | 3974 | | if (pvmschedtid) |
| | 3975 | | cc = msendrecv(pvmschedtid, SM_CONFIG, PvmBaseContext);
|
| | 3976 | | else |
| | 3977 | | cc = msendrecv(TIDPVMD, TM_CONFIG, SYSCTX_TM);
|
| | 3978 | | if (cc > 0) { |
| | 3979 | | pvm_upkint(&nhost, 1, 1); |
| | 3980 | | pvm_upkint(&narch, 1, 1); |
| | 3981 | | hlist = TALLOC(nhost, struct pvmhostinfo, "hi");
|
| | 3982 | | for (i = 0; i < nhost; i++) { |
| | 3983 | | pvm_upkint(&hlist[i].hi_tid, 1, 1); |
| | 3984 | | pvmupkstralloc(&(hlist[i].hi_name)); |
| | 3985 | | pvmupkstralloc(&(hlist[i].hi_arch)); |
| | 3986 | | pvm_upkint(&hlist[i].hi_speed, 1, 1); |
| | 3987 | | pvm_upkint(&hlist[i].hi_dsig, 1, 1); |
| | 3988 | | } |
| | 3989 | | pvm_freebuf(pvm_setrbuf(rbf)); |
| | 3990 | | } |
| | 3991 | | pvm_freebuf(pvm_setsbuf(sbf)); |
| | 3992 | | pvm_setrbuf(rbf); |
| | 3993 | | |
| | 3994 | | cc = PvmNotFound;
|
| | 3995 | | |
| | 3996 | | for ( i=0 ; i < nhost ; i++ ) { |
| | 3997 | | if ( !strcmp(hlist[i].hi_arch, arch) ) { |
| | 3998 | | cc = hlist[i].hi_dsig; |
| | 3999 | | break; |
| | 4000 | | } |
| | 4001 | | } |
| | 4002 | | |
| | 4003 | | while (nhost-- > 0) { |
| | 4004 | | PVM_FREE(hlist[nhost].hi_name);
|
| | 4005 | | PVM_FREE(hlist[nhost].hi_arch);
|
| | 4006 | | } |
| hlist is uninitialized | 4007 | | PVM_FREE(hlist);
|