LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright 2013. Lawrence Livermore National Security, LLC. | 3 * Copyright 2013. Lawrence Livermore National Security, LLC. |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 { | 137 { |
138 Simulator::GetImplementation (); | 138 Simulator::GetImplementation (); |
139 g_initialized = true; | 139 g_initialized = true; |
140 } | 140 } |
141 return g_enabled; | 141 return g_enabled; |
142 } | 142 } |
143 | 143 |
144 void | 144 void |
145 NullMessageMpiInterface::Enable (int* pargc, char*** pargv) | 145 NullMessageMpiInterface::Enable (int* pargc, char*** pargv) |
146 { | 146 { |
| 147 NS_LOG_FUNCTION (this << *pargc); |
| 148 #ifndef NS3_MPI |
147 NS_UNUSED(pargv); | 149 NS_UNUSED(pargv); |
148 NS_LOG_FUNCTION (this << *pargc); | 150 |
149 #ifdef NS3_MPI | 151 #else |
150 | 152 |
151 // Initialize the MPI interface | 153 // Initialize the MPI interface |
152 MPI_Init (pargc, pargv); | 154 MPI_Init (pargc, pargv); |
153 MPI_Barrier (MPI_COMM_WORLD); | 155 MPI_Barrier (MPI_COMM_WORLD); |
154 | 156 |
155 // SystemId and Size are unit32_t in interface but MPI uses int so convert. | 157 // SystemId and Size are unit32_t in interface but MPI uses int so convert. |
156 int mpiSystemId; | 158 int mpiSystemId; |
157 int mpiSize; | 159 int mpiSize; |
158 MPI_Comm_rank (MPI_COMM_WORLD, &mpiSystemId); | 160 MPI_Comm_rank (MPI_COMM_WORLD, &mpiSystemId); |
159 MPI_Comm_size (MPI_COMM_WORLD, &mpiSize); | 161 MPI_Comm_size (MPI_COMM_WORLD, &mpiSize); |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 455 |
454 } | 456 } |
455 else | 457 else |
456 { | 458 { |
457 NS_FATAL_ERROR ("Cannot disable MPI environment without Initializing it fi
rst"); | 459 NS_FATAL_ERROR ("Cannot disable MPI environment without Initializing it fi
rst"); |
458 } | 460 } |
459 #endif | 461 #endif |
460 } | 462 } |
461 | 463 |
462 } // namespace ns3 | 464 } // namespace ns3 |
LEFT | RIGHT |