SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
sion_ompi_util.c
Go to the documentation of this file.
1 /****************************************************************************
2 ** SIONLIB http://www.fz-juelich.de/jsc/sionlib **
3 *****************************************************************************
4 ** Copyright (c) 2008-2019 **
5 ** Forschungszentrum Juelich, Juelich Supercomputing Centre **
6 ** **
7 ** See the file COPYRIGHT in the package base directory for details **
8 ****************************************************************************/
15 #define _XOPEN_SOURCE 700
16 
17 #include <stdlib.h>
18 #include <stdio.h>
19 #include <stdarg.h>
20 #include <string.h>
21 #include <time.h>
22 
23 #include <sys/time.h>
24 
25 #include <sys/types.h>
26 #include <fcntl.h>
27 
28 #include <unistd.h>
29 
30 #include "sion.h"
31 #include "sion_debug.h"
32 #include "sion_internal.h"
33 #include "sion_fd.h"
34 #include "sion_filedesc.h"
35 #include "sion_printts.h"
36 
37 
38 
39 #ifdef SION_MPI
40 
41 #ifdef _SION_BGQ
42 
43 #include <firmware/include/personality.h>
44 int sion_get_IO_comm_ompi(MPI_Comm *commSame) {
45 
46  Personality_t personality;
47  int rc, rank, factor, bridgeid;
48 
49  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
50 
51  /* get location information */
52  Kernel_GetPersonality(&personality, sizeof(Personality_t));
53 
54  factor=1;
55  bridgeid = personality.Network_Config.cnBridge_E;
56  factor *= personality.Network_Config.Enodes;
57  bridgeid += personality.Network_Config.cnBridge_D*factor;
58  factor *= personality.Network_Config.Dnodes;
59  bridgeid += personality.Network_Config.cnBridge_C*factor;
60  factor *= personality.Network_Config.Cnodes;
61  bridgeid += personality.Network_Config.cnBridge_B*factor;
62  factor *= personality.Network_Config.Bnodes;
63  bridgeid += personality.Network_Config.cnBridge_A*factor;
64 
65  /* communicator consists of all task working with the same I/O-node */
66  rc=MPI_Comm_split(MPI_COMM_WORLD, bridgeid, rank, commSame);
67  return(rc);
68 }
69 
70 #else
71 /* default */
72 int sion_get_IO_comm_ompi(MPI_Comm *commSame) {
73 
74  int rc;
75  rc=MPI_Comm_dup(MPI_COMM_WORLD, commSame);
76  return(rc);
77 }
78 
79 #endif
80 /* end of ifdef MPI */
81 #endif
Sion Time Stamp Header.