1
1

Added initialization and proper increment of the value of num_processors

pointer.  This commit fixes trac:1420.

This commit was SVN r19089.

The following Trac tickets were found above:
  Ticket 1420 --> https://svn.open-mpi.org/trac/ompi/ticket/1420
Этот коммит содержится в:
Terry Dontje 2008-07-30 10:29:05 +00:00
родитель fc7c58ede6
Коммит 0ff11f7523

Просмотреть файл

@ -184,6 +184,9 @@ static int solaris_module_get_processor_info(int *num_processors, int *max_proce
* an inclusive list. e.g. If cpuid_max=31, cpuid would be 0-31 */
cpuid_max = sysconf(_SC_CPUID_MAX);
/* clear out num_processors to make sure we get the correct count */
*num_processors = 0;
/* Because not all CPU ID in cpuid_max are actually valid,
* and CPU ID may also not be contiguous. Therefore we
* need to run through processor_info to ensure the validity.
@ -191,7 +194,7 @@ static int solaris_module_get_processor_info(int *num_processors, int *max_proce
for (currid=0; currid<=cpuid_max; currid++) {
if (0 == processor_info(currid, &pinfo)) {
if (P_ONLINE == pinfo.pi_state || P_NOINTR == pinfo.pi_state) {
*num_processors++;
(*num_processors)++;
*max_processor_id = currid;
}
}