#include #include #include #include #define MAXLOOP 80000 #define OUR_TAG 238 #define VLEN 8 extern char *strdup(__const char *__s); static char *argv0; static void sender(int dest, int n) { int i, vector[VLEN]; if(pvm_initsend(PvmDataDefault) < 0) { (void)pvm_perror("pvm_initsend()"); return; } i = pvm_newcontext(); (void)pvm_pkint(&i, 1, 1); if(pvm_send(dest, OUR_TAG) != 0) { (void)pvm_perror("pvm_send()"); return; } if(pvm_setcontext(i) < 0) { (void)pvm_perror("pvm_setcontext()"); return; } for(i=1 ; i 0 ? atoi(*argv++) : MAXLOOP); sender(newtid, i); break; } default : /* I am the receiver */ receiver(); break; } (void)pvm_exit(); return(0); }