ejr / matchpres (public) (License: BSD) (since 2018-08-29) (hash sha1)
Ye olde thesis code implementing an auction-based weighted bipartite matching algorithm over MPI.
List of commits:
Subject Hash Author Date (UTC)
Add relative gap termination criteria to parallel matchers. 4df0541dc376888d74a22b5770871cb90c1c2f70 Jason Riedy 2005-04-25 18:44:20
Add Make.inc for home 55087d06413e6a59d1c3b41294126cd56f6d46b7 Jason Riedy 2005-04-25 18:10:22
Add Make.seaborg 66fe7a0f65ad57d1fffeeb8db2e614f38cf6cbc0 Jason Riedy 2005-04-25 18:10:06
Move Make.inc out of the way a6aca26e1d6cfb15faa570d63890a20798df3444 Jason Riedy 2005-04-20 20:23:50
Fix price => scaling transformation 1c223b72d65972e9b381e576b90934c40d555e27 Jason Riedy 2005-04-20 20:22:12
Bugs go poo a136075289af1e672e28187cf41210a5ec27eccc Jason Riedy 2005-04-20 02:22:32
More data: primal, dual, duration 2c59b3bdc4789035f919ce2132f2d20e33884329 Jason Riedy 2005-04-18 18:20:44
Removed mistaken Acopy 8af95560220c3dd532eba9efa95b6993a0bedf97 Jason Riedy 2005-04-18 05:07:13
write new data from matchmtx. 9bbe665ce58799a37beed4e6557f756bdf6e8a48 Jason Riedy 2005-04-18 05:05:14
Dumb bug fix. 0acb519a5298ca2fd3256cc54e7e91a267990022 Jason Riedy 2005-04-13 04:21:01
quit when not square b74d721df984ae9c60d4617921d6dc7813215022 Jason Riedy 2005-04-12 23:36:47
Go back to gcc. 9d50e51da839a9dcf5193030c9fcdd49cdfa9854 Jason Riedy 2005-04-12 23:31:07
undo extra changes 41f6e35374346b3ac19a8342a9c4ff75796ceee5 Jason Riedy 2005-04-12 23:21:08
fix auction_shift for explicit zeros 10be6a173d391689574e9e88774e90dc1c7ac1d9 Jason Riedy 2005-04-12 23:20:38
HAVE_LOGB 38a377840fbffdbcc1f8ebab1f9775502547e4cb Jason Riedy 2005-04-12 23:11:13
add -nofor_main, fix seqauction b24bdf1318ea24afd1b43230b372fcc776fef8f6 Jason Riedy 2005-04-12 23:05:54
Prepare for massive runs. 5f9172fedbc636a986bd57c48cfa20bd1f1c17a7 Jason Riedy 2005-04-12 22:55:06
Update build stuff. 64cf1bc1ea3e70fdf320fe51a95f140f57076d80 Jason Riedy 2005-04-12 22:28:15
Add bigfloat changes 11ccd212bae7140c529c3431262b03d52c8a6309 Jason Riedy 2005-04-12 21:46:27
initial import 2aa81858e4a8c9d6c37158f5f32eccdaa5184643 Jason Riedy 2005-04-12 21:45:12
Commit 4df0541dc376888d74a22b5770871cb90c1c2f70 - Add relative gap termination criteria to parallel matchers.
* auction.c (auction_eval_gap): Returns primal for relgap use.

* auction.h (auction_eval_gap): Fix proto.

* parauction.c, parauction_root.c, parauction_allgather.c,
parauction_allreduce.c: Take relgap params.

* stripe_auction.c (stripe_auction_scaling): Use relative gap termination when set.

* stripe_auction.h (stripe_auction_scaling): Fix proto.

* Makefile (MPIPROGS, mpiall, clean): Give MPI-based programs separate
target. Also pass CPPFLAGS to mpicc.

* Make.ejr-home-gcc: mpich2 package bork everything at home, fixing.

