~james-page/ubuntu/precise/openmpi1.5/new

« back to all changes in this revision

Viewing changes to ompi/contrib/vt/vt/vtlib/vt_mpiwrap.c

  • Committer: Bazaar Package Importer
  • Author(s): Manuel Prinz
  • Date: 2009-04-23 14:01:21 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090423140121-vsi3pqa6g30j4qiy
Tags: 1.3.2-1
* New upstream release. (Closes: #520597, #515116)
  - Manpage and VampirTrace patches removed, included upstream.
* Fixed build issues on Alpha. Huge thanks to Arthur Loiret for providing
  access to his machines for testing! (Closes: #510845, #517543)
* Fixed build issues on Sparc. (Closes: #519725)
* Fixed manpage-has-errors-from-man lintian warnings.
* Faked SONAME change by renaming library package. (Closes: #512616)
* Made libopenmpi-dev depend on libibverbs-dev. (Closes: #522153)
* Support for "nocheck" build option in debian/rules.
* Updated Standards-Version in debian/control.
* Changed section of libopenmpi-dbg to "debug".
* Updated debian/copyright.

* Dirk Eddelbuettel removed himself from Uploaders. The team thanks Dirk
  for his long-term contribution and effort to get Open MPI back to life.
  I personally thank Dirk for encouraging me to become a Debian Developer
  and his support and mentoring on that way and beyond.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
  return returnVal;
165
165
}
166
166
 
 
167
#if defined(HAVE_MPITHRD) && HAVE_MPITHRD
 
168
 
 
169
/* -- MPI_Init_thread -- */
 
170
 
 
171
int MPI_Init_thread( int* argc, char*** argv,
 
172
                     int required, int* provided )
 
173
{
 
174
  int returnVal, numprocs, me, i;
 
175
  unsigned char* grpv;
 
176
  uint32_t grpc;
 
177
  uint64_t time;
 
178
 
 
179
  /* shall I trace MPI events? */
 
180
  vt_mpi_trace_is_on = vt_mpitrace = vt_env_mpitrace();
 
181
 
 
182
  /* first event?
 
183
     -> initialize VT and enter dummy function 'user' */
 
184
  if ( !vt_is_alive )
 
185
    {
 
186
      vt_open();
 
187
      time = vt_pform_wtime();
 
188
      vt_enter_user(&time);
 
189
      vt_enter_user_called = 1;
 
190
    }
 
191
 
 
192
  if (IS_MPI_TRACE_ON)
 
193
    {
 
194
      MPI_TRACE_OFF();
 
195
 
 
196
      time = vt_pform_wtime();
 
197
      vt_enter(&time, vt_mpi_regid[VT__MPI_INIT_THREAD]);
 
198
 
 
199
      returnVal = PMPI_Init_thread(argc, argv, required, provided);
 
200
 
 
201
      switch (required)
 
202
      {
 
203
        case MPI_THREAD_SINGLE:
 
204
        case MPI_THREAD_FUNNELED:
 
205
          break;
 
206
        case MPI_THREAD_SERIALIZED:
 
207
        case MPI_THREAD_MULTIPLE:
 
208
          if (*provided == MPI_THREAD_SERIALIZED ||
 
209
              *provided == MPI_THREAD_MULTIPLE)
 
210
          {
 
211
            vt_error_msg("MPI thread support levels MPI_THREAD_SERIALIZED and "
 
212
                         "MPI_THREAD_MULTIPLE not yet supported");
 
213
          }
 
214
          break;
 
215
        default:
 
216
          vt_error_msg("Unknown level of MPI thread support required");
 
217
          break;
 
218
      }
 
219
 
 
220
      /* initialize mpi event handling */
 
221
      vt_mpi_init();
 
222
 
 
223
      PMPI_Comm_size(MPI_COMM_WORLD, &numprocs);
 
224
      PMPI_Comm_rank(MPI_COMM_WORLD, &me);
 
225
 
 
226
      grpc = numprocs / 8 + (numprocs % 8 ? 1 : 0);
 
227
 
 
228
      /* define communicator for MPI_COMM_WORLD */
 
229
      grpv = (unsigned char*)calloc(grpc, sizeof(unsigned char));
 
230
      for (i = 0; i < numprocs; i++)
 
231
        grpv[i / 8] |= (1 << (i % 8));
 
232
      vt_def_mpi_comm(0, grpc, grpv);
 
233
 
 
234
      memset(grpv, 0, grpc);
 
235
 
 
236
      /* define communicator for MPI_COMM_SELF */
 
237
      grpv[me / 8] |= (1 << (me % 8));
 
238
      vt_def_mpi_comm(1, grpc, grpv);
 
239
 
 
240
      free(grpv);
 
241
 
 
242
      /* initialize communicator management */
 
243
      vt_comm_init();
 
244
 
 
245
      time = vt_pform_wtime();
 
246
      vt_exit(&time);
 
247
 
 
248
      MPI_TRACE_ON();
 
249
    }
 
250
  else
 
251
    {
 
252
      returnVal = PMPI_Init_thread(argc, argv, required, provided);
 
253
 
 
254
      /* initialize mpi event handling */
 
255
      vt_mpi_init();
 
256
 
 
257
      PMPI_Comm_size(MPI_COMM_WORLD, &numprocs);
 
258
      PMPI_Comm_rank(MPI_COMM_WORLD, &me);
 
259
 
 
260
      grpc = numprocs / 8 + (numprocs % 8 ? 1 : 0);
 
261
 
 
262
      /* define communicator for MPI_COMM_WORLD */
 
263
      grpv = (unsigned char*)calloc(grpc, sizeof(unsigned char));
 
264
      for (i = 0; i < numprocs; i++)
 
265
        grpv[i / 8] |= (1 << (i % 8));
 
266
      vt_def_mpi_comm(0, grpc, grpv);
 
267
 
 
268
      memset(grpv, 0, grpc);
 
269
 
 
270
      /* define communicator for MPI_COMM_SELF */
 
271
      grpv[me / 8] |= (1 << (me % 8));
 
272
      vt_def_mpi_comm(1, grpc, grpv);
 
273
 
 
274
      free(grpv);
 
275
 
 
276
      /* initialize communicator management */
 
277
      vt_comm_init();
 
278
    }
 
279
 
 
280
  return returnVal;
 
281
}
 
282
 
 
283
#endif /* HAVE_MPITHRD */
 
284
 
167
285
/* -- MPI_Finalize -- */
168
286
 
169
287
int MPI_Finalize()