[Mpi-22] Higher-level languages proposal

Jeff Squyres jsquyres at [hidden]
Thu Oct 16 16:45:03 CDT 2008



On Oct 16, 2008, at 5:33 PM, Jeff Squyres wrote:

> main() {
>  MPI_INIT();
>  spawn_threads(8, thread_main, NULL);
>  wait_for_threads();
>  MPI_FINALIZE();
> }
>
> void thread_main(void *arg) {
>  MPI_Comm comm1;
>  MPI_THREAD_REGISTER(MPI_COMM_SELF, my_thread_id, 8, comm1);
>  spawn_threads(8, secondary_thread_main, comm1);
> }
>
> void secondary_thread_main(void *arg) {
>  MPI_Comm comm2, parent = (MPI_Comm) arg;
>  MPI_THREAD_REGISTER(parent, my_thread_id, 8, &comm2);
> }

Never mind -- this was a bad example.  The grouping above is  
guaranteed because of the unique values of the parent communicator.

Hmm.  Something still bugs me about this, but I can't quite put my  
finger on it.  I'll therefore shut up about this specific point until  
I can be clear about it.  :-)


-- 
Jeff Squyres
Cisco Systems




More information about the Mpi-22 mailing list