SIONlib  1.7.7
Scalable I/O library for parallel access to task-local files
sion_mpi_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 ****************************************************************************/
9 
14 #define _XOPEN_SOURCE 700
15 
16 #include <stdlib.h>
17 #include <stdio.h>
18 #include <stdarg.h>
19 #include <string.h>
20 #include <time.h>
21 
22 #include <sys/time.h>
23 
24 #include <sys/types.h>
25 #include <fcntl.h>
26 
27 #include <unistd.h>
28 
29 #include "sion.h"
30 #include "sion_debug.h"
31 #include "sion_internal.h"
32 #include "sion_fd.h"
33 #include "sion_filedesc.h"
34 #include "sion_printts.h"
35 
36 
37 
38 #ifdef SION_MPI
39 
40 #ifdef _SION_BGQ
41 
42 #include <firmware/include/personality.h>
43 int sion_get_IO_comm_mpi(MPI_Comm *commSame) {
44 
45  Personality_t personality;
46  int rc, rank, factor, bridgeid;
47 
48  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
49 
50  /* get location information */
51  Kernel_GetPersonality(&personality, sizeof(Personality_t));
52 
53  factor=1;
54  bridgeid = personality.Network_Config.cnBridge_E;
55  factor *= personality.Network_Config.Enodes;
56  bridgeid += personality.Network_Config.cnBridge_D*factor;
57  factor *= personality.Network_Config.Dnodes;
58  bridgeid += personality.Network_Config.cnBridge_C*factor;
59  factor *= personality.Network_Config.Cnodes;
60  bridgeid += personality.Network_Config.cnBridge_B*factor;
61  factor *= personality.Network_Config.Bnodes;
62  bridgeid += personality.Network_Config.cnBridge_A*factor;
63 
64  /* communicator consists of all task working with the same I/O-node */
65  rc=MPI_Comm_split(MPI_COMM_WORLD, bridgeid, rank, commSame);
66  return(rc);
67 }
68 
69 #else
70 /* default */
71 int sion_get_IO_comm_mpi(MPI_Comm *commSame) {
72 
73  int rc;
74  rc=MPI_Comm_dup(MPI_COMM_WORLD, commSame);
75  return(rc);
76 }
77 
78 #endif
79 /* end of ifdef MPI */
80 #endif
Sion Time Stamp Header.