Commit 5fa41e78 authored by Jan Oliver Oelerich's avatar Jan Oliver Oelerich

Some smaller things. And a logo.

parent eed7016e
This diff is collapsed.
......@@ -979,7 +979,7 @@ void IO::copyFromTemporaryFile(const shared_ptr<GridManager> &gridman,
shared_ptr<memory::buffer::number_buffer<float>> &ibuf,
shared_ptr<memory::buffer::number_buffer<float>> &cbuf) {
Params &p = Params::getInstance();
Params &prms = Params::getInstance();
auto &mpi_env = mpi::Environment::getInstance();
auto tmpfile = std::ifstream(getTempFileName(), std::ifstream::binary);
......@@ -998,12 +998,12 @@ void IO::copyFromTemporaryFile(const shared_ptr<GridManager> &gridman,
int adf_g_id, adf_v_id, cbed_g_id, cbed_v_id, f_id;
try {
CHK(nc_open(p.outputFilename().c_str(), NC_WRITE, &f_id));
if(p.adf()) {
CHK(nc_open(prms.outputFilename().c_str(), NC_WRITE, &f_id));
if(prms.adf()) {
CHK(nc_inq_grp_ncid(f_id, "adf", &adf_g_id));
CHK(nc_inq_varid(adf_g_id, "adf_intensities", &adf_v_id));
}
if(p.cbed()) {
if(prms.cbed()) {
CHK(nc_inq_grp_ncid(f_id, "cbed", &cbed_g_id));
CHK(nc_inq_varid(cbed_g_id, "cbed_intensities", &cbed_v_id));
}
......@@ -1022,7 +1022,7 @@ void IO::copyFromTemporaryFile(const shared_ptr<GridManager> &gridman,
ScanPoint p = gridman->scanPoints()[pix_idx];
if(p.adf) {
if(prms.adf() && p.adf) {
auto &entry = ibuf->add_empty();
tmpfile.read(reinterpret_cast<char *>(ibuf->ptr(entry)), entry.byte_size());
p.storeAdfIntensities(entry);
......@@ -1030,11 +1030,11 @@ void IO::copyFromTemporaryFile(const shared_ptr<GridManager> &gridman,
p.clearAdfIntensities(ibuf);
}
if(p.cbed) {
if(prms.cbed() &&p.cbed) {
auto &entry = cbuf->add_empty();
tmpfile.read(reinterpret_cast<char *>(cbuf->ptr(entry)), entry.byte_size());
p.storeCBEDIntensities(entry);
writeCBEDIntensities(idefocus, iconf, gridman, p, cbuf, adf_g_id, adf_v_id);
writeCBEDIntensities(idefocus, iconf, gridman, p, cbuf, cbed_g_id, cbed_v_id);
p.clearCBEDIntensities(cbuf);
}
......
......@@ -284,7 +284,8 @@ void Simulation::run() {
// each MPI process now (sequentially) writes his pixels to the NC file.
if(mpi_env.isMpi()) {
mpi_env.barrier();
//This barrier is not really required.
//mpi_env.barrier();
auto start_io = high_resolution_clock::now();
......@@ -294,9 +295,8 @@ void Simulation::run() {
_io->copyFromTemporaryFile(_gridman, _adf_intensity_buffer, _cbed_intensity_buffer);
printLine(st,
output::fmt("Finished copying pixels for %s (rank %d).\n",
output::humantime(algorithms::getTimeSince(start)),
rank));
output::fmt("Finished copying pixels for %s.\n",
output::humantime(algorithms::getTimeSince(start))));
}
mpi_env.barrier();
......
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