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