git-archimport-id: ejr@cs.berkeley.edu--superlu/matchpres--base--0--patch-18
Author: Jason Riedy
Author date (UTC): 2005-04-25 18:44
Committer name: Jason Riedy
Committer date (UTC): 2005-04-25 18:44
Parent(s): 55087d06413e6a59d1c3b41294126cd56f6d46b7
Signing key:
Tree: 4d78b1021afbbd5a51cfbf2d1552db49fc640ce5
File Lines added Lines deleted
Make.ejr-home-gcc 3 7
Makefile 21 18
auction.c 4 1
auction.h 3 3
parauction.c 8 2
parauction_allgather.c 8 2
parauction_allreduce.c 8 2
parauction_root.c 8 2
stripe_auction.c 16 11
stripe_auction.h 1 1
File Make.ejr-home-gcc changed (mode: 100644) (index 4cad15c..ccfaf84)
2 2 CC=gcc-4.0 CC=gcc-4.0
3 3 LDLIBS = -lm LDLIBS = -lm
4 4 CFLAGS = -std=gnu9x -g -Wall -Wno-unused CFLAGS = -std=gnu9x -g -Wall -Wno-unused
5 CPPFLAGS=-DHAVE_LOGB -DHAVE_LOG2 -DHAVE_SCALB -DHAVE_CALLGRIND
5 CPPFLAGS=-DHAVE_LOGB -DHAVE_LOG2 -DHAVE_SCALB -DHAVE_CALLGRIND -DHAVE_MPI_ALLOC_MEM
6 6 #CFLAGS = -std=gnu9x -O3 -DNDEBUG -g -Wall -Wno-unused \ #CFLAGS = -std=gnu9x -O3 -DNDEBUG -g -Wall -Wno-unused \
7 7 # -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS # -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS
8 8 # -DHAVE_CALLGRIND -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS # -DHAVE_CALLGRIND -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS
9 F77=g77-4.0
9 10 FFLAGS = -O3 -g -Wall FFLAGS = -O3 -g -Wall
10 11 MPICC = CC=$(CC) mpicc MPICC = CC=$(CC) mpicc
11 12 #MPICC = mpicc.mpich-mpd #MPICC = mpicc.mpich-mpd
 
... ... MPICC = CC=$(CC) mpicc
13 14
14 15 RANLIB = ranlib RANLIB = ranlib
15 16
16 # CC = icc -Qoption,cpp,--extended_float_types
17 # CPPFLAGS = -DNOSTATS -DHAVE_LOGB -DHAVE_SCALB
18 # CFLAGS = -g -O2 -Wall "-DBIGFLOAT_T=_Quad" "-DSMUT_BIGFLOAT_T=_Quad"
19 # CFLAGS_NOOPT = -g -O0 -Wall "-DBIGFLOAT_T=_Quad" "-DSMUT_BIGFLOAT_T=_Quad"
20 # F77 = ifort -nofor_main
21 # FFLAGS = -g -O2
17
22 18
File Makefile changed (mode: 100644) (index 3221e36..f715c36)
... ... PROGS_BASIC = readbin writebin transposebin matchmtx
6 6 PROGS = $(PROGS_BASIC) PROGS = $(PROGS_BASIC)
7 7 # \ # \
8 8 # seqauction parauction parauction_allreduce parauction_allgather parauction_root # seqauction parauction parauction_allreduce parauction_allgather parauction_root
9 MPIPROGS=mpitransposebin mpitransposebin_root \
10 parauction parauction_allreduce parauction_allgather parauction_root
9 11
10 12 .PHONY: all .PHONY: all
11 13 all: $(PROGS) all: $(PROGS)
14 mpiall: $(MPIPROGS)
12 15
13 16 readbin: readbin.o libsmut.a readbin: readbin.o libsmut.a
14 17 writebin: writebin.o libsmut.a writebin: writebin.o libsmut.a
 
