1
1
openmpi/orte/test/system/orte_nodename.c
Ralph Castain d56df1c48e Add a simply program that reports the node and process name.
Note that some compile warnings are generated here because of the direct inclusion of an orte include file in the program. Not entirely sure why that is happening (it is relatively new phenomenon), but it doesn't cause any problems in terms of operation.

This commit was SVN r11175.
2006-08-14 17:45:50 +00:00

28 строки
530 B
C

/* -*- C -*-
*
* $HEADER$
*
* The most basic of MPI applications
*/
#include <stdio.h>
#include "orte/util/proc_info.h"
int main(int argc, char* argv[])
{
int rc;
char hostname[512];
if (0 > (rc = orte_init())) {
fprintf(stderr, "orte_nodename: couldn't init orte - error code %d\n", rc);
return rc;
}
gethostname(hostname, 512);
printf("orte_nodename: Node %s Name [%lu,%lu,%lu]\n", hostname, ORTE_NAME_ARGS(orte_process_info.my_name));
orte_finalize();
return 0;
}