a question about MPI

i have a 3 nodes (each nodes with 32 processors) machine.
but why if i run the following:


/* Starts MPI processes … /
MPI_Init(&argc,&argv); /
starts MPI /
MPI_Comm_rank(MPI_COMM_WORLD, &myid); /
get current process id /
MPI_Comm_size(MPI_COMM_WORLD, &p); /
get number of processes */


p value is always 1?
how to access all 32 processes?
thanks.

问个问题先…
你怎么跑的这个程序呀…

sorry. i am very new to this field. i just downloaded a piece of source
code. and upload to that supercomputer and mpcc my file.
it could pass debug.
i suppose “p” value in that program equals to the number of the processes,
what 's wrong with me? i might have some very silly problem. please let me
know.

got it all. not bother to reply.

forgot to assign node number in queue script or command line ba
hoho

Is it possible to detect how much a node is available?
suppose I have to use 10 nodes to do computation, and at
the same time someone else may submit a job to some of the
processors, and I want to send the computations in my program
that cannot be parallelized to a processors that has more
space. For instance I want to have a prog like this:
call mpi_init

mpi_scatter

mpi_gather
if this processor is fully available
do …
end if
mpi_finalize

Sure, use “uptime” command in UNIX. It shows the system load (actually
it is avg length of job queue.)
If you’re running on Linux, check the file /proc/loadavg

That I know. I meant during the running, in the program unit.

very interesting question. you basically want the slave node doesn’t do its
job after the master node has assigning them one.
alternatively, you may want the slave node to check it’s load average, respond
to the master node, and let the master decide if to allocate some job to that
node.
you may want to let the master node sort the load average. because you may
have to compete with other programs on all the nodes.
i don’t know if it’s implementable. if you did that, it would be good to
know.