@@ -356,7 +356,7 @@ Cpitrmr2d(uplo, diag, m, n,
356
356
assert ((myprow1 < p1 && mypcol1 < q1 ) || (myprow1 == -1 && mypcol1 == -1 ));
357
357
/* exchange the missing parameters among the processors: shape of grids and
358
358
* location of the processors */
359
- param = (Int * ) mr2d_malloc (3 * (nprocs * 2 + NBPARAM ) * sizeof (Int ));
359
+ param = (Int * ) mr2d_malloc (3 * (( size_t ) nprocs * 2 + NBPARAM ) * sizeof (Int ));
360
360
ra = param + nprocs * 2 + NBPARAM ;
361
361
ca = param + (nprocs * 2 + NBPARAM ) * 2 ;
362
362
for (i = 0 ; i < nprocs * 2 + NBPARAM ; i ++ )
@@ -481,10 +481,10 @@ Cpitrmr2d(uplo, diag, m, n,
481
481
/* allocing room for the tabs, alloc for the worst case,local_n or local_m
482
482
* intervals, in fact the worst case should be less, perhaps half that,I
483
483
* should think of that one day. */
484
- h_inter = (IDESC * ) mr2d_malloc (DIVUP (ma -> n , q0 * ma -> nbcol ) *
485
- ma -> nbcol * sizeof (IDESC ));
486
- v_inter = (IDESC * ) mr2d_malloc (DIVUP (ma -> m , p0 * ma -> nbrow )
487
- * ma -> nbrow * sizeof (IDESC ));
484
+ h_inter = (IDESC * ) mr2d_malloc (( size_t )( DIVUP (ma -> n , q0 * ma -> nbcol ) ) *
485
+ ( size_t )( ma -> nbcol ) * sizeof (IDESC ));
486
+ v_inter = (IDESC * ) mr2d_malloc (( size_t )( DIVUP (ma -> m , p0 * ma -> nbrow ) )
487
+ * ( size_t ) ma -> nbrow * sizeof (IDESC ));
488
488
/* We go for the scanning of indices. For each processor including mypnum,
489
489
* we fill the sendbuff buffer (scanD0(SENDBUFF)) and when it is done send
490
490
* it. Then for each processor, we compute the size of message to be
@@ -589,7 +589,7 @@ init_chenille(Int mypnum, Int nprocs, Int n0, Int *proc0, Int n1, Int *proc1, In
589
589
Int ns , nr , i , tot ;
590
590
Int * sender , * recver , * g0 , * g1 ;
591
591
tot = max (n0 , n1 );
592
- sender = (Int * ) mr2d_malloc ((nprocs + tot ) * sizeof (Int ) * 2 );
592
+ sender = (Int * ) mr2d_malloc ((size_t )( nprocs + tot ) * sizeof (Int ) * 2 );
593
593
recver = sender + tot ;
594
594
* psend = sender ;
595
595
* precv = recver ;
@@ -661,7 +661,7 @@ gridreshape(Int *ctxtp)
661
661
Int i , j ;
662
662
ori = * ctxtp ;
663
663
Cblacs_gridinfo (ori , & nprow , & npcol , & myrow , & mycol );
664
- usermap = mr2d_malloc (sizeof (Int ) * nprow * npcol );
664
+ usermap = mr2d_malloc (sizeof (Int ) * ( size_t ) nprow * ( size_t ) npcol );
665
665
for (i = 0 ; i < nprow ; i ++ )
666
666
for (j = 0 ; j < npcol ; j ++ ) {
667
667
usermap [i + j * nprow ] = Cblacs_pnum (ori , i , j );
0 commit comments