| | 792 | | gs_cachegroup(sgroup_list, ngroups, rsgroup) |
| | 793 | | GROUP_LIST_PTR sgroup_list; |
| | 794 | | int *ngroups; |
| | 795 | | GROUP_STRUCT_PTR *rsgroup; |
| | 796 | | { |
| | 797 | | char *newname = (char *) NULL;
|
| | 798 | | |
| | 799 | | int info; |
| | 800 | | int len; |
| | 801 | | |
| | 802 | | GROUP_STRUCT_PTR sgroup; |
| | 803 | | |
| | 804 | | *rsgroup = (GROUP_STRUCT_PTR) NULL;
|
| | 805 | | |
| | 806 | | if ( (info = pvm_upkint(&len,1,1)) < 0 ) |
| | 807 | | DO_ERROR_RTN( info, "gs_cachegroup" );
|
| | 808 | | |
| | 809 | | if (len < 0) |
| | 810 | | return(-1); |
| | 811 | | |
| | 812 | | if ( (newname = (char *) PVM_ALLOC(sizeof(char)*(len + 1),
|
| | 813 | | "gs_cachegroup") ) == (char *) NULL)
|
| | 814 | | DO_ERROR_RTN( PvmNoMem, "gs_cachegroup" );
|
| | 815 | | |
| | 816 | | if ( (info = pvm_upkstr(newname)) < 0 ) |
| | 817 | | { |
| | 818 | | PVM_FREE(newname);
|
| | 819 | | DO_ERROR_RTN( info, "gs_cachegroup" );
|
| | 820 | | } |
| | 821 | | |
| | 822 | | sgroup = gs_group(newname, sgroup_list, ngroups, CREATE);
|
| | 823 | | |
| | 824 | | if (sgroup != (GROUP_STRUCT_PTR) NULL)
|
| | 825 | | { |
| | 826 | | if ( (info = pvm_upkint(&(sgroup->ntids),1,1) ) < 0 ) |
| | 827 | | { |
| | 828 | | PVM_FREE(newname);
|
| | 829 | | DO_ERROR_RTN( info, "gs_cachegroup" );
|
| | 830 | | } |
| | 831 | | |
| | 832 | | if ( (info = pvm_upkint(&(sgroup->maxntids),1,1) ) < 0 ) |
| | 833 | | { |
| | 834 | | PVM_FREE(newname);
|
| | 835 | | DO_ERROR_RTN( info, "gs_cachegroup" );
|
| | 836 | | } |
| | 837 | | |
| | 838 | | sgroup->tids = (int *) PVM_ALLOC(sgroup->maxntids*sizeof(int),
|
| | 839 | | "gs_cachegroup"); |
| | 840 | | |
| | 841 | | if (sgroup->tids == (int *) NULL)
|
| | 842 | | gs_delete_group(newname, sgroup_list, ngroups); |
| | 843 | | else |
| | 844 | | { |
| | 845 | | if ( (info = pvm_upkint(sgroup->tids,sgroup->maxntids,1) ) < 0) |
| | 846 | | { |
| | 847 | | gs_delete_group(newname, sgroup_list, ngroups); |
| | 848 | | PVM_FREE(newname);
|
| | 849 | | DO_ERROR_RTN( info, "gs_cachegroup" );
|
| | 850 | | } |
| | 851 | | |
| | 852 | | info = pvm_upkint(&(sgroup->nhosts),1,1); |
| | 853 | | |
| | 854 | | sgroup->np_onhost = (int *) PVM_ALLOC(sizeof(int) *
|
| | 855 | | sgroup->nhosts,"gs_cachegroup"); |
| | 856 | | |
| | 857 | | sgroup->pcoord = (int *) PVM_ALLOC(sizeof(int) *
|
| true | 858 | | sgroup->nhosts,"gs_cachegroup"); |