- int num_core = NUM_CORE;
-
- MPI_User_function *uop;
-#ifndef MPICH2
- struct MPIR_OP *op_ptr = MPIR_ToPointer(op);
- uop = (MPI_User_function *) op_ptr->op;
-#else
- uop = MPIR_Op_table[op % 16 - 1];
-#endif
-
- MPI_Comm_size(comm, &comm_size);
- MPI_Comm_rank(comm, &rank);
+ if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
+ smpi_comm_init_smp(comm);
+ }
+ int num_core=1;
+ if (smpi_comm_is_uniform(comm)){
+ num_core = smpi_comm_size(smpi_comm_get_intra_comm(comm));
+ }
+
+ comm_size = smpi_comm_size(comm);
+ rank = smpi_comm_rank(comm);