... ... cacheblast.o: cacheblast.c
23 26 timer.o: timer.c timer.o: timer.c
24 27 auction.o: auction.c auction.o: auction.c
25 28 stripesmut.o: stripesmut.c stripesmut.h stripesmut.o: stripesmut.c stripesmut.h
26 $(MPICC) $(CFLAGS) -c stripesmut.c
29 $(MPICC) $(CPPFLAGS) $(CFLAGS) -c stripesmut.c
27 30 redist1: redist1.c stripesmut.o libsmut.a redist1: redist1.c stripesmut.o libsmut.a
28 $(MPICC) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
31 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
29 32 redist2: redist2.c stripesmut.o libsmut.a redist2: redist2.c stripesmut.o libsmut.a
30 $(MPICC) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
33 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
31 34 redist3: redist3.c stripesmut.o libsmut.a redist3: redist3.c stripesmut.o libsmut.a
32 $(MPICC) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
35 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
33 36 redist4: redist4.c stripesmut.o libsmut.a redist4: redist4.c stripesmut.o libsmut.a
34 $(MPICC) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
37 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
35 38 colcomp: colcomp.c stripesmut.o libsmut.a colcomp: colcomp.c stripesmut.o libsmut.a
36 $(MPICC) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
39 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
37 40 mpitransposebin: mpitransposebin.c stripesmut.o libsmut.a mpitransposebin: mpitransposebin.c stripesmut.o libsmut.a
38 $(MPICC) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
41 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
39 42 mpitransposebin_root: mpitransposebin_root.c stripesmut.o libsmut.a mpitransposebin_root: mpitransposebin_root.c stripesmut.o libsmut.a
40 $(MPICC) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
43 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $< stripesmut.o libsmut.a $(LDLIBS)
41 44
42 45 dlamch.o: mc64/dlamch.c dlamch.o: mc64/dlamch.c
43 46 $(CC) -I. -Imc64/ -c -o $@ $< $(CC) -I. -Imc64/ -c -o $@ $<
 
... ... matchmtx: matchmtx.o auction.o libsmut.a
59 62 $(CC) $(FFLAGS) -o $@ $^ $(LDLIBS) $(CC) $(FFLAGS) -o $@ $^ $(LDLIBS)
60 63
61 64 stripe_auction.o: stripe_auction.c stripe_auction.h auction.h smut.h stripe_auction.o: stripe_auction.c stripe_auction.h auction.h smut.h
62 $(MPICC) $(CFLAGS) -c -o $@ $<
65 $(MPICC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
63 66 parauction.o: parauction.c auction.h smut.h parauction.o: parauction.c auction.h smut.h
64 $(MPICC) $(CFLAGS) -c -o $@ $<
67 $(MPICC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
65 68 parauction: parauction.o stripe_auction.o stripesmut.o auction.o libsmut.a parauction: parauction.o stripe_auction.o stripesmut.o auction.o libsmut.a
66 $(MPICC) $(CFLAGS) -o $@ $^ $(LDLIBS)
69 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDLIBS)
67 70
68 71 parauction_allreduce.o: parauction_allreduce.c auction.h smut.h parauction_allreduce.o: parauction_allreduce.c auction.h smut.h
69 $(MPICC) $(CFLAGS) -c -o $@ $<
72 $(MPICC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
70 73 parauction_allreduce: parauction_allreduce.o stripe_auction.o stripesmut.o auction.o libsmut.a parauction_allreduce: parauction_allreduce.o stripe_auction.o stripesmut.o auction.o libsmut.a
71 $(MPICC) $(CFLAGS) -o $@ $^ $(LDLIBS)
74 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDLIBS)
72 75
73 76 parauction_allgather.o: parauction_allgather.c auction.h smut.h parauction_allgather.o: parauction_allgather.c auction.h smut.h
74 $(MPICC) $(CFLAGS) -c -o $@ $<
77 $(MPICC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
75 78 parauction_allgather: parauction_allgather.o stripe_auction.o stripesmut.o auction.o libsmut.a parauction_allgather: parauction_allgather.o stripe_auction.o stripesmut.o auction.o libsmut.a
76 $(MPICC) $(CFLAGS) -o $@ $^ $(LDLIBS)
79 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDLIBS)
77 80
78 81 parauction_root.o: parauction_root.c auction.h smut.h parauction_root.o: parauction_root.c auction.h smut.h
79 $(MPICC) $(CFLAGS) -c -o $@ $<
82 $(MPICC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
80 83 parauction_root: parauction_root.o stripe_auction.o stripesmut.o auction.o libsmut.a parauction_root: parauction_root.o stripe_auction.o stripesmut.o auction.o libsmut.a
81 $(MPICC) $(CFLAGS) -o $@ $^ $(LDLIBS)
84 $(MPICC) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDLIBS)
82 85
83 86
84 87
85 88 .PHONY: clean .PHONY: clean
86 89 clean: clean:
87 rm -f $(PROGS) *.o libmc64.a libsmut.a
90 rm -f $(PROGS) $(MPIPROGS) *.o libmc64.a libsmut.a
88 91
File auction.c changed (mode: 100644) (index e60143f..3c5fff8)
... ... auction_eval_primal_dual (const struct spcsr_t A, const double *b_in,
292 292 *dual_out = dual; *dual_out = dual;
293 293 } }
294 294
295 void
295 double
296 296 auction_eval_gap (const struct spcsr_t A, const double *b_in, auction_eval_gap (const struct spcsr_t A, const double *b_in,
297 297 const int *match_in, const double *price_in, const int *match_in, const double *price_in,
298 298 double *gap_out) double *gap_out)
 
