Commit db6b1a16 authored by Richard Zamora's avatar Richard Zamora
Browse files

fixing problem with min

parent bd4b80c0
......@@ -10,6 +10,8 @@
#include <mpix.h>
#endif
#define MIN(a,b) (((a)<(b))?(a):(b))
typedef struct cost cost;
struct cost {
......@@ -86,7 +88,7 @@ int distance_between_ranks ( int src_rank, int dest_rank ) {
for ( d = 0; d < dim; d++ ) {
hops = abs ( dest_coord[d] - src_coord[d] );
if ( hw.isTorus[d] == 1 )
hops = min ( hops, (int)hw.Size[d] - hops );
hops = MIN ( hops, (int)hw.Size[d] - hops );
distance += hops;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment