<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: `Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`</title>
		<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:24:41 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error" rel="self" type="application/rss+xml" />

		<item>
			<title>Jiri Jaros on "`Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`"</title>
			<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error#post-8792</link>
			<pubDate>Tue, 06 Jun 2023 12:51:25 +0000</pubDate>
			<dc:creator>Jiri Jaros</dc:creator>
			<guid isPermaLink="false">8792@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;It is the problem of HDF5 incompatibility in new Matlab versions, we released a fix in version v1.4 that saves HDF5Atributes using system encoding.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>subhadip627@ on "`Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`"</title>
			<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error#post-8715</link>
			<pubDate>Wed, 08 Mar 2023 07:28:57 +0000</pubDate>
			<dc:creator>subhadip627@</dc:creator>
			<guid isPermaLink="false">8715@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi&#60;br /&#62;
 I am facing a compilation problem with the following code, i can't understand the solution as i am a new user for cpp code.&#60;/p&#62;
&#60;p&#62;clear all&#60;br /&#62;
run([getkWavePath 'private/getH5Literals']);&#60;br /&#62;
  filename = 'input12.h5';&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
Nx = 64;            % number of grid points in the x direction&#60;br /&#62;
Ny = 64;            % number of grid points in the y direction&#60;br /&#62;
Nz = 64;            % number of grid points in the z direction&#60;br /&#62;
dx = 0.1e-3;        % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.1e-3;        % grid point spacing in the y direction [m]&#60;br /&#62;
dz = 0.1e-3;        % grid point spacing in the z direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500 * ones(Nx, Ny, Nz);	% [m/s]&#60;br /&#62;
% medium.sound_speed(1:Nx/2, :, :) = 1800;        % [m/s]&#60;br /&#62;
medium.density = 1000 * ones(Nx, Ny, Nz);       % [kg/m^3]&#60;br /&#62;
% medium.density(:, Ny/4:end, :) = 1200;          % [kg/m^3]&#60;br /&#62;
c0=medium.sound_speed;&#60;br /&#62;
% make sure the input is in the correct data format&#60;br /&#62;
eval(['c0 = ' MATRIX_DATA_TYPE_MATLAB '(c0);']);&#60;/p&#62;
&#60;p&#62;% save the sound speed matrix&#60;br /&#62;
writeMatrix([filename], c0, 'c0');&#60;br /&#62;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;br /&#62;
% % % % create initial pressure distribution using makeBall&#60;br /&#62;
ball_magnitude = 10;    % [Pa]&#60;br /&#62;
ball_x_pos = 38;        % [grid points]&#60;br /&#62;
ball_y_pos = 32;        % [grid points]&#60;br /&#62;
ball_z_pos = 32;        % [grid points]&#60;br /&#62;
ball_radius = 5;        % [grid points]&#60;br /&#62;
p_mask =  makeBall(Nx, Ny, Nz, ball_x_pos, ball_y_pos, ball_z_pos, ball_radius);&#60;br /&#62;
ball_1 = ball_magnitude *p_mask ;&#60;/p&#62;
&#60;p&#62;source.p0 = ball_1;&#60;br /&#62;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;br /&#62;
% define a square source mask facing in the x-direction using the&#60;br /&#62;
% find linear source indices&#60;br /&#62;
p_source_index = find(p_mask == 1);&#60;br /&#62;
p_source_index = reshape(p_source_index, [], 1);&#60;/p&#62;
&#60;p&#62;% make sure the input is in the correct data format&#60;br /&#62;
eval(['p_source_index = ' INTEGER_DATA_TYPE_MATLAB '(p_source_index);']);&#60;br /&#62;
% save the source index matrix&#60;br /&#62;
writeMatrix([filename], p_source_index, 'p_source_index');&#60;/p&#62;
&#60;p&#62;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;br /&#62;
% cast matrix to single precision&#60;br /&#62;
eval(['ball_1 = ' MATRIX_DATA_TYPE_MATLAB '(ball_1);']);&#60;br /&#62;
% save the input signal&#60;br /&#62;
writeMatrix([filename], ball_1, 'ball_1');&#60;br /&#62;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;br /&#62;
% define a sensor mask through the central plane&#60;br /&#62;
sensor_mask = false(Nx, Ny, Nz);&#60;br /&#62;
sensor_mask(:, :, Nz/2) = 1;&#60;/p&#62;
&#60;p&#62;% extract the indices of the active sensor mask elements&#60;br /&#62;
sensor_mask_index = find(sensor_mask);&#60;br /&#62;
sensor_mask_index = reshape(sensor_mask_index, [], 1);&#60;/p&#62;
&#60;p&#62;% make sure the input is in the correct data format&#60;br /&#62;
eval(['sensor_mask_index = ' INTEGER_DATA_TYPE_MATLAB '(sensor_mask_index);']);&#60;br /&#62;
sensor.mask=sensor_mask;&#60;br /&#62;
% save the sensor mask&#60;br /&#62;
writeMatrix([filename], sensor_mask_index, 'sensor_mask_index');&#60;br /&#62;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;br /&#62;
% write grid parameters&#60;br /&#62;
writeGrid([filename], [Nx, Ny, Nz], [dx, dy, dz], ...&#60;br /&#62;
    [10, 10, 10], [10, 10,10], ...&#60;br /&#62;
    Nt, dt, 1500);&#60;/p&#62;
