summaryrefslogtreecommitdiffstats
path: root/examples/h5ff_server.c
blob: 690b0f1117457494f11e26e405a134be7b442f86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* 

 * test_server.c: Server side of Milestone 3.3 Asynchronous I/O and initial

 * IOD VOL plugin demonstration.

 */

#include <stdio.h>

#include <stdlib.h>

#include <assert.h>

#include <string.h>

#include "mpi.h"

#include "hdf5.h"


int main(int argc, char **argv) {
    int my_size, my_rank;
    int provided;

    MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
    if(MPI_THREAD_MULTIPLE != provided) {
        printf("MPI does not have MPI_THREAD_MULTIPLE support\n");
        exit(1);
    }

    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
    MPI_Comm_size(MPI_COMM_WORLD, &my_size);
    printf("Number of server processes = %d, my rank is %d\n", my_size, my_rank);

    //H5open();

    /* This call initiliazes the FS for the server processes (create metadata and

       bulk data handles). It also registers with the Function shipper the 

       HDF5 VOL server routines that will be executed when the clients ship the VOL 

       routines. Then it executes a loop to receive requests from clients that map 

       to one of the registered callbacks. 



       Whenever a request is received, the corresponding callback is called which 

       inserts the operation into the AXE (the Asynchronous eXecution Engine) and 

       returns to receive another request. The AXE schedules that operation to 

       execute by assigning a thread to it. After the operation is complete, the 

       result is returned to the client through the function shipper complete call.



       Finally, when all clients send a terminate call, the function shipper interface

       is finalized the operation returns. */
    EFF_start_server(MPI_COMM_WORLD, MPI_INFO_NULL);
    //H5close();

    MPI_Finalize();

    return 0;
}