Parallel Processing: A KISS Approach - University of North Dakota
Parallel Processing: A KISS Approach - University of North Dakota
Parallel Processing: A KISS Approach - University of North Dakota
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
pvm_upkint(&nodeNumber, 1, 1);<br />
pvm_upkint(&dataNumber, 1, 1);<br />
pvm_upkstr(command);<br />
/***********************************************/<br />
/* Unpack the user's data that was sent by the */<br />
/* master. */<br />
/* */<br />
/* The order <strong>of</strong> the data unpacking MUST match */<br />
/* the order that it was packed by the master! */<br />
/* */<br />
/* I would expect the user would want to */<br />
/* modify this code to fit their application. */<br />
/***********************************************/<br />
for (j = 0; j < cellHeight; j++) {<br />
pvm_upkdouble(R[j], cellWidth, 1);<br />
}<br />
/***********************************************/<br />
/* These lines terminate the program if the */<br />
/* passed string "command" contains the text */<br />
/* "stop". This is a required section! */<br />
/* Otherwise, the slave process will never */<br />
/* terminate! */<br />
/***********************************************/<br />
if (!strcmp(command, "stop")) {<br />
pvm_exit();<br />
exit(0);<br />
}<br />
/***********************************************/<br />
/* Call the user's routine to process the data */<br />
/* that was sent by the master. */<br />
/* */<br />
/* I would expect the user would want to */<br />
/* modify this code to fit their application. */<br />
/***********************************************/<br />
PROCESS_R();<br />
/***********************************************/<br />
/* Initiate communication to the master. */<br />
/***********************************************/<br />
pvm_initsend(PvmDataRaw);<br />
/***********************************************/<br />
/* Pack the "bookkeeping" data into the */<br />
/* communication buffer. */<br />
/***********************************************/<br />
pvm_pkint(&tid, 1, 1);<br />
pvm_pkint(&nodeNumber, 1, 1);<br />
pvm_pkint(&dataNumber, 1, 1);<br />
/***********************************************/<br />
/* Pack the processed data into the */<br />
/* communication buffer. */<br />
/* */<br />
/* I would expect the user would want to */<br />
48