&#60;p&#62;% write flags&#60;br /&#62;
writeFlags([filename]);&#60;/p&#62;
&#60;p&#62;% set additional file attributes&#60;br /&#62;
writeAttributes([filename]);&#60;/p&#62;
&#60;p&#62;kspaceFirstOrder3D(kgrid, medium, source, sensor, 'SaveToDisk', filename);&#60;br /&#62;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;/p&#62;
&#60;p&#62;here i am able to make .h5 file but while compiling the .h5 file with kspaceFirstOrder-OMP&#60;/p&#62;
&#60;p&#62;i got ----&#60;/p&#62;
&#60;p&#62;+---------------------------------------------------------------+&#60;br /&#62;
&#124;                   kspaceFirstOrder-OMP v1.3                   &#124;&#60;br /&#62;
+---------------------------------------------------------------+&#60;br /&#62;
&#124; Reading simulation configuration:                      Failed &#124;&#60;br /&#62;
+---------------------------------------------------------------+&#60;br /&#62;
+---------------------------------------------------------------+&#60;br /&#62;
&#124;            !!! K-Wave experienced a fatal error !!!           &#124;&#60;br /&#62;
+---------------------------------------------------------------+&#60;br /&#62;
&#124; Error: Invalid format of the input file: iostream stream      &#124;&#60;br /&#62;
&#124;        error                                                  &#124;&#60;br /&#62;
+---------------------------------------------------------------+&#60;br /&#62;
&#124;                      Execution terminated                     &#124;&#60;br /&#62;
+---------------------------------------------------------------+
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jiri Jaros on "`Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`"</title>
			<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error#post-6813</link>
			<pubDate>Fri, 29 Mar 2019 09:35:49 +0000</pubDate>
			<dc:creator>Jiri Jaros</dc:creator>
			<guid isPermaLink="false">6813@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi shak360,&#60;/p&#62;
&#60;p&#62;1. I will send you the codes with a readme via email.&#60;br /&#62;
2. You can see a detail log using a parameter --verbose 2&#60;br /&#62;
3. The execution time is inversely proportional to the number of cores. Typically, when you double the number of cores, you decrease the simulation time by a factor of 1.6. But keep in mind, the highest number of cores used is limited by Nz and Ny (precisely by the highest common denominator). With 1024 cores you can get down to 2 days.&#60;/p&#62;
&#60;p&#62;Best&#60;br /&#62;
Jiri
&#60;/p&#62;</description>
		</item>
		<item>
			<title>shak360 on "`Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`"</title>
			<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error#post-6808</link>
			<pubDate>Thu, 28 Mar 2019 17:47:09 +0000</pubDate>
			<dc:creator>shak360</dc:creator>
			<guid isPermaLink="false">6808@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;(The above post should say 690 kHz not 690  Hz.)&#60;/p&#62;
&#60;p&#62;Sorry, but I just wanted to add this briefly:&#60;/p&#62;
&#60;p&#62;In this paper: &#60;a href=&#34;https://asa.scitation.org/doi/pdf/10.1121/1.4976339?class=pdf&#34; rel=&#34;nofollow&#34;&#62;https://asa.scitation.org/doi/pdf/10.1121/1.4976339?class=pdf&#60;/a&#62;, the following specs were used for &#34;3D simulations [on head models at 500 kHz]:&#60;br /&#62;
 - on the IT4I Salomon supercomputing cluster.&#60;br /&#62;
 - Each simulation was carried out on Intel Xeon E5-4627v2, 3.3 GHz, 8 cores and&#60;br /&#62;
 - 256 GB of RAM per simulation. &#60;/p&#62;
