PDL-Parallel-MPI

 view release on metacpan or  search on metacpan

MPI.xs  view on Meta::CPAN

		piddle = (pdl *) SvIV(sv);
		PDL_CHKMAGIC(piddle);
		the_data = (double *) piddle->data;
		retval = 
		MPI_Recv(the_data,piddle->nvals, pdl_mpi_typemap(piddle->datatype),
				source,tag,comm,&global_status);
		MPIpm_errhandler("&PDL::Parallel::MPI::receive",retval); 

void
get_status_list()
	PPCODE:
	    /* return the status as a 4 element array:
	     * (count,MPI_SOURCE,MPI_TAG,MPI_ERROR) */
	    XPUSHs(sv_2mortal(newSViv(global_status.count)));
	    XPUSHs(sv_2mortal(newSViv(global_status.MPI_SOURCE)));
	    XPUSHs(sv_2mortal(newSViv(global_status.MPI_TAG)));
	    XPUSHs(sv_2mortal(newSViv(global_status.MPI_ERROR)));

void
xs_broadcast(SV * sv,int root=0, MPI_Comm comm = MPI_COMM_WORLD)
	PREINIT:

MPI.xs  view on Meta::CPAN

	int	source
	int	tag
	MPI_Comm comm
      PREINIT:
        void* buf;
        int ret;
	MPI_Status status;
#ifdef SEND_DEBUG
        int i;
#endif
      PPCODE:
	if (! SvROK(ref)) 
            croak("MPI_Recv: First argument is not a reference!");

	if (SvTYPE(SvRV(ref)) == SVt_PVHV) {
            croak("MPI_Recv: Hashes are not supported yet.");
	} else if (SvTYPE(SvRV(ref)) == SVt_PVAV) {
	    int len;
	    AV *stuff = (AV*) SvRV(ref);
            switch(datatype) {
	      case MPI_STRING:

MPI.xs  view on Meta::CPAN

	SV *	recvref
	int	recvcount
	MPI_Datatype	recvtype
	int	source
	int	recvtag
	MPI_Comm	comm
      PREINIT:
        void* sendbuf, *recvbuf;
        int ret;
	MPI_Status status;
      PPCODE:     
	if (! SvROK(sendref) || ! SvROK(recvref))
            croak("MPI_Sendrecv: First and Fourth arguments must be references!");

	if (SvTYPE(SvRV(sendref)) == SVt_PVAV &&
            SvTYPE(SvRV(recvref)) == SVt_PVAV)
	{
            AV* array = (AV*) SvRV(recvref);
	    int len;
	    recvbuf = malloc(MPIpm_bufsize(recvtype, SvRV(recvref), recvcount));
	    len = MPIpm_packarray(&sendbuf, (AV*)SvRV(sendref), sendtype, sendcount);



( run in 0.544 second using v1.01-cache-2.11-cpan-5511b514fd6 )