Newsgroups: comp.parallel.pvm
From: hleroy@fantasm.irisa.fr (Hugues Leroy)
Subject: Re: Is pvm_config() faulty - or am I being stupid?
Organization: IRISA, Campus de Beaulieu, 35042 Rennes Cedex, FRANCE
Date: 15 Aug 1995 13:59:27 GMT
Message-ID: <40q97v$q5q@news.irisa.fr>

Nick, transform your code as follows:



/*
        test for pvm_config()
*/

#include <stdio.h>
#include "pvm3.h"

struct pvmhostinfo *HostInfo;

main() {
  int i,nhosts,narchs,info,my_tid;
  
  my_tid=pvm_mytid();
  info=pvm_config(&nhosts, &narchs, &HostInfo);
  printf("\nHosts: %d, Archs: %d, Info: %d\n",nhosts,narchs,info);

  for (i=0; i<nhosts; i++)
    printf("\nMachine: %s, Speed: %d\n",
      HostInfo[i].hi_name,HostInfo[i].hi_speed);
  pvm_exit();
}

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Hugues Leroy  INRIA /IRISA 35042 RENNES CEDEX, FRANCE
RAPID: Reseau de ressources des Applications Paralleles
       pour l'Industrie et le Developpement scientifique
        http://www.irisa.fr/rapid
Tel: (+33) 99 84 74 17         Fax: (+33) 99 84 71 71
==-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Nick Smith wrote:

|> I am having problems getting pvm_config() to return the information for
|> all machines. I have tried PVM 3.3.8 on HPPA/HP-UX 9.0x and PVM 3.3.7 on
|> SUN4/SunOS 4.1.3. See the program below with corresponding O/P
|> 
|> The first machine is returned OK, but others are not returned,
|> or if I try to access higher elements in the returned array, the task exits
|> without printing anything. I have tried PVM 3.3.8 on HPPA/HP-UX 9.0x with
|> HP-C compiler, and PVM 3.3.7 on SUN4/SunOS 4.1.3 with gcc.
|> 
|> Any clues would be of great help - is this a bug or am I just being STUPID?
|> 
|> /*
|> 	test for pvm_config()
|> */
|> 
|> #include <stdio.h>
|> #include "pvm3.h"
|> 
|> struct pvmhostinfo *HostInfo[10];
|> 
|> main(void) {
|>   int i,nhosts,narchs,info,my_tid;
|>   
|>   my_tid=pvm_mytid();
|>   info=pvm_config(&nhosts,&narchs,HostInfo);
|>   printf("\nHosts: %d, Archs: %d, Info: %d\n",nhosts,narchs,info);
|> 
|>   for (i=0; i<nhosts; i++)
|>     printf("\nMachine: %s, Speed: %d\n",
|>       HostInfo[i]->hi_name,HostInfo[i]->hi_speed);
|>   pvm_exit();
|> }
|> 
|> pvm> conf
|> 6 hosts, 1 data format
|>                     HOST     DTID     ARCH   SPEED
|>                     nmlc    40000     HPPA     714
|>                     nmla    80000     HPPA     384
|>                     nmlb    c0000     HPPA     303
|>                     nmld   100000     HPPA    1000
|>                     nmle   140000     HPPA     714
|>                     nmlf   180000     HPPA     556
|> pvm> spawn -> ctest/ctest
|> [1]
|> 1 successful
|> t80001
|> pvm> [1:t80001] 
|> [1:t80001] Hosts: 6, Archs: 1, Info: 0
|> [1:t80001] 
|> [1:t80001] Machine: nmlc, Speed: 714
|> [1:t80001] 
|> [1:t80001] Machine: , Speed: 0
|> [1:t80001] 
|> [1:t80001] Machine: , Speed: 0
|> [1:t80001] 
|> [1:t80001] Machine: , Speed: 0
|> [1:t80001] 
|> [1:t80001] Machine: , Speed: 0
|> [1:t80001] 
|> [1:t80001] Machine: , Speed: 0
|> [1:t80001] EOF
|> [1] finished
|> pvm> 


