@@ -359,7 +359,7 @@ Cpctrmr2d(uplo, diag, m, n,
359359 assert ((myprow1 < p1 && mypcol1 < q1 ) || (myprow1 == -1 && mypcol1 == -1 ));
360360 /* exchange the missing parameters among the processors: shape of grids and
361361 * 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 ));
363363 ra = param + nprocs * 2 + NBPARAM ;
364364 ca = param + (nprocs * 2 + NBPARAM ) * 2 ;
365365 for (i = 0 ; i < nprocs * 2 + NBPARAM ; i ++ )
@@ -484,10 +484,10 @@ Cpctrmr2d(uplo, diag, m, n,
484484 /* allocing room for the tabs, alloc for the worst case,local_n or local_m
485485 * intervals, in fact the worst case should be less, perhaps half that,I
486486 * 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 ));
491491 /* We go for the scanning of indices. For each processor including mypnum,
492492 * we fill the sendbuff buffer (scanD0(SENDBUFF)) and when it is done send
493493 * 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
592592 Int ns , nr , i , tot ;
593593 Int * sender , * recver , * g0 , * g1 ;
594594 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 );
596596 recver = sender + tot ;
597597 * psend = sender ;
598598 * precv = recver ;
@@ -664,7 +664,7 @@ gridreshape(Int *ctxtp)
664664 Int i , j ;
665665 ori = * ctxtp ;
666666 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 );
668668 for (i = 0 ; i < nprow ; i ++ )
669669 for (j = 0 ; j < npcol ; j ++ ) {
670670 usermap [i + j * nprow ] = Cblacs_pnum (ori , i , j );
0 commit comments