On 27 July 2015 at 11:22, Gilles Gouaillardet <gil...@rist.or.jp> wrote:
> Lisandro,
>
> i fixed it on master at
> https://github.com/open-mpi/ompi/commit/318a1a40a4ab345f417b8932326d4dd2e68d82bc
>
> could you git it a try ?
>

Sorry for the delay. I transplanted the diff to the 1.8.7 sources. All
warnings were silenced. Thanks! As I understand a 1.8.8 tarball is
going to be released, It would be nice to add this fix to it. I'm
attaching a patch from 1.8.7, it is basically your commit diff
ignoring white-space changes and reverting
mca_coll_base_module_2_1_0_t  -> mca_coll_base_module_2_0_0_t.


-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459
diff -b -up ./ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c.orig 
./ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c
--- ./ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c.orig     
2015-05-23 22:33:23.000000000 +0300
+++ ./ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c  2015-08-06 
10:41:03.310523113 +0300
@@ -7,6 +7,8 @@
  * Copyright (c) 2012      Sandia National Laboratories. All rights reserved.
  * Copyright (c) 2013      Los Alamos National Security, LLC. All rights
  *                         reserved.
+ * Copyright (c) 2014-2015 Research Organization for Information Science
+ *                         and Technology (RIST). All rights reserved.
  *
  * Author(s): Torsten Hoefler <h...@cs.indiana.edu>
  *
@@ -50,7 +52,7 @@ int ompi_coll_libnbc_ireduce_scatter_blo
   if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", 
res); return res; }
   res = MPI_Comm_size(comm, &p);
   if (MPI_SUCCESS != res || 0 == p) { printf("MPI Error in MPI_Comm_size() 
(%i:%i)\n", res, p); return (MPI_SUCCESS == res) ? MPI_ERR_SIZE : res; }
-  MPI_Type_extent(datatype, &ext);
+  res = MPI_Type_extent(datatype, &ext);
   if (MPI_SUCCESS != res || 0 == ext) { printf("MPI Error in MPI_Type_extent() 
(%i:%i)\n", res, (int)ext); return (MPI_SUCCESS == res) ? MPI_ERR_SIZE : res; }
   
   schedule = (NBC_Schedule*)malloc(sizeof(NBC_Schedule));
@@ -59,11 +61,11 @@ int ompi_coll_libnbc_ireduce_scatter_blo
   res = NBC_Sched_create(schedule);
   if(res != NBC_OK) { printf("Error in NBC_Sched_create (%i)\n", res); return 
res; }
 
-  maxr = (int)ceil((log(p)/LOG2));
+  maxr = (int)ceil((log((double)p)/LOG2));
 
-  count = 0;
-  for(r=0;r<p;r++) count += recvcount;
+  count = p * recvcount;
   
+  if (0 < count) {
   handle->tmpbuf = malloc(ext*count*2);
   if(handle->tmpbuf == NULL) { printf("Error in malloc()\n"); return NBC_OOR; }
 
@@ -136,6 +138,7 @@ int ompi_coll_libnbc_ireduce_scatter_blo
     res = NBC_Sched_copy(redbuf-(unsigned long)handle->tmpbuf, true, 
recvcount, datatype, recvbuf, false, recvcount, datatype, schedule);
     if (NBC_OK != res) { free(handle->tmpbuf); printf("Error in 
NBC_Sched_copy() (%i)\n", res); return res; }
   }
+  }
 
   /*NBC_PRINT_SCHED(*schedule);*/
   
@@ -166,7 +169,7 @@ int ompi_coll_libnbc_ireduce_scatter_blo
   if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", 
res); return res; }
   res = MPI_Comm_remote_size(comm, &rsize);
   if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_remote_size() 
(%i)\n", res); return res; }
-  MPI_Type_extent(dtype, &ext);
+  res = MPI_Type_extent(dtype, &ext);
   if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Type_extent() (%i)\n", 
res); return res; }
 
   schedule = (NBC_Schedule*)malloc(sizeof(NBC_Schedule));

Reply via email to