Skip to content
Snippets Groups Projects
Commit 1b403d28 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Remapweights: write remap weights asynchron

parent faaea229
No related branches found
No related tags found
1 merge request!144M214003/develop
Pipeline #48065 passed
......@@ -20,6 +20,7 @@
*/
#include <algorithm>
#include <thread>
#include <cdi.h>
......@@ -33,7 +34,7 @@
static void
remap_write_weights(const std::string &remapWeightsFile, const RemapSwitches &remapSwitches, RemapType &remap)
remap_write_weights(const std::string remapWeightsFile, const RemapSwitches &remapSwitches, RemapType &remap)
{
remap_write_data_scrip(remapWeightsFile, remapSwitches, remap.srcGrid, remap.tgtGrid, remap.vars);
......@@ -173,6 +174,7 @@ public:
void
run()
{
std::thread writeWorker;
Varray<short> imask;
int tsID = 0;
......@@ -291,12 +293,18 @@ public:
outFile += ".nc";
}
remap_write_weights(outFile, remapSwitches, remap);
//remap_write_weights(outFile, remapSwitches, remap);
if (numRemaps > 1) writeWorker.join();
writeWorker = std::thread(remap_write_weights, outFile, remapSwitches, std::ref(remap));
if (!remapParams.genMultiWeights) break;
}
}
writeWorker.join();
for (int remapIndex = 0; remapIndex < numRemaps; remapIndex++)
{
auto &remap = remaps[remapIndex];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment