Commit 719fabf8 by Francois Gygi

remove dependency on Context

git-svn-id: http://qboxcode.org/svn/qb/trunk@1332 cba15fb0-1239-40c8-b417-11db7ca47a34
parent e6e71dd6
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
// BasisMapping.C // BasisMapping.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: BasisMapping.C,v 1.4 2008-09-08 15:56:18 fgygi Exp $
#include "Basis.h" #include "Basis.h"
#include "Context.h" #include "Context.h"
...@@ -26,13 +25,10 @@ ...@@ -26,13 +25,10 @@
using namespace std; using namespace std;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
BasisMapping::BasisMapping (const Basis &basis) : ctxt_(basis.context()), BasisMapping::BasisMapping (const Basis &basis) : basis_(basis)
basis_(basis)
{ {
assert(ctxt_.npcol() == 1); nprocs_ = basis_.npes();
nprocs_ = ctxt_.size(); myproc_ = basis_.mype();
myproc_ = ctxt_.myproc();
np0_ = basis.np(0); np0_ = basis.np(0);
np1_ = basis.np(1); np1_ = basis.np(1);
...@@ -428,11 +424,11 @@ void BasisMapping::transpose_fwd(const complex<double> *zvec, ...@@ -428,11 +424,11 @@ void BasisMapping::transpose_fwd(const complex<double> *zvec,
#if USE_MPI #if USE_MPI
int status = MPI_Alltoallv((double*)&sbuf[0],&scounts[0],&sdispl[0], int status = MPI_Alltoallv((double*)&sbuf[0],&scounts[0],&sdispl[0],
MPI_DOUBLE,(double*)&rbuf[0],&rcounts[0],&rdispl[0],MPI_DOUBLE, MPI_DOUBLE,(double*)&rbuf[0],&rcounts[0],&rdispl[0],MPI_DOUBLE,
ctxt_.comm()); basis_.comm());
if ( status != 0 ) if ( status != 0 )
{ {
cout << " BasisMapping: status = " << status << endl; cout << " BasisMapping: status = " << status << endl;
ctxt_.abort(2); MPI_Abort(basis_.comm(),2);
} }
#else #else
assert(sbuf.size()==rbuf.size()); assert(sbuf.size()==rbuf.size());
...@@ -513,7 +509,7 @@ void BasisMapping::transpose_bwd(const complex<double> *ct, ...@@ -513,7 +509,7 @@ void BasisMapping::transpose_bwd(const complex<double> *ct,
#if USE_MPI #if USE_MPI
int status = MPI_Alltoallv((double*)&rbuf[0],&rcounts[0],&rdispl[0], int status = MPI_Alltoallv((double*)&rbuf[0],&rcounts[0],&rdispl[0],
MPI_DOUBLE,(double*)&sbuf[0],&scounts[0],&sdispl[0],MPI_DOUBLE, MPI_DOUBLE,(double*)&sbuf[0],&scounts[0],&sdispl[0],MPI_DOUBLE,
ctxt_.comm()); basis_.comm());
assert ( status == 0 ); assert ( status == 0 );
#else #else
assert(sbuf.size()==rbuf.size()); assert(sbuf.size()==rbuf.size());
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
// BasisMapping.h // BasisMapping.h
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: BasisMapping.h,v 1.4 2008-09-08 15:56:18 fgygi Exp $
#ifndef BASISMAPPING_H #ifndef BASISMAPPING_H
#define BASISMAPPING_H #define BASISMAPPING_H
...@@ -24,13 +23,11 @@ ...@@ -24,13 +23,11 @@
#include <vector> #include <vector>
class Basis; class Basis;
class Context;
class BasisMapping class BasisMapping
{ {
private: private:
const Context& ctxt_;
const Basis& basis_; const Basis& basis_;
int nprocs_, myproc_; int nprocs_, myproc_;
...@@ -58,8 +55,6 @@ class BasisMapping ...@@ -58,8 +55,6 @@ class BasisMapping
int nvec(void) const { return nvec_; } int nvec(void) const { return nvec_; }
int zvec_size(void) const { return nvec_ * np2_; } int zvec_size(void) const { return nvec_ * np2_; }
const Context& context(void) const { return ctxt_; }
// map a function c(G) to zvec_ // map a function c(G) to zvec_
void vector_to_zvec(const std::complex<double> *c, void vector_to_zvec(const std::complex<double> *c,
std::complex<double> *zvec); std::complex<double> *zvec);
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
// MLWFTransform.C // MLWFTransform.C
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: MLWFTransform.C,v 1.6 2008-09-08 15:56:18 fgygi Exp $
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
// MLWFTransform.h // MLWFTransform.h
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: MLWFTransform.h,v 1.5 2008-09-08 15:56:18 fgygi Exp $
#ifndef MLWFTRANSFORM_H #ifndef MLWFTRANSFORM_H
#define MLWFTRANSFORM_H #define MLWFTRANSFORM_H
...@@ -28,6 +27,8 @@ class DoubleMatrix; ...@@ -28,6 +27,8 @@ class DoubleMatrix;
#include "D3vector.h" #include "D3vector.h"
#include "BasisMapping.h" #include "BasisMapping.h"
class Context;
class MLWFTransform class MLWFTransform
{ {
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment