📄 hilbert_mpi_ops.c
字号:
#include <hilbert.h>// user-provided functions for performing MPI reductions on // HilbertIndices datatypes. Note that these can actually // be implemented without any knowledge of MPI.void __hilbert_max_op (Hilbert::HilbertIndices *in, Hilbert::HilbertIndices *inout, int *len, void *){ Hilbert::BitVecType a(3*sizeof(double)*sizeof(Hilbert::inttype)), b(3*sizeof(double)*sizeof(Hilbert::inttype)); assert (a.rackCount() == 3); assert (b.rackCount() == 3); for (int i=0; i<*len; i++, in++, inout++) { a = *in; /**/ b = *inout; // if (a < b), then inout already contains max(a,b) if (b < a) *inout = *in; }}void __hilbert_min_op (Hilbert::HilbertIndices *in, Hilbert::HilbertIndices *inout, int *len, void *){ Hilbert::BitVecType a(3*sizeof(double)*sizeof(Hilbert::inttype)), b(3*sizeof(double)*sizeof(Hilbert::inttype)); assert (a.rackCount() == 3); assert (b.rackCount() == 3); for (int i=0; i<*len; i++, in++, inout++) { a = *in; /**/ b = *inout; // if (b < a), then inout already contains min(a,b) if (a < b) *inout = *in; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -