2 /* copyright (c) 1996, 1997, 1998, 1999 William R. Pearson and the
5 /* $Name: fa_34_26_5 $ - $Id: hostacc.c,v 1.7 2006/04/12 18:00:02 wrp Exp $ */
7 /* Concurrent read version */
27 extern char prog_name[];
40 for (i=FIRSTNODE; i< nnodes; i++) if (tid==pinums[i]) return i;
45 /* rand_nodes selects nnodes at random from max_nodes */
48 rand_nodes(int *node_map, int nnodes, int max_nodes)
50 int node_used[MAXNOD];
54 gettimeofday(&tv,NULL);
57 for (i=0; i<max_nodes; i++) node_used[i]=0;
59 if (nnodes < (max_nodes+1)/2) {
60 for (i=0; i<nnodes; ) {
62 if (node_used[j]) continue;
70 for (i=0; i<(max_nodes-nnodes); ) {
72 if (node_used[j]) continue;
78 for (i=j=0; i<nnodes; j++)
79 if (node_used[j]) continue;
82 /* for (i=0; i<nnodes; i++) fprintf(stderr,"%2d %2d\n",i,node_map[i]); */