Skip to content

Commit

Permalink
Removing mpi test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanKierans committed Mar 4, 2024
1 parent 40aaada commit f78d857
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 222 deletions.
25 changes: 0 additions & 25 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,3 @@ get_ppid <- function() {
.Call('_rTrace_get_ppid', PACKAGE = 'rTrace')
}

#' mpi_init
mpi_init <- function() {
.Call('_rTrace_mpi_init', PACKAGE = 'rTrace')
}

#' mpi_finalize
mpi_finalize <- function() {
.Call('_rTrace_mpi_finalize', PACKAGE = 'rTrace')
}

#' mpi_is_init
mpi_is_init <- function() {
.Call('_rTrace_mpi_is_init', PACKAGE = 'rTrace')
}

#' get_mpi_rank
get_mpi_rank <- function() {
.Call('_rTrace_get_mpi_rank', PACKAGE = 'rTrace')
}

#' get_mpi_size
get_mpi_size <- function() {
.Call('_rTrace_get_mpi_size', PACKAGE = 'rTrace')
}

14 changes: 0 additions & 14 deletions man/get_env.Rd

This file was deleted.

11 changes: 0 additions & 11 deletions man/get_mpi_rank.Rd

This file was deleted.

11 changes: 0 additions & 11 deletions man/get_mpi_size.Rd

This file was deleted.

11 changes: 0 additions & 11 deletions man/mpi_finalize.Rd

This file was deleted.

11 changes: 0 additions & 11 deletions man/mpi_init.Rd

This file was deleted.

11 changes: 0 additions & 11 deletions man/mpi_is_init.Rd

This file was deleted.

55 changes: 0 additions & 55 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,56 +191,6 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// mpi_init
RcppExport int mpi_init();
RcppExport SEXP _rTrace_mpi_init() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(mpi_init());
return rcpp_result_gen;
END_RCPP
}
// mpi_finalize
RcppExport SEXP mpi_finalize();
RcppExport SEXP _rTrace_mpi_finalize() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(mpi_finalize());
return rcpp_result_gen;
END_RCPP
}
// mpi_is_init
RcppExport int mpi_is_init();
RcppExport SEXP _rTrace_mpi_is_init() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(mpi_is_init());
return rcpp_result_gen;
END_RCPP
}
// get_mpi_rank
RcppExport int get_mpi_rank();
RcppExport SEXP _rTrace_get_mpi_rank() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(get_mpi_rank());
return rcpp_result_gen;
END_RCPP
}
// get_mpi_size
RcppExport int get_mpi_size();
RcppExport SEXP _rTrace_get_mpi_size() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(get_mpi_size());
return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_rTrace_init_Archive", (DL_FUNC) &_rTrace_init_Archive, 2},
Expand All @@ -260,11 +210,6 @@ static const R_CallMethodDef CallEntries[] = {
{"_rTrace_get_pid", (DL_FUNC) &_rTrace_get_pid, 0},
{"_rTrace_get_tid", (DL_FUNC) &_rTrace_get_tid, 0},
{"_rTrace_get_ppid", (DL_FUNC) &_rTrace_get_ppid, 0},
{"_rTrace_mpi_init", (DL_FUNC) &_rTrace_mpi_init, 0},
{"_rTrace_mpi_finalize", (DL_FUNC) &_rTrace_mpi_finalize, 0},
{"_rTrace_mpi_is_init", (DL_FUNC) &_rTrace_mpi_is_init, 0},
{"_rTrace_get_mpi_rank", (DL_FUNC) &_rTrace_get_mpi_rank, 0},
{"_rTrace_get_mpi_size", (DL_FUNC) &_rTrace_get_mpi_size, 0},
{NULL, NULL, 0}
};

Expand Down
73 changes: 0 additions & 73 deletions src/rTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#include <sys/types.h>
#include <unistd.h>

// if (MPI)
#include <mpi.h>


//#define DEBUG /* Uncomment to enable verbose debug info */
//#define DUMMY_TIMESTEPS /* Uncomment for 1s timestep for each subsequent event call */

Expand Down Expand Up @@ -386,72 +382,3 @@ RcppExport int get_tid() {
RcppExport int get_ppid() {
return((int)getppid());
}

//' mpi_init
// [[Rcpp::export]]
RcppExport int mpi_init() {
int flag;
int fake_argc = 0;
char **fake_argv = NULL;
//char **fake_argv = malloc(1*sizeof(*fake_argv));
MPI_Init(&fake_argc, &fake_argv);
free(fake_argv);

MPI_Initialized(&flag);
if (flag) {
Rcout << "MPI is initialized.\n";
return(0);
}
Rcout << "MPI UNABLE to initialize.\n";
return (-1);
}

//' mpi_finalize
// [[Rcpp::export]]
RcppExport SEXP mpi_finalize() {
MPI_Finalize();
return(R_NilValue);
}

//' mpi_is_init
// [[Rcpp::export]]
RcppExport int mpi_is_init() {
int init_flag;
MPI_Initialized(&init_flag);
if (init_flag) {
Rcout << "MPI is initialized.\n";
return(0);
}
Rcout << "MPI is NOT initialized\n";
return (-1);
}

//' get_mpi_rank
// [[Rcpp::export]]
RcppExport int get_mpi_rank() {
int rank, init_flag;
MPI_Initialized(&init_flag);
if (init_flag) {
Rcout << "MPI is initialized.\n";
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
return(rank);
}
Rcout << "MPI is NOT initialized\n";
return (-1);
}

//' get_mpi_size
// [[Rcpp::export]]
RcppExport int get_mpi_size() {
int size, init_flag;
MPI_Initialized(&init_flag);
if (init_flag) {
Rcout << "MPI is initialized.\n";
MPI_Comm_size(MPI_COMM_WORLD, &size);
return(size);
}
Rcout << "MPI is NOT initialized\n";
return (-1);
}


0 comments on commit f78d857

Please sign in to comment.