... ... auction_eval_gap (const struct spcsr_t A, const double *b_in,
305 305 const int * restrict match = match_in; const int * restrict match = match_in;
306 306
307 307 double gap = 0.0; double gap = 0.0;
308 double primal = 0.0;
308 309
309 310 int i; int i;
310 311
 
... ... auction_eval_gap (const struct spcsr_t A, const double *b_in,
330 331 } }
331 332 if (match_p < HUGE_VAL) if (match_p < HUGE_VAL)
332 333 gap += (match_p + profit) - match_e; gap += (match_p + profit) - match_e;
334 if (!isinf(match_e)) primal += fabs(match_e);
333 335 } }
334 336
335 337 *gap_out = gap; *gap_out = gap;
338 return primal;
336 339 } }
337 340
338 341 #if 1 #if 1
File auction.h changed (mode: 100644) (index 9cb7e52..a574b36)
... ... int auction_greedy_gather0_cl (const struct spcsr_t A,
84 84 double * bmn, double * bmx, double * bmn, double * bmx,
85 85 double * gap, double * gap,
86 86 double * pmax); double * pmax);
87 void auction_eval_gap (const struct spcsr_t A, const double *b_in,
88 const int *match_in, const double *price_in,
89 double *gap_out);
87 double auction_eval_gap (const struct spcsr_t A, const double *b_in,
88 const int *match_in, const double *price_in,
89 double *gap_out);
90 90
91 91 #if !defined(AUCTION_INTERNAL) #if !defined(AUCTION_INTERNAL)
92 92 #if !defined(NOSTATS) #if !defined(NOSTATS)
File parauction.c changed (mode: 100644) (index e119f57..8f93435)
... ... main (int argc, char **argv)
515 515 int err; int err;
516 516
517 517 double mu_min; double mu_min;
518 int relgap = 0;
518 519
519 520 struct spcsr_t A, Acopy; struct spcsr_t A, Acopy;
520 521 struct gcsr_t gA; struct gcsr_t gA;
 
... ... main (int argc, char **argv)
644 645 } }
645 646 } }
646 647
647 mu_min = 1.0;
648 mu_min = 1.0 / A.nr;
649 if (argc > 2)
650 mu_min = strtod(argv[2], NULL);
651 if (argc > 3)
652 relgap = 1;
648 653
649 654 lmatch = malloc (lnc * sizeof (int)); lmatch = malloc (lnc * sizeof (int));
650 655 lprice = malloc (lnc * sizeof (double)); lprice = malloc (lnc * sizeof (double));
 
... ... main (int argc, char **argv)
656 661 errflg = stripe_auction_simple (&gA, lexpint, lmatch, lprice, mu_min, errflg = stripe_auction_simple (&gA, lexpint, lmatch, lprice, mu_min,
657 662 &comm_state, MPI_COMM_WORLD); &comm_state, MPI_COMM_WORLD);
658 663 #else #else
659 errflg = stripe_auction_scaling (&gA, lexpint, lmatch, lprice, mu_min,
664 errflg = stripe_auction_scaling (&gA, lexpint, lmatch, lprice,
665 mu_min, relgap,
660 666 &comm_state, MPI_COMM_WORLD); &comm_state, MPI_COMM_WORLD);
661 667 #endif #endif
662 668 stop_timer(&timer); stop_timer(&timer);
File parauction_allgather.c changed (mode: 100644) (index 63b3b95..b555c01)
... ... main (int argc, char **argv)
501 501 int err; int err;
502 502
503 503 double mu_min; double mu_min;
504 int relgap = 0;
504 505
505 506 struct spcsr_t A, Acopy; struct spcsr_t A, Acopy;
506 507 struct gcsr_t gA; struct gcsr_t gA;
 
