cuserid-test.c 353 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#define _XOPEN_SOURCE

#include <stdio.h>
#include <unistd.h>

#include <mpi.h>

int main(int argc, char **argv)
{
    int rank;
    char user_string[L_cuserid];

    MPI_Init(&argc,&argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    cuserid(user_string);

    printf("rank %d: user: %s\n", rank, user_string);

    MPI_Finalize();
    return(0);
}