2006-07-18 18:42:27 +04:00
|
|
|
/* -*- C -*-
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
* A program that just spins - provides mechanism for testing user-driven
|
|
|
|
* abnormal program termination
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2007-05-29 20:22:50 +04:00
|
|
|
#include <unistd.h>
|
2006-07-18 18:42:27 +04:00
|
|
|
|
2007-01-17 19:15:37 +03:00
|
|
|
#include "orte/util/proc_info.h"
|
2007-05-29 20:22:50 +04:00
|
|
|
#include "orte/runtime/runtime.h"
|
2007-01-17 19:15:37 +03:00
|
|
|
|
2006-07-18 18:42:27 +04:00
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
|
2007-01-17 19:15:37 +03:00
|
|
|
int i, rc;
|
2006-07-18 18:42:27 +04:00
|
|
|
double pi;
|
2007-01-17 19:15:37 +03:00
|
|
|
pid_t pid;
|
|
|
|
|
2007-05-29 20:22:50 +04:00
|
|
|
if (0 > (rc = orte_init(ORTE_NON_INFRASTRUCTURE, ORTE_NON_BARRIER))) {
|
2007-01-17 19:15:37 +03:00
|
|
|
fprintf(stderr, "spin: couldn't init orte - error code %d\n", rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
pid = getpid();
|
2006-07-18 18:42:27 +04:00
|
|
|
|
2007-01-17 19:15:37 +03:00
|
|
|
printf("spin: Name [%lu,%lu,%lu] Pid %ld\n", ORTE_NAME_ARGS(orte_process_info.my_name), (long)pid);
|
|
|
|
|
2006-07-18 18:42:27 +04:00
|
|
|
i = 0;
|
|
|
|
while (1) {
|
|
|
|
i++;
|
|
|
|
pi = i / 3.14159256;
|
|
|
|
if (i > 100) i = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|