#include "nbc.h" /****************** THIS FILE is automatically generated ********************* * changes will be deleted at the next generation of this file - see nbc_op.c.m4 */ int NBC_Operation(void *buf3, void *buf1, void *buf2, MPI_Op op, MPI_Datatype type, int count) { int i; if(type == MPI_INT) { if(op == MPI_MIN) { for(i=0; i *(((int*)buf2) + i)) *(((int*)buf3) + i) = *(((int*)buf2) + i); else *(((int*)buf3) + i) = *(((int*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((long*)buf2) + i)) *(((long*)buf3) + i) = *(((long*)buf2) + i); else *(((long*)buf3) + i) = *(((long*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((short*)buf2) + i)) *(((short*)buf3) + i) = *(((short*)buf2) + i); else *(((short*)buf3) + i) = *(((short*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((unsigned int*)buf2) + i)) *(((unsigned int*)buf3) + i) = *(((unsigned int*)buf2) + i); else *(((unsigned int*)buf3) + i) = *(((unsigned int*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((unsigned long*)buf2) + i)) *(((unsigned long*)buf3) + i) = *(((unsigned long*)buf2) + i); else *(((unsigned long*)buf3) + i) = *(((unsigned long*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((unsigned short*)buf2) + i)) *(((unsigned short*)buf3) + i) = *(((unsigned short*)buf2) + i); else *(((unsigned short*)buf3) + i) = *(((unsigned short*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((float*)buf2) + i)) *(((float*)buf3) + i) = *(((float*)buf2) + i); else *(((float*)buf3) + i) = *(((float*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((double*)buf2) + i)) *(((double*)buf3) + i) = *(((double*)buf2) + i); else *(((double*)buf3) + i) = *(((double*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; i *(((long double*)buf2) + i)) *(((long double*)buf3) + i) = *(((long double*)buf2) + i); else *(((long double*)buf3) + i) = *(((long double*)buf1) + i); } } else if(op == MPI_MAX) { for(i=0; ival < ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else if(op == MPI_MINLOC) { for(i=0; ival > ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else return NBC_OP_NOT_SUPPORTED; } else if(type == MPI_DOUBLE_INT) { if(op == MPI_MAXLOC) { for(i=0; ival < ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else if(op == MPI_MINLOC) { for(i=0; ival > ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else return NBC_OP_NOT_SUPPORTED; } else if(type == MPI_LONG_INT) { if(op == MPI_MAXLOC) { for(i=0; ival < ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else if(op == MPI_MINLOC) { for(i=0; ival > ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else return NBC_OP_NOT_SUPPORTED; } else if(type == MPI_2INT) { if(op == MPI_MAXLOC) { for(i=0; ival < ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else if(op == MPI_MINLOC) { for(i=0; ival > ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else return NBC_OP_NOT_SUPPORTED; } else if(type == MPI_SHORT_INT) { if(op == MPI_MAXLOC) { for(i=0; ival < ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else if(op == MPI_MINLOC) { for(i=0; ival > ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else return NBC_OP_NOT_SUPPORTED; } else if(type == MPI_LONG_DOUBLE_INT) { if(op == MPI_MAXLOC) { for(i=0; ival < ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else if(op == MPI_MINLOC) { for(i=0; ival > ptr2->val) { ptr3->val = ptr2->val; ptr3->rank = ptr2->rank; } else { ptr3->val = ptr1->val; ptr3->rank = ptr1->rank; } } } else return NBC_OP_NOT_SUPPORTED; } else return NBC_DATATYPE_NOT_SUPPORTED; return NBC_OK; }