1
1

Nothing substantial: just move the generalized request intercept data

structure up into the MPI::Grequest class (rather than being a struct
definition outside of any class) to be similar to how the keyval
intercept data structures are organized.  Fix one minor compiler
warning in the process.

This commit was SVN r17171.
Этот коммит содержится в:
Jeff Squyres 2008-01-21 15:56:21 +00:00
родитель 6e4155d111
Коммит 404f8d1076
3 изменённых файлов: 29 добавлений и 29 удалений

Просмотреть файл

@ -495,11 +495,11 @@ ompi_mpi_cxx_win_delete_attr_intercept(MPI_Win win, int keyval,
extern "C" int extern "C" int
ompi_mpi_cxx_grequest_query_fn_intercept(void *state, MPI_Status *status) ompi_mpi_cxx_grequest_query_fn_intercept(void *state, MPI_Status *status)
{ {
struct MPI::Grequest_intercept_t *data = MPI::Grequest::Intercept_data_t *data =
(struct MPI::Grequest_intercept_t *) state; (MPI::Grequest::Intercept_data_t *) state;
MPI::Status s(*status); MPI::Status s(*status);
int ret = data->git_cxx_query_fn(data->git_extra, s); int ret = data->id_cxx_query_fn(data->id_extra, s);
*status = s; *status = s;
return ret; return ret;
} }
@ -507,9 +507,9 @@ ompi_mpi_cxx_grequest_query_fn_intercept(void *state, MPI_Status *status)
extern "C" int extern "C" int
ompi_mpi_cxx_grequest_free_fn_intercept(void *state) ompi_mpi_cxx_grequest_free_fn_intercept(void *state)
{ {
struct MPI::Grequest_intercept_t *data = MPI::Grequest::Intercept_data_t *data =
(struct MPI::Grequest_intercept_t *) state; (MPI::Grequest::Intercept_data_t *) state;
int ret = data->git_cxx_free_fn(data->git_extra); int ret = data->id_cxx_free_fn(data->id_extra);
// Delete the struct that was "new"ed in MPI::Grequest::Start() // Delete the struct that was "new"ed in MPI::Grequest::Start()
delete data; delete data;
return ret; return ret;
@ -518,8 +518,8 @@ ompi_mpi_cxx_grequest_free_fn_intercept(void *state)
extern "C" int extern "C" int
ompi_mpi_cxx_grequest_cancel_fn_intercept(void *state, int cancelled) ompi_mpi_cxx_grequest_cancel_fn_intercept(void *state, int cancelled)
{ {
struct MPI::Grequest_intercept_t *data = MPI::Grequest::Intercept_data_t *data =
(struct MPI::Grequest_intercept_t *) state; (MPI::Grequest::Intercept_data_t *) state;
return data->git_cxx_cancel_fn(data->git_extra, return data->id_cxx_cancel_fn(data->id_extra,
(0 != cancelled ? true : false)); (0 != cancelled ? true : false));
} }

Просмотреть файл

@ -10,7 +10,7 @@
// University of Stuttgart. All rights reserved. // University of Stuttgart. All rights reserved.
// Copyright (c) 2004-2005 The Regents of the University of California. // Copyright (c) 2004-2005 The Regents of the University of California.
// All rights reserved. // All rights reserved.
// Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. // Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
// $COPYRIGHT$ // $COPYRIGHT$
// //
// Additional copyrights may follow // Additional copyrights may follow
@ -220,16 +220,16 @@ class Grequest : public MPI::Request {
Cancel_function *, void *); Cancel_function *, void *);
virtual void Complete(); virtual void Complete();
};
// //
// Type used for intercepting Generalized requests in the C++ layer so // Type used for intercepting Generalized requests in the C++ layer so
// that the type can be converted to C++ types before invoking the // that the type can be converted to C++ types before invoking the
// user-specified C++ callbacks. // user-specified C++ callbacks.
// //
struct Grequest_intercept_t { struct Intercept_data_t {
void *git_extra; void *id_extra;
Grequest::Query_function *git_cxx_query_fn; Grequest::Query_function *id_cxx_query_fn;
Grequest::Free_function *git_cxx_free_fn; Grequest::Free_function *id_cxx_free_fn;
Grequest::Cancel_function *git_cxx_cancel_fn; Grequest::Cancel_function *id_cxx_cancel_fn;
};
}; };

Просмотреть файл

@ -10,7 +10,7 @@
// University of Stuttgart. All rights reserved. // University of Stuttgart. All rights reserved.
// Copyright (c) 2004-2005 The Regents of the University of California. // Copyright (c) 2004-2005 The Regents of the University of California.
// All rights reserved. // All rights reserved.
// Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. // Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
// Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. // Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
// $COPYRIGHT$ // $COPYRIGHT$
// //
@ -343,13 +343,13 @@ MPI::Grequest::Start(Query_function *query_fn, Free_function *free_fn,
Cancel_function *cancel_fn, void *extra) Cancel_function *cancel_fn, void *extra)
{ {
MPI_Request grequest = 0; MPI_Request grequest = 0;
struct Grequest_intercept_t *new_extra = Intercept_data_t *new_extra =
new struct MPI::Grequest_intercept_t; new MPI::Grequest::Intercept_data_t;
new_extra->git_extra = extra; new_extra->id_extra = extra;
new_extra->git_cxx_query_fn = query_fn; new_extra->id_cxx_query_fn = query_fn;
new_extra->git_cxx_free_fn = free_fn; new_extra->id_cxx_free_fn = free_fn;
new_extra->git_cxx_cancel_fn = cancel_fn; new_extra->id_cxx_cancel_fn = cancel_fn;
(void) MPI_Grequest_start(ompi_mpi_cxx_grequest_query_fn_intercept, (void) MPI_Grequest_start(ompi_mpi_cxx_grequest_query_fn_intercept,
ompi_mpi_cxx_grequest_free_fn_intercept, ompi_mpi_cxx_grequest_free_fn_intercept,
ompi_mpi_cxx_grequest_cancel_fn_intercept, ompi_mpi_cxx_grequest_cancel_fn_intercept,