bproc question

Dan Smith dcs@iastate.edu
Wed, 07 Mar 2001 20:35:55 CST


I am trying to write a simple program that uses bproc_execmove just to see
how it works.  The documentation says very little.  Can someone give me a
hand?

Here is what I have:

#include <stdio.h>
#include <sys/bproc.h>

int node, stat, num;

main(int argc, char *argv[]) 
{

  num = bproc_numnodes();
  node = (int)argv[1];
  printf("Number of nodes: %d\n", num);
  printf("Command: %s\n", argv[2]);
  stat = bproc_execmove(node, argv[2], 0, 0);
  printf("Status of bproc_execmove = %d\n", stat);

}

I am compiling with -lbproc.  It compiles without complaint.  When I run it
and give it a node and a binary to execute it seems to stop at the
bproc_execmove.  In this case the binary is called "hi" and it just prints
"Hello, World!"

$ ./mover 0 ./hi
Number of nodes: 10
Command: ./hi

It doesn't get to the last print statement which tells me
whether bproc_execmove even worked.

If I do the following:

$ ./mover 0 "./hi > out"

I get:

Number of nodes: 10
Command: ./count > out
Status of bproc_execmove = -1

At least it gets to the end, even though bproc_execmove fails.

Any advice would be greatly appreciated.

Thanks,

Dan Smith

---
Daniel C. Smith                  |    Iowa State University
Graduate Assistant               |    Department of Physics and Astronomy
dcs@iastate.edu                  |    Ames, IA 50011