21#include "order/order_internal.h"
45 MALLOC_INTERN(x, size,
char);
67#if defined( PASTIX_WITH_MPI )
105 rhs_comm->
clustnbr = solvmtx->clustnbr;
106 rhs_comm->
clustnum = solvmtx->clustnum;
107 rhs_comm->
comm = solvmtx->solv_comm;
142 for ( c = 0; c < clustnbr; c++ ) {
183 const spmatrix_t *spm = pastix_data->
csc;
184 const pastix_bcsc_t *bcsc = pastix_data->
bcsc;
197 igpe = ( dof > 0 ) ? igp * dof : dofs[ ig ] - basespm;
198 cblknum = col2cblk[ igpe ];
199 if ( cblknum >= 0 ) {
200 cblk = solvmatr->
cblktab + cblknum;
239 const spmatrix_t *spm = pastix_data->
csc;
251 ile = ( dof > 0 ) ? il * dof : dofs[ ig ] - basespm;
286 const spmatrix_t *spm = pastix_data->
csc;
305 for ( kgpe = 0; kgpe < spm->gNexp; kgpe += dof, kgp ++ ) {
306 if ( col2cblk[ kgpe ] >= 0 ) {
307 Ploc2Pglob[ klp ] = kgp;
311 assert( klp == bcsc_n );
348 for ( c = 0; c < clustnbr; c++ ) {
350 if ( c == clustnum ) {
351 MPI_Bcast( &(data_comm->
nsends), 2, PASTIX_MPI_INT, c, rhs_comm->
comm );
355 MPI_Bcast( &(data_comm->
nrecvs), 2, PASTIX_MPI_INT, c, rhs_comm->
comm );
360 assert( idx_cnt <= val_cnt );
361 if ( idx_cnt == 0 ) {
362 assert( val_cnt == 0 );
365 if ( max_idx < idx_cnt ) {
368 if ( max_val < val_cnt ) {
373 assert( max_idx <= max_val );
415 const spmatrix_t *spm = pastix_data->
csc;
424 bvec_handle_comm_init( pastix_data, Pb );
431 for ( il = 0, ile = 0; ile < m; ile += dofi, il++ ) {
432 ig = loc2glob[ il ] - baseval_spm;
433 ilpe = bvec_glob2Ploc( pastix_data, ig );
434 dofi = ( dof > 0 ) ? dof : dofs[ ig+1 ] - dofs[ ig ];
477 for ( c = 0; c < clustnbr; c++ ) {
479 if ( c == clustnum ) {
486 if ( max_idx < idx_cnt ) {
489 if ( max_val < val_cnt ) {
494 assert( max_idx <= max_val );
531 for ( c = 0; c < clustnbr; c ++ ) {
535 if ( c == clustnum ) {
602 MPI_Status statuses[(clustnbr-1)*2];
603 MPI_Request requests[(clustnbr-1)*2];
608 bvec_switch_amount_dst( Pb->
rhs_comm );
613 bvec_compute_amount_dst( pastix_data, m, nrhs, Pb );
618 c_send = (clustnum+1) % clustnbr;
619 c_recv = (clustnum-1+clustnbr) % clustnbr;
620 for ( k = 0; k < clustnbr-1; k++ ) {
621 data_send = data_comm + c_send;
622 data_recv = data_comm + c_recv;
623 sends = &( data_send->
nsends );
624 recvs = &( data_recv->
nrecvs );
625 if ( c_send == clustnum ) {
629 MPI_Irecv( recvs, 2, PASTIX_MPI_INT, c_recv, PastixTagAmount,
630 rhs_comm->
comm, &requests[counter_req++] );
632 MPI_Isend( sends, 2, PASTIX_MPI_INT, c_send, PastixTagAmount,
633 rhs_comm->
comm, &requests[counter_req++] );
635 c_send = (c_send+1) % clustnbr;
636 c_recv = (c_recv-1+clustnbr) % clustnbr;
639 MPI_Waitall( counter_req, requests, statuses );
641 bvec_compute_max( rhs_comm );
BEGIN_C_DECLS typedef int pastix_int_t
pastix_int_t * send_idxbuf
bvec_data_amount_t nrecvs
bvec_data_amount_t nsends
pastix_coeftype_t flttype
bvec_proc_comm_t data_comm[1]
void bvec_free(void *x)
Free a vector.
struct bvec_proc_comm_s bvec_proc_comm_t
Informations of the data exchanged with other processes.
void * bvec_malloc(size_t size)
Allocate a vector.
struct bvec_handle_comm_s bvec_handle_comm_t
Structure to manage communications with distributed rhs.
Information about the amount of data exchanged to permute the pivots.
Structure to manage communications with distributed rhs.
Informations of the data exchanged with other processes.
enum pastix_dir_e pastix_dir_t
Direction.
pastix_int_t * Ploc2Pglob
pastix_order_t * ordemesh
bvec_handle_comm_t * rhs_comm
pastix_coeftype_t flttype
Main PaStiX data structure.
Main PaStiX RHS structure.
SolverCblk *restrict cblktab
Solver column block structure.
Solver column block structure.