2009-11-20 01:47:49 +00:00
|
|
|
/* -*- C -*-
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
* A program that just spins - provides mechanism for testing user-driven
|
|
|
|
* abnormal program termination
|
|
|
|
*/
|
2010-03-23 21:28:02 +00:00
|
|
|
#include "opal_config.h"
|
2009-11-20 01:47:49 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2010-03-23 21:28:02 +00:00
|
|
|
#include "opal/runtime/opal_progress.h"
|
|
|
|
|
2009-11-20 01:47:49 +00:00
|
|
|
#include "orte/runtime/runtime.h"
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
double pi;
|
|
|
|
|
2009-12-04 04:31:06 +00:00
|
|
|
orte_init(&argc, &argv, ORTE_PROC_NON_MPI);
|
2009-11-20 01:47:49 +00:00
|
|
|
|
|
|
|
i = 0;
|
|
|
|
while (1) {
|
|
|
|
i++;
|
|
|
|
pi = i / 3.14159256;
|
2010-03-23 21:28:02 +00:00
|
|
|
if (i > 100) {
|
|
|
|
/* need to progress so we can
|
|
|
|
* wake up if our daemon goes
|
|
|
|
* away!
|
|
|
|
*/
|
|
|
|
opal_progress();
|
|
|
|
/* reset the counter so we loop */
|
|
|
|
i = 0;
|
|
|
|
}
|
2009-11-20 01:47:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
orte_finalize();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|