41977fcc95
Cleanup ALL instances of output involving the printing of orte_process_name_t structures using the ORTE_NAME_ARGS macro so that the number of fields and type of data match. Replace those values with a new macro/function pair ORTE_NAME_PRINT that outputs a string (using the new thread safe data capability) so that any future changes to the printing of those structures can be accomplished with a change to a single point. Note that I could not possibly find outputs that directly print the orte_process_name_t fields, but only dealt with those that used ORTE_NAME_ARGS. Hence, you may still have a few outputs that bark during compilation. Also, I could only verify those that fall within environments I can compile on, so other environments may yield some minor warnings. This commit was SVN r15517.
47 строки
1.0 KiB
C
47 строки
1.0 KiB
C
/* -*- C -*-
|
|
*
|
|
* $HEADER$
|
|
*
|
|
* A program that just spins, with vpid 3 aborting - provides mechanism for testing
|
|
* abnormal program termination
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
#include "orte/runtime/runtime.h"
|
|
#include "orte/util/proc_info.h"
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
|
|
int i, rc;
|
|
double pi;
|
|
pid_t pid;
|
|
char hostname[500];
|
|
|
|
if (0 > (rc = orte_init(ORTE_NON_INFRASTRUCTURE, ORTE_USE_BARRIER))) {
|
|
fprintf(stderr, "orte_abort: couldn't init orte - error code %d\n", rc);
|
|
return rc;
|
|
}
|
|
pid = getpid();
|
|
gethostname(hostname, 500);
|
|
|
|
printf("orte_abort: Name %s Host: %s Pid %ld\n", ORTE_NAME_PRINT(orte_process_info.my_name),
|
|
hostname, (long)pid);
|
|
|
|
i = 0;
|
|
while (1) {
|
|
i++;
|
|
pi = i / 3.14159256;
|
|
if (i > 10000) i = 0;
|
|
if ((orte_process_info.my_name->vpid == 3 ||
|
|
(orte_process_info.num_procs <= 3 && orte_process_info.my_name->vpid == 0))
|
|
&& i == 9995) {
|
|
orte_abort(1, true);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|