... ... main (int argc, char **argv)
630 631 } }
631 632 } }
632 633
633 mu_min = 1.0;
634 mu_min = 1.0 / A.nr;
635 if (argc > 2)
636 mu_min = strtod(argv[2], NULL);
637 if (argc > 3)
638 relgap = 1;
634 639
635 640 lmatch = malloc (lnc * sizeof (int)); lmatch = malloc (lnc * sizeof (int));
636 641 lprice = malloc (lnc * sizeof (double)); lprice = malloc (lnc * sizeof (double));
 
... ... main (int argc, char **argv)
642 647 errflg = stripe_auction_simple (&gA, lexpint, lmatch, lprice, mu_min, errflg = stripe_auction_simple (&gA, lexpint, lmatch, lprice, mu_min,
643 648 &comm_state, MPI_COMM_WORLD); &comm_state, MPI_COMM_WORLD);
644 649 #else #else
645 errflg = stripe_auction_scaling (&gA, lexpint, lmatch, lprice, mu_min,
650 errflg = stripe_auction_scaling (&gA, lexpint, lmatch, lprice,
651 mu_min, relgap,
646 652 &comm_state, MPI_COMM_WORLD); &comm_state, MPI_COMM_WORLD);
647 653 #endif #endif
648 654 stop_timer(&timer); stop_timer(&timer);
File parauction_allreduce.c changed (mode: 100644) (index d83e201..af8f84d)
... ... main (int argc, char **argv)
320 320 int err; int err;
321 321
322 322 double mu_min; double mu_min;
323 int relgap = 0;
323 324
324 325 struct spcsr_t A, Acopy; struct spcsr_t A, Acopy;
325 326 struct gcsr_t gA; struct gcsr_t gA;
 
... ... main (int argc, char **argv)
449 450 } }
450 451 } }
451 452
452 mu_min = 1.0;
453 mu_min = 1.0 / A.nr;
454 if (argc > 2)
455 mu_min = strtod(argv[2], NULL);
456 if (argc > 3)
457 relgap = 1;
453 458
454 459 lmatch = malloc (lnc * sizeof (int)); lmatch = malloc (lnc * sizeof (int));
455 460 lprice = malloc (lnc * sizeof (double)); lprice = malloc (lnc * sizeof (double));
 
... ... main (int argc, char **argv)
461 466 errflg = stripe_auction_simple (&gA, lexpint, lmatch, lprice, mu_min, errflg = stripe_auction_simple (&gA, lexpint, lmatch, lprice, mu_min,
462 467 &comm_state, MPI_COMM_WORLD); &comm_state, MPI_COMM_WORLD);
463 468 #else #else
464 errflg = stripe_auction_scaling (&gA, lexpint, lmatch, lprice, mu_min,
469 errflg = stripe_auction_scaling (&gA, lexpint, lmatch, lprice,
470 mu_min, relgap,
465 471 &comm_state, MPI_COMM_WORLD); &comm_state, MPI_COMM_WORLD);
466 472 #endif #endif
467 473 stop_timer(&timer); stop_timer(&timer);
File parauction_root.c changed (mode: 100644) (index 751c2b5..0fcea0b)
... ... main (int argc, char **argv)
502 502 int err; int err;
503 503
504 504 double mu_min; double mu_min;
505 int relgap = 0;
505 506
506 507 struct spcsr_t A, Acopy; struct spcsr_t A, Acopy;
507 508 struct gcsr_t gA, gAroot; struct gcsr_t gA, gAroot;
 
