Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for reading and writing 3D (grid) data sets #624

Merged
merged 28 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0c71197
DRR - Cpptraj: Add test to ensure we can go to and from a 3d format w…
drroe Jul 25, 2018
bfb4e87
DRR - Cpptraj: Start adding 3d write.
drroe Jul 25, 2018
ad32f48
DRR - Cpptraj: Add origin and delta args. Start reading data.
drroe Jul 25, 2018
5bd5c81
DRR - Cpptraj: Finish initial 3d read
drroe Jul 25, 2018
3bc8fd4
DRR - Cpptraj: Ensure grid dimensions are properly set when allocating.
Jul 26, 2018
2dfd6aa
DRR - Cpptraj: Do not use DataSet::dim_/Coord() for writing out grid …
Jul 26, 2018
5559788
DRR - Cpptraj: Add option to change grid precision
Jul 26, 2018
66e65dc
DRR - Cpptraj: Add append option for 3d grid read
Jul 26, 2018
d151757
DRR - Cpptraj: Add 'sparse' keyword for only writing voxels with valu…
Jul 26, 2018
d72c171
DRR - Cpptraj: Report number of values read for std 3d read. Fix set …
Jul 26, 2018
e0c7056
DRR - Cpptraj: Write grid dimensions etc when writing standard 3d data
Jul 26, 2018
7a55658
DRR - Cpptraj: Add logic for reading in grid dims etc from standard 3…
Jul 26, 2018
d726dce
DRR - Cpptraj: Try to read non-orthogonal grids
Jul 26, 2018
8128d3e
DRR - Cpptraj: Properly take into account origin coordinates when cal…
Jul 26, 2018
537f9b0
DRR - Cpptraj: Correct offset for bin corners reading in grid voxel x…
Jul 26, 2018
f107c27
DRR - Cpptraj: When writing out grid delta etc use same precision as …
Jul 26, 2018
c46f364
DRR - Cpptraj: Allow choice of XYZ as bin corner or center when reading.
Jul 26, 2018
328ee5d
DRR - Cpptraj: Code comments
Jul 26, 2018
105baf7
DRR - Cpptraj: Fix up help
Jul 26, 2018
04d3ca4
DRR - Cpptraj: Write float grid size in bytes
Jul 26, 2018
b4bd5ff
DRR - Cpptraj: Write double precision grid size
Jul 26, 2018
e88ff33
DRR - Cpptraj: Add many grid data set read/write tests
Jul 26, 2018
4af8ed3
DRR - Cpptraj: Only do one frame to reduce sparse file size
Jul 26, 2018
ad4f4ab
DRR - Cpptraj: Minor version bump. 3D data sets written by DataIO_Std…
Jul 26, 2018
59df8a0
DRR - Cpptraj: Fix up help
Jul 26, 2018
21ee899
DRR - Cpptraj: Update dependencies
Jul 26, 2018
9707484
DRR - Cpptraj: Add barrier after command execution to ensure all thre…
Jul 27, 2018
d54bc21
DRR - Cpptraj: Add internal consistency check to make sure all thread…
Jul 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,23 @@ CpptrajState::RetType Command::ExecuteCommand( CpptrajState& State, ArgList cons
break;
}
}
# ifdef MPI
// Check that everyone had same return value from command
int iret = (int)ret_val;
std::vector<int> rvals(Parallel::World().Size(), 0);
Parallel::World().AllGather(&iret, 1, MPI_INT, &rvals[0]);
for (std::vector<int>::const_iterator it = rvals.begin(); it != rvals.end(); ++it)
{
if (*it != rvals.front()) {
// This thread had a return value different than thread 0 - notify and
// set the overall return value to error.
mprinterr("Internal Error: Thread %u command return value %i differs from world master %i\n",
it-rvals.begin(), *it, rvals.front());
ret_val = CpptrajState::ERR;
}
}
Parallel::World().Barrier();
# endif
return ret_val;
}

Expand Down
6 changes: 1 addition & 5 deletions src/DataIO_OpenDx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bool DataIO_OpenDx::ID_DataFormat( CpptrajFile& infile ) {
int DataIO_OpenDx::ReadData(FileName const& fname,
DataSetList& datasetlist, std::string const& dsname)
{
// TODO append?
// Add grid data set. Default to float for now.
DataSet* ds = datasetlist.AddSet( DataSet::GRID_FLT, dsname, "GRID" );
if (ds==0) return 1;
Expand Down Expand Up @@ -148,11 +149,6 @@ int DataIO_OpenDx::LoadGrid(const char* filename, DataSet& ds)
}
progress.Update( ndata );
}
// Set dimensions
// FIXME: This should be integrated with allocation
//grid.SetDim(Dimension::X, Dimension(oxyz[0], dx, nx, "X"));
//grid.SetDim(Dimension::Y, Dimension(oxyz[1], dy, ny, "Y"));
//grid.SetDim(Dimension::Z, Dimension(oxyz[2], dz, nz, "Z"));
return 0;
}

Expand Down