78void AlephKappaService::
81 debug() <<
"[AlephKappaService] Retrieving world size...";
82 m_world_size = m_world_parallel->commSize();
83 m_world_rank = m_world_parallel->commRank();
85 debug() <<
"[AlephKappaService] I should be an additional site #"
86 << m_world_rank <<
" among " << m_world_size;
88 debug() <<
"[AlephKappaService] Retrieving configuration...";
94 m_world_parallel->broadcast(cfg, 0);
95 for (
Integer rnk = 0, max = cfg.
size(); rnk < max; rnk += 1) {
96 debug() <<
"[AlephKappaService] cfg[" << rnk <<
"]=" << cfg[rnk];
99 debug() <<
"[AlephKappaService] factory";
100 m_factory =
new AlephFactory(m_application, m_world_parallel->traceMng());
101 debug() <<
"[AlephKappaService] kernel";
105 m_underlying_solver = cfg.
at(0),
106 m_solver_size = cfg.
at(1),
107 m_reorder = (cfg.
at(2) == 1) ?
true :
false);
113 TypesSolver::DIAGONAL,
125 "SolveErrorAlephMatrix.dbg",
134 TypesSolver::SymHybGSJ_smoother,
135 TypesSolver::ParallelRugeStuben,
136 TypesSolver::CG_coarse_solver,
146 bool firstVectorCreateForTmp =
true;
152 debug() <<
"[AlephKappaService] listening for a token...";
154 m_world_parallel->broadcast(token.
view(), 0);
156 debug() <<
"[AlephKappaService] found token " << token.
at(0);
159 switch (token.
at(0)) {
163 case (0xd80dee82l): {
164 debug() <<
"[AlephKappaService] AlephKernel::initialize!";
167 m_world_parallel->broadcast(args.
view(), 0);
176 debug() <<
"[AlephKappaService] AlephKernel::createSolverMatrix (new A[" << A_matrix_queue.
size() <<
"])!";
177 firstVectorCreateForTmp =
true;
178 A_matrix_queue.
add(m_kernel->createSolverMatrix());
184 case (0xba9488bel): {
185 debug() <<
"[AlephKappaService] AlephKernel::postSolver!";
187 m_world_parallel->broadcast(real_args.
view(), 0);
188 params->setEpsilon(real_args.
at(0));
189 params->setAlpha(real_args.
at(1));
190 params->setMinRHSNorm(real_args.
at(2));
191 params->setDDMCParameterAmgDiagonalThreshold(real_args.
at(3));
194 m_world_parallel->broadcast(bool_args.
view(), 0);
195 params->setXoUser((
bool)bool_args.
at(0));
196 params->setCheckRealResidue((
bool)bool_args.
at(1));
197 params->setPrintRealResidue((
bool)bool_args.
at(2));
198 params->setDebugInfo((
bool)bool_args.
at(3));
199 params->setConvergenceAnalyse((
bool)bool_args.
at(4));
200 params->setStopErrorStrategy((
bool)bool_args.
at(5));
201 params->setWriteMatrixToFileErrorStrategy((
bool)bool_args.
at(6));
202 params->setDDMCParameterListingOutput((
bool)bool_args.
at(7));
203 params->setPrintCpuTimeResolution((
bool)bool_args.
at(8));
204 params->setKeepSolverStructure((
bool)bool_args.
at(9));
205 params->setSequentialSolver((
bool)bool_args.
at(10));
208 m_world_parallel->broadcast(int_args.
view(), 0);
209 params->setMaxIter(int_args.
at(0));
210 params->setGamma(int_args.
at(1));
211 params->setPrecond((TypesSolver::ePreconditionerMethod)int_args.
at(2));
212 params->setMethod((TypesSolver::eSolverMethod)int_args.
at(3));
213 params->setAmgCoarseningMethod((TypesSolver::eAmgCoarseningMethod)int_args.
at(4));
214 params->setOutputLevel(int_args.
at(5));
215 params->setAmgCycle(int_args.
at(6));
216 params->setAmgSolverIter(int_args.
at(7));
217 params->setAmgSmootherIter(int_args.
at(8));
218 params->setAmgSmootherOption((TypesSolver::eAmgSmootherOption)int_args.
at(9));
219 params->setAmgCoarseningOption((TypesSolver::eAmgCoarseningOption)int_args.
at(10));
220 params->setAmgCoarseSolverOption((TypesSolver::eAmgCoarseSolverOption)int_args.
at(11));
221 params->setCriteriaStop((TypesSolver::eCriteriaStop)int_args.
at(12));
223 m_kernel->postSolver(params, NULL, NULL, NULL);
231 if ((aleph_vector_idx % 2) == 0) {
232 debug() <<
"[AlephKappaService] AlephKernel::createSolverVector (new b[" << b.
size() <<
"])";
233 b.
add(m_kernel->createSolverVector());
236 debug() <<
"[AlephKappaService] AlephKernel::createSolverVector (new x[" << x.
size() <<
"])";
237 x.
add(m_kernel->createSolverVector());
239 aleph_vector_idx += 1;
247 debug() <<
"[AlephKappaService] AlephMatrix::create(void)!";
248 A_matrix_queue.
at(m_kernel->index())->create();
255 case (0x6bdba30al): {
256 if (firstVectorCreateForTmp) {
257 debug() <<
"[AlephKappaService] firstVectorCreateForTmp";
258 firstVectorCreateForTmp =
false;
262 if ((aleph_vector_idx % 2) == 0) {
263 debug() <<
"[AlephKappaService] AlephVector::create (b[" << m_kernel->index() <<
"])";
264 b.
at(m_kernel->index())->create();
267 debug() <<
"[AlephKappaService] AlephVector::create (x[" << m_kernel->index() <<
"])";
268 x.
at(m_kernel->index())->create();
270 aleph_vector_idx += 1;
277 case (0x74f253cal): {
278 debug() <<
"[AlephKappaService] AlephMatrix::assemble! (kernel->index=" << m_kernel->index() <<
")";
280 m_world_parallel->broadcast(setValue_idx.
view(), 0);
282 m_kernel->topology()->create(setValue_idx.
at(0));
283 A_matrix_queue.
at(m_kernel->index())->assemble();
290 case (0xec7a979fl): {
291 if ((aleph_vector_idx % 2) == 0) {
292 debug() <<
"[AlephKappaService] AlephVector::assemble! (b" << m_kernel->index() <<
")";
293 b.
at(m_kernel->index())->assemble();
296 debug() <<
"[AlephKappaService] AlephVector::assemble! (x" << m_kernel->index() <<
")";
297 x.
at(m_kernel->index())->assemble();
299 aleph_vector_idx += 1;
306 case (0xbf8d3adfl): {
307 debug() <<
"[AlephKappaService] AlephKernel::syncSolver";
310 m_world_parallel->broadcast(gid.
view(), 0);
313 Real residual_norm[4];
314 debug() <<
"[AlephKappaService] AlephKernel::syncSolver group id=" << gid.
at(0);
316 m_kernel->syncSolver(gid.
at(0), nb_iteration, &residual_norm[0]);
323 case (0xdfeb699fl): {
324 debug() <<
"[AlephKappaService] AlephKernel::finalize!";
334 debug() <<
"[AlephKappaService] default";