... ... main (int argc, char **argv)
635 636 } }
636 637 } }
637 638
638 mu_min = 1.0;
639 mu_min = 1.0 / A.nr;
640 if (argc > 2)
641 mu_min = strtod(argv[2], NULL);
642 if (argc > 3)
643 relgap = 1;
639 644
640 645 if (am_root) { if (am_root) {
641 646 price = malloc (gA.nc * sizeof(double)); price = malloc (gA.nc * sizeof(double));
 
... ... main (int argc, char **argv)
666 671 expint, rcounts, rdisps, MPI_DOUBLE, expint, rcounts, rdisps, MPI_DOUBLE,
667 672 0, comm); 0, comm);
668 673
669 errflg = auction_scaling (gAroot.local, expint, match, price, mu_min);
674 errflg = auction_scaling (gAroot.local, expint, match, price,
675 mu_min, relgap);
670 676 /* Don't scatter results, freebie */ /* Don't scatter results, freebie */
671 677 stop_timer(&timer); stop_timer(&timer);
672 678
File stripe_auction.c changed (mode: 100644) (index d5c7bb4..5ac297a)
... ... stripe_auction_simple (const struct gcsr_t *gA, const double *lb,
296 296 int int
297 297 stripe_auction_scaling (const struct gcsr_t *gA, const double *lb_in, stripe_auction_scaling (const struct gcsr_t *gA, const double *lb_in,
298 298 int *lmatch_in, double *lprice_in, int *lmatch_in, double *lprice_in,
299 const double mu_final,
299 const double mu_final, const int relgap,
300 300 struct comm_state_t *comm_state, struct comm_state_t *comm_state,
301 301 MPI_Comm comm) MPI_Comm comm)
302 302 { {
 
... ... stripe_auction_scaling (const struct gcsr_t *gA, const double *lb_in,
483 483
484 484 { {
485 485 int j; int j;
486 double pg[2] = {0.0, 0.0};
487 double all_pg[2] = {0.0, 0.0};
486 488
487 489 pmax = -HUGE_VAL; pmax = -HUGE_VAL;
488 gap = 0.0;
489 auction_eval_gap (local, lb, lmatch, lprice, &gap);
490 pg[0] = auction_eval_gap (local, lb, lmatch, lprice, &pg[1]);
490 491 /*fprintf (stderr, "%d: pass: %d gap: %g mu: %g\n", rank, pass, gap, mu);*/ /*fprintf (stderr, "%d: pass: %d gap: %g mu: %g\n", rank, pass, gap, mu);*/
491 MPI_Allreduce (&gap, &tmp, 1, MPI_DOUBLE, MPI_SUM, comm);
492 gap = tmp;
492 MPI_Allreduce (pg, all_pg, 2, MPI_DOUBLE, MPI_SUM, comm);
493 gap = pg[1];
494 if (!relgap) {
495 #if 1
496 if (gap < gnc * mu_final) break; /* before clearing match */
497 #else
498 if (gap < mu_final) break; /* before clearing match */
499 #endif
500 }
501 else {
502 if (pg[1] / pg[0] < mu_final) break;
503 }
493 504 new_mu = theta * (gap) / gnc; new_mu = theta * (gap) / gnc;
494 505 if (new_mu < 8.0*mu_final) new_mu = mu_final; if (new_mu < 8.0*mu_final) new_mu = mu_final;
495 506 if (new_mu > theta * mu) new_mu = theta * mu; if (new_mu > theta * mu) new_mu = theta * mu;
496 507
497 508 /*fprintf (stderr, "%d: pass: %d gap: %g mu: %g\n", rank, pass, gap, mu);*/ /*fprintf (stderr, "%d: pass: %d gap: %g mu: %g\n", rank, pass, gap, mu);*/
498 509
499 #if 1
500 if (gap < gnc * mu_final) break; /* before clearing match */
501 #else
502 if (gap < mu_final) break; /* before clearing match */
503 #endif
504
505 510 for (j = 0; j < lnc; ++j) { for (j = 0; j < lnc; ++j) {
506 511 const int i = lmatch[j]; const int i = lmatch[j];
507 512 const double p = lprice[j]; const double p = lprice[j];
File stripe_auction.h changed (mode: 100644) (index be339a0..f709206)
... ... int stripe_auction_simple (const struct gcsr_t *gA, const double *lb,
21 21
22 22 int stripe_auction_scaling (const struct gcsr_t *gA, const double *lb_in, int stripe_auction_scaling (const struct gcsr_t *gA, const double *lb_in,
23 23 int *lmatch_in, double *lprice_in, int *lmatch_in, double *lprice_in,
24 const double mu_final,
24 const double mu_final, const int relgap,
25 25 struct comm_state_t *comm_state, struct comm_state_t *comm_state,
26 26 MPI_Comm comm); MPI_Comm comm);
27 27
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/ejr/matchpres

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/ejr/matchpres

Clone this repository using git:
git clone git://git.rocketgit.com/user/ejr/matchpres

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main