82af6ee940
This commit was SVN r21987.
36 строки
724 B
C
36 строки
724 B
C
/* -*- C -*-
|
|
*
|
|
* $HEADER$
|
|
*
|
|
* The most basic of MPI applications
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
#include "orte/util/proc_info.h"
|
|
#include "orte/util/name_fns.h"
|
|
#include "orte/runtime/orte_globals.h"
|
|
#include "orte/runtime/runtime.h"
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
int rc;
|
|
char hostname[512];
|
|
pid_t pid;
|
|
|
|
if (0 > (rc = orte_init(ORTE_PROC_NON_MPI))) {
|
|
fprintf(stderr, "orte_nodename: couldn't init orte - error code %d\n", rc);
|
|
return rc;
|
|
}
|
|
|
|
gethostname(hostname, 512);
|
|
pid = getpid();
|
|
|
|
printf("orte_nodename: Node %s Name %s Pid %ld\n",
|
|
hostname, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), (long)pid);
|
|
|
|
orte_finalize();
|
|
return 0;
|
|
}
|