Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/interfaces/sapporoG6lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ extern "C" {
// return grav.calc_lasthalf2(*cluster_id, *nj, *ni,
// index, xi, vi, *eps2, h2, acc, jerk, pot, inn);
}



int g6_get_nj_max_() {
return grav.get_nj_max();
}

void get_j_part_data(int addr, int nj,
double *pos,
double *vel,
Expand Down
10 changes: 8 additions & 2 deletions src/sapporohostclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int sapporo::open(std::string kernelFile, int *devices,

//Allocate initial memory for 16k particles per device
sapdevice->allocateMemory(16384, get_n_pipes());
nj_max = 16384;
nj_max = 262144; //Initial max number of j-particles, can be increased if needed
}//end pragma omp parallel

//Used to store j-memory particle counters
Expand Down Expand Up @@ -461,7 +461,8 @@ int sapporo::set_j_particle(int address,
//Extra check, if we are still outside nj_max, we quit since particles are not
//nicely send in order
if (address >= nj_max) {
fprintf(stderr, "Increasing nj_max was not enough! Send particles in order to the library! Exit\n");
fprintf(stderr, "Increasing nj_max = %d was not enough, address = %d\n", nj_max, address);
fprintf(stderr, "Send particles in order to the library! Exit\n");
exit(-1);
}
}
Expand Down Expand Up @@ -1601,3 +1602,8 @@ double sapporo::evaluate_gravity(int ni_total, int nj)
return 0.0;
} //end evaluate gravity


int sapporo::get_nj_max() const
{
return nj_max;
}
6 changes: 5 additions & 1 deletion src/sapporohostclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ struct jCopyInfo
int toCopy;
} typedef jCopyInfo;


extern "C"
{
int g6_get_nj_max_();
}

class sapporo {
protected:
Expand Down Expand Up @@ -126,6 +129,7 @@ class sapporo {
int order = FOURTH, int precision = DOUBLESINGLE);
int close();
int get_n_pipes();
int get_nj_max() const;
int set_time(double ti);
int set_no_time();

Expand Down