UniMCI User Documentation

ZIH Logo

Example

A Basic C Example

Here we present a full example on how to use UniMCI. In this example the application directly calls UniMCI and no MPI wrapping tool is used:

#include <mpi.h>
#include <unimci.h>
#include <stdio.h>

void check_unimci_return (void);
void print_unimci_message (UNIMCI_MSG *msg);

int main(int argc, char **argv)
{
    UNIMCI_check_pre__MPI_Init (&argc, &argv, __FILE__, __LINE__, 1);
    check_unimci_return();
    MPI_Init(&argc, &argv);
    UNIMCI_check_post__MPI_Init (&argc, &argv, __FILE__, __LINE__, 2);
    check_unimci_return();

    UNIMCI_check_pre__MPI_Finalize (__FILE__, __LINE__, 3);
    check_unimci_return();
    MPI_Finalize();
    UNIMCI_check_post__MPI_Finalize (__FILE__, __LINE__, 4);
    check_unimci_return();

    return 0;
}

void check_unimci_return (void)
{
    UNIMCI_MSG *msg;
    while (UNIMCI_has_msg ())
    {
        UNIMCI_pop_msg (&msg);
        print_unimci_message (msg);
        UNIMCI_msg_free (&msg);
    }
}

void print_unimci_message (UNIMCI_MSG *msg)
{
    printf ("%s\n",msg->strText);
}
See also:
UNIMCI_check_pre__MPI_Finalize

Where to go from here ?

Links - Go to the links section
Overview - Back to the main page


Generated on Tue May 18 10:09:18 2010 for UniMCI by  doxygen 1.6.1