1
1

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.
Этот коммит содержится в:
Ralph Castain 2006-08-14 17:45:50 +00:00
родитель 0d41890768
Коммит d56df1c48e
2 изменённых файлов: 28 добавлений и 1 удалений

Просмотреть файл

@ -1,4 +1,4 @@
PROGS = no_op mpi_no_op hello hello_null sigusr_trap hello_nodename spin
PROGS = no_op mpi_no_op hello hello_null sigusr_trap hello_nodename spin orte_nodename
all: $(PROGS)

27
orte/test/system/orte_nodename.c Обычный файл
Просмотреть файл

@ -0,0 +1,27 @@
/* -*- 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;
}