&#60;p&#62;The largest 3D simulations had a domain size of 1024^3 including the PML and comprised 22,718 time steps, with a total runtime of 112.3 hours (or ~5 days).&#34; &#60;/p&#62;
&#60;p&#62;This is similar to what I'm trying to do. Granted this was most likely the longest simulation you had to test, how feasible was it when you tried to simulate this? I'm just concerned because, what would you do in the scenario where you wanted to change one aspect of the simulation (such as the placement or the orientation of the transducer, or some simulation parameters), but you would have to wait ~5 days to reconfigure?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>shak360 on "`Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`"</title>
			<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error#post-6807</link>
			<pubDate>Thu, 28 Mar 2019 17:08:47 +0000</pubDate>
			<dc:creator>shak360</dc:creator>
			<guid isPermaLink="false">6807@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Dr. Jaros,&#60;/p&#62;
&#60;p&#62;Thanks for the quick reply. I see, so even storing the entire field can lead to issues with memory (I'm assuming the other 30 matrices are similar to the ones like &#60;code&#62;medium.density&#60;/code&#62; and &#60;code&#62;medium.sound_speed&#60;/code&#62;, which are why they would have to be the same size as the grid). I need the high resolution spatial grid, however, to sample my transducer frequency of 690 Hz accordingly. The smallest amount of time I want to run the simulation for is 5e-4 seconds, which is still relatively long. I'd appreciate if you send me the distributed simulation code because I do have access to a cluster, but I'm seeing now that I'll have to approach this problem differently.&#60;/p&#62;
&#60;p&#62;I'm trying to simulate ultrasound on head-models from CT scans, and low-resolution, short time-scale simulations are possible in 2D, but I want to be able to do more. I'm still relatively new to simulation and ultrasound in general but k-Wave has helped me a lot; do you have any advice on how to move forward? &#60;/p&#62;
&#60;p&#62;Also, where I can find the whole simulation log?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jiri Jaros on "`Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`"</title>
			<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error#post-6769</link>
			<pubDate>Fri, 15 Mar 2019 13:55:57 +0000</pubDate>
			<dc:creator>Jiri Jaros</dc:creator>
			<guid isPermaLink="false">6769@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi shak360,&#60;br /&#62;
Could you please send me the whole simulation log and what machine specs. &#60;/p&#62;
&#60;p&#62;This simple calculation indicates it is a memory problem.&#60;br /&#62;
If the simulation is absorbing, nonlinear and heterogeneous, you need about 30 matrices of the grid size. In this case 1024*1024*512 points x 4B = 60GB of memory. There's no GPU on the market able to running this simulation and a sever with 64GB of RAM could go into troubles with swapping. &#60;/p&#62;
&#60;p&#62;Storing the whole field rises up another problem - One time step of pressure consumes 2GB. Sampling even 512 time steps takes 1TB of data - opening this dataset in matlab at once is virtually impossible.&#60;/p&#62;
&#60;p&#62;There's not much we can do about it. I'd definitely reduce the area you're sampling as well as the number of time steps.&#60;/p&#62;
&#60;p&#62;If you had access to a distributed cluster/supercomputer, we could send you a prototype of the distributed simulation code. But keep in mind, at least 256 CPU cores would be necessary and the simulation output can easily become intractable.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>shak360 on "`Fatal error: Could not write into &#34;&#34; dataset.: iostream stream error`"</title>
			<link>http://www.k-wave.org/forum/topic/fatal-error-could-not-write-into-dataset-iostream-stream-error#post-6766</link>
			<pubDate>Fri, 08 Mar 2019 22:17:42 +0000</pubDate>
			<dc:creator>shak360</dc:creator>
			<guid isPermaLink="false">6766@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I'm trying to use the C++ 3D simulations after running into some memory errors using the MATLAB version. I received the error:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;Fatal error: Could not write into &#38;quot;&#38;quot; dataset.: iostream stream error&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;I'm pretty sure I have everything set up right, though... Is this a memory issue? I'm asking it to sense the entire field:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;sensor.mask = [1, 1, 1, Nx, Ny, Nz].&#38;#39;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Is this not a good way of going about that? I've spent a lot of time with k-Wave so intuitively I think some options would be to reduce that &#60;code&#62;sensor.mask&#60;/code&#62; to some volume (or maybe even 2D area) around the focus and only record a certain portion of time at steady-state. Is this correct? Would this help with any memory issues? Is it reasonable to measure one or two periods before the end of the simulation as input to &#60;code&#62;sensor.record_start_index&#60;/code&#62;? I have a GPU and I managed to get both the CUDA (MATLAB) and CUDA (C++) modules that you have supplied also working, but I'm running into GPU memory issues there as well. I don't think I can make any more changes to the grid size or the domain dimensions (1024 x 1024 x 512) (0.243 mm x 0.243 mm x 0.25 mm) as I want to be able to support a frequency of 690kHz.&#60;/p&#62;
&#60;p&#62;Thank you in advance for the help. k-Wave is an excellent tool.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
