/* From: "A SURVEY OF COMPUTATIONAL PHYSICS" by RH Landau, MJ Paez, and CC BORDEIANU Copyright Princeton University Press, Princeton, 2007. Electronic Materials copyright: R Landau, Oregon State Univ, 2007; MJ Paez, Univ Antioquia, 2007; and CC BORDEIANU, Univ Bucharest, 2007. Support by National Science Foundation */ /* master program for bifurcation diagram of logistic map*/ #include #include #define min 1 /* minimum for m */ #define max 4 /* maximum for m */ #define step 0.1 /* m range for slave */ #define nstep 100.0 /* number of steps for slave */ #define skip 200 /* # results to skip */ #define count 300 /* # results to save */ main() { struct pvmhostinfo *hostp; int bufid, check, dum, i, nhost, narch, ptid, stid; char name[64]; double buf[5], m; ptid = pvm_mytid(); /* get PVM ID number */ pvm_config( &nhost, &narch, &hostp ); /* configure virtual machine */ gethostname(name, 64); printf("The master process runs on %s \n", name); printf("I found the following hosts in your virtual machine\n"); for (i = 0; i < nhost; i++) { printf("\t%s\n", hostp[i].hi_name); } printf("\nStarting slaves\n"); for (i=0; i