Moved serial mode to target mcelecron_serial.
Implemented parallelization with mpi.
This commit is contained in:
@@ -19,14 +19,14 @@ void Population_Load_Saver::save() {
|
||||
}
|
||||
ofstream save_stream(get_save_path());
|
||||
write_overhead(&save_stream);
|
||||
for (vector<species>::iterator Itr = all_species.begin(); Itr!= all_species.end(); Itr++) {
|
||||
write_species(&save_stream, *Itr);
|
||||
for (vector<species>::iterator itr = all_species.begin(); itr!= all_species.end(); itr++) {
|
||||
write_species(&save_stream, *itr);
|
||||
}
|
||||
save_stream.close();
|
||||
}
|
||||
|
||||
string Population_Load_Saver::get_save_path() {
|
||||
string parameter_name = get_parameter_filename();
|
||||
string parameter_name = get_parameter_filenamepath();
|
||||
stringstream save_path;
|
||||
save_path<<parameter_name<<"_save_populations.dat";
|
||||
return save_path.str();
|
||||
@@ -64,13 +64,13 @@ void Population_Load_Saver::write_species(ofstream *save_stream, species this_sp
|
||||
*save_stream<<number_bins[i]<<"\t";
|
||||
}
|
||||
*save_stream<<"#number_bins of 1. z_scale 2. r_scale 3. phi_scale 4. E_scale \n";
|
||||
for (bin_content_vec::iterator Itr = bins.begin(); Itr != bins.end(); Itr++) {
|
||||
*save_stream<<Itr->z_bin<<"\t";
|
||||
*save_stream<<Itr->r_bin<<"\t";
|
||||
*save_stream<<Itr->phi_bin<<"\t";
|
||||
*save_stream<<Itr->E_bin<<"\t";
|
||||
*save_stream<<Itr->cumulated_time_s<<"\t";
|
||||
*save_stream<<Itr->offset<<"\n";
|
||||
for (bin_content_vec::iterator itr = bins.begin(); itr != bins.end(); itr++) {
|
||||
*save_stream<<itr->z_bin<<"\t";
|
||||
*save_stream<<itr->r_bin<<"\t";
|
||||
*save_stream<<itr->phi_bin<<"\t";
|
||||
*save_stream<<itr->E_bin<<"\t";
|
||||
*save_stream<<itr->cumulated_time_s<<"\t";
|
||||
*save_stream<<itr->offset<<"\n";
|
||||
}
|
||||
*save_stream<<"end_of_species \n";
|
||||
}
|
||||
@@ -184,8 +184,8 @@ species Population_Load_Saver::get_species_line(std::ifstream *load_stream) {
|
||||
}
|
||||
|
||||
void Population_Load_Saver::append_check_vector(std::vector<species> *check_vector, species add_species) {
|
||||
for (std::vector<species>::iterator Itr=check_vector->begin(); Itr!=check_vector->end(); Itr++) {
|
||||
if (*Itr == add_species) {
|
||||
for (std::vector<species>::iterator itr=check_vector->begin(); itr!=check_vector->end(); itr++) {
|
||||
if (*itr == add_species) {
|
||||
std::stringstream ss;
|
||||
ss<<"Population_Load_Saver::append_check_vector: species already loaded.\n";
|
||||
throw MyException(ss.str());
|
||||
|
||||
Reference in New Issue
Block a user