Newsgroups: comp.parallel.pvm
From: pit@veilchen.informatik.rwth-aachen.de (Peter Chertman)
Subject: Re: [HELP}: Bus Error doing PVM_SPAWN()
Organization: RWTH -Aachen / Rechnerbetrieb Informatik
Date: 21 Nov 1995 16:15:18 GMT
Message-ID: <48stum$dm7@news.rwth-aachen.de>

Antonio Scotti <scotti@centauro.upc.es> writes:

> Hi,

  Hello Antonio,

> does anyone know what may cause a program to crash while executing
> pvm_spawn()?
> I checked all of pvm_spawn() parameters but everything looks ok
> here is the piece of code under investigation:

>    info = pvm_spawn("pxgj", (char**)0, 0, "", NTASKS-1, &tids[1]); 
>    if(info != NTASKS-1 || info < 0){
>      pvm_perror("pxgj");
>      pvm_exit();
>      cout<<"pvm_spawn failed: info = "<<info<<" n = "<<n<<endl;
>      return -1;
>    }  

  I don't imply you're an idiot and I don't want to tell you how to create a
C-program, but the only source of error can be the "&tids[1]" -part. The way
you wrote your code, "tids" must be of type

    int* tids[2];
    tids[1] = new int [NTASKS];

  or

    int  tids[2][NTASKS];

  If you don't need a two dimensional array, try:

    int tids[NTASKS];
    pvm_spawn ("pxgj", (char **) 0, 0, "", NTASKS -1, &tids);

> The other thing is that it doesn't even return an Error message, (apart for the
> "Bus Error", system message), but it just runs down before a value for 'info'
> could be produced.

  It is likely that the spawn call fails when filling a non-existing array.


  Hope that helped, pit

  +------------------------------------------------------------------------+
  |                                                                        |
  |      \_\_\_                  Peter Chertman                            |
  |     \_     \_   \_\_\_       Lehrstuhl fuer Informatik IV              |
  |    \_     \_  \_     \_      RWTH Aachen, Ahornstr. 55                 |
  |   \_\_\_\_   \_              D-52074 Aachen, Germany                   |
  |  \_         \_                                                         |
  | \_         \_     \_         Tel:    +49-241-80 214 16                 |
  |             \_\_\_           Fax:    +49-241-888 82 20                 |
  |                              mail:   pit@i4.informatik.rwth-aachen.de  |
  |                                                                        |
  +------------------------------------------------------------------------+

