@@ -34,7 +34,7 @@ namespace lue {
3434 // Open value. Configure for use of parallel I/O if necessary.
3535 hdf5::Dataset::TransferPropertyList transfer_property_list{};
3636
37- #if LUE_FRAMEWORK_WITH_PARALLEL_IO
37+ #ifdef LUE_FRAMEWORK_WITH_PARALLEL_IO
3838 transfer_property_list.set_transfer_mode (H5FD_MPIO_INDEPENDENT);
3939#endif
4040
@@ -65,11 +65,11 @@ namespace lue {
6565 // TODO: How to make all I/O happen on the I/O thread? Passing executor to continuation works in
6666 // parallel I/O case but serial case hangs. Currently, the nested I/O ends up on the compute
6767 // thread it seems.
68- hpx::execution::experimental::io_pool_executor executor;
68+ // hpx::execution::experimental::io_pool_executor executor;
6969
7070 return hpx::when_any (partitions)
7171 .then (
72- executor,
72+ // executor,
7373 [ // executor,
7474 policies,
7575 array_hyperslab_start,
@@ -118,6 +118,22 @@ namespace lue {
118118 std::remove_reference_t <std::remove_cv_t <decltype ((create_hyperslab))>>,
119119 std::remove_reference_t <std::remove_cv_t <decltype ((property))>>>;
120120
121+ // std::vector<hpx::future<void>> partitions_written{};
122+ // partitions_written.reserve(partitions.size());
123+ // partitions_written.emplace_back(
124+ // hpx::async(
125+ // // executor,
126+ // write_partition,
127+ // std::ref(policies),
128+ // std::ref(partitions[partition_idx]),
129+ // create_hyperslab,
130+ // object_id,
131+ // std::ref(property)));
132+
133+ #ifndef HDF5_IS_THREADSAFE
134+ #else
135+ #endif
136+
121137 hpx::async (
122138 // executor,
123139 write_partition,
@@ -154,10 +170,13 @@ namespace lue {
154170
155171 partitions = std::move (partitions_);
156172 }
173+
174+ #ifndef HDF5_IS_THREADSAFE
175+ #else
176+ #endif
157177 });
158178 }
159179
160-
161180 template <typename Policies, typename Partitions>
162181 auto write_partitions_variable (
163182 Policies const & policies,
@@ -173,11 +192,11 @@ namespace lue {
173192 // TODO: How to make all I/O happen on the I/O thread? Passing executor to continuation works in
174193 // parallel I/O case but serial case hangs. Currently, the nested I/O ends up on the compute
175194 // thread it seems.
176- hpx::execution::experimental::io_pool_executor executor;
195+ // hpx::execution::experimental::io_pool_executor executor;
177196
178197 return hpx::when_any (partitions)
179198 .then (
180- executor,
199+ // executor,
181200 [ // executor,
182201 policies,
183202 array_hyperslab_start,
@@ -332,7 +351,7 @@ namespace lue {
332351 std::vector<hpx::future<void >> localities_finished{};
333352 localities_finished.reserve (partition_idxs_by_locality.size () + 1 );
334353
335- #if ! LUE_FRAMEWORK_WITH_PARALLEL_IO
354+ #ifndef LUE_FRAMEWORK_WITH_PARALLEL_IO
336355 localities_finished.emplace_back (hpx::make_ready_future ());
337356#endif
338357
@@ -352,7 +371,7 @@ namespace lue {
352371
353372 // Spawn a task that writes the current partitions to the dataset. This returns a future which
354373 // becomes ready once the partitions have been written.
355- #if ! LUE_FRAMEWORK_WITH_PARALLEL_IO
374+ #ifndef LUE_FRAMEWORK_WITH_PARALLEL_IO
356375 hpx::future<void >& previous_locality_finished = localities_finished.back ();
357376 localities_finished.push_back (previous_locality_finished.then (
358377 [locality,
@@ -385,7 +404,7 @@ namespace lue {
385404#endif
386405 }
387406
388- #if ! LUE_FRAMEWORK_WITH_PARALLEL_IO
407+ #ifndef LUE_FRAMEWORK_WITH_PARALLEL_IO
389408 lue_hpx_assert (localities_finished.back ().valid ());
390409 return std::move (localities_finished.back ());
391410#else
@@ -444,7 +463,7 @@ namespace lue {
444463 std::vector<hpx::future<void >> localities_finished{};
445464 localities_finished.reserve (partition_idxs_by_locality.size () + 1 );
446465
447- #if ! LUE_FRAMEWORK_WITH_PARALLEL_IO
466+ #ifndef LUE_FRAMEWORK_WITH_PARALLEL_IO
448467 localities_finished.emplace_back (hpx::make_ready_future ());
449468#endif
450469
@@ -464,7 +483,7 @@ namespace lue {
464483
465484 // Spawn a task that writes the current partitions to the dataset. This returns a future which
466485 // becomes ready once the partitions have been written.
467- #if ! LUE_FRAMEWORK_WITH_PARALLEL_IO
486+ #ifndef LUE_FRAMEWORK_WITH_PARALLEL_IO
468487 hpx::future<void >& previous_locality_finished = localities_finished.back ();
469488 localities_finished.push_back (previous_locality_finished.then (
470489 [locality,
@@ -500,7 +519,7 @@ namespace lue {
500519#endif
501520 }
502521
503- #if ! LUE_FRAMEWORK_WITH_PARALLEL_IO
522+ #ifndef LUE_FRAMEWORK_WITH_PARALLEL_IO
504523 lue_hpx_assert (localities_finished.back ().valid ());
505524 return std::move (localities_finished.back ());
506525#else
0 commit comments