#include "mpiserialdc.hh" namespace RVL { void MPISerialDC::eval(FunctionObject & f, std::vector &x) { try { if (rk==0) { // to eval, must extract DC data members - these will // be type-checked against this DC in many cases. std::vector myx(x.size()); MPISerialDC const * testdc; for (size_t i=0;i(x[i]))) { RVLException e; e<<"Error: MPISerialDC::eval(FO)\n"; e<<"component "< not MPISerialDC\n"; throw e; } myx[i]=testdc->mydc; } mydc->eval(f,myx); } } catch (RVLException & e) { e<<"\ncalled from MPISerialDC::eval(for), for = "< & x) const { try { MPISynchRoot & s = dynamic_cast(f); // initialize internal data of FOR on all processes s.set(); if (rk==0) { // to eval, must extract DC data members - these will // be type-checked against this DC in many cases. std::vector myx(x.size()); MPISerialDC const * testdc; for (size_t i=0;i(x[i]))) { RVLException e; e<<"Error: MPISerialDC::eval(FOR)\n"; e<<"component "< not MPISerialDC\n"; throw e; } myx[i]=testdc->mydc; } // evaluate FOR mydc->eval(f,myx); } // cerr<<"MPISerialDC: call synch on "<write(str); else str<<"(no content)\n"; str<<"************************** end rk = "<(dcf); return this->f.compare(c.f); } catch (bad_cast) { return false; } catch (RVLException & e) { e<<"\ncalled from MPISerialDCF::compare\n"; throw e; } } bool MPISerialDCF::isCompatible(DataContainer const & dc) const { try { MPISerialDC const & c = dynamic_cast(dc); int ires=0; if (rk==0) ires = this->f.isCompatible(*(c.mydc)); #ifdef IWAVE_USE_MPI MPI_Bcast(&ires,1,MPI_INT,0,MPI_COMM_WORLD); #endif if (ires) return true; return false; } catch (bad_cast) { return false; } catch (RVLException & e) { e<<"\ncalled from MPISerialDC::isCompatible\n"; throw e; } } ostream & MPISerialDCF::write(ostream & str) const { str<<"MPISerialDCFactory ******* beg rk = "<