-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#582: Implement a compositional model of object load prediction
- Loading branch information
1 parent
60d68e4
commit 63cae4f
Showing
12 changed files
with
504 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
//@HEADER | ||
// ***************************************************************************** | ||
// | ||
// comm_overhead.cc | ||
// DARMA Toolkit v. 1.0.0 | ||
// DARMA/vt => Virtual Transport | ||
// | ||
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. | ||
// Government retains certain rights in this software. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, | ||
// this list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// * Neither the name of the copyright holder nor the names of its | ||
// contributors may be used to endorse or promote products derived from this | ||
// software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
// POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// Questions? Contact darma@sandia.gov | ||
// | ||
// ***************************************************************************** | ||
//@HEADER | ||
*/ | ||
|
||
|
||
#include "vt/vrt/collection/balance/model/comm_overhead.h" | ||
|
||
namespace vt { namespace vrt { namespace collection { namespace balance { | ||
|
||
CommOverhead::CommOverhead(balance::LoadModel *base) | ||
: ComposedModel(base) | ||
{ | ||
} | ||
|
||
void CommOverhead::setLoads(std::vector<LoadMapType> const* proc_load, | ||
std::vector<SubphaseLoadMapType> const* proc_subphase_load, | ||
std::vector<CommMapType> const* proc_comm) { | ||
proc_comm_ = proc_comm; | ||
ComposedModel::setLoads(proc_load, proc_subphase_load, proc_comm); | ||
} | ||
|
||
TimeType CommOverhead::getWork(ElementIDType object, PhaseOffset offset) | ||
{ | ||
auto work = ComposedModel::getWork(object, offset); | ||
|
||
vtAbort("Not fully implemented yet"); | ||
#if 0 | ||
// Add a bit of overhead for each off-node received message per object | ||
for (auto &&comm : *comms_) { | ||
auto obj = loads_.find(comm.first.toObj()); | ||
if (obj != loads_.end()) | ||
work += 0.001 * comm.second.messages; | ||
} | ||
#endif | ||
|
||
return work; | ||
} | ||
|
||
|
||
}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
//@HEADER | ||
// ***************************************************************************** | ||
// | ||
// comm_overhead.h | ||
// DARMA Toolkit v. 1.0.0 | ||
// DARMA/vt => Virtual Transport | ||
// | ||
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. | ||
// Government retains certain rights in this software. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, | ||
// this list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// * Neither the name of the copyright holder nor the names of its | ||
// contributors may be used to endorse or promote products derived from this | ||
// software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
// POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// Questions? Contact darma@sandia.gov | ||
// | ||
// ***************************************************************************** | ||
//@HEADER | ||
*/ | ||
|
||
#if !defined INCLUDED_VRT_COLLECTION_BALANCE_COMM_OVERHEAD_H | ||
#define INCLUDED_VRT_COLLECTION_BALANCE_COMM_OVERHEAD_H | ||
|
||
#include "vt/vrt/collection/balance/model/composed_model.h" | ||
#include <unordered_map> | ||
|
||
namespace vt { namespace vrt { namespace collection { namespace balance { | ||
|
||
struct CommOverhead : public ComposedModel { | ||
CommOverhead(balance::LoadModel *base); | ||
void setLoads(std::vector<LoadMapType> const* proc_load, | ||
std::vector<SubphaseLoadMapType> const* proc_subphase_load, | ||
std::vector<CommMapType> const* proc_comm) override; | ||
TimeType getWork(ElementIDType object, PhaseOffset when) override; | ||
|
||
std::vector<CommMapType> const* proc_comm_; | ||
}; // class CommOverhead | ||
|
||
}}}} // end namespace | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
//@HEADER | ||
// ***************************************************************************** | ||
// | ||
// composed_model.cc | ||
// DARMA Toolkit v. 1.0.0 | ||
// DARMA/vt => Virtual Transport | ||
// | ||
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. | ||
// Government retains certain rights in this software. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, | ||
// this list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// * Neither the name of the copyright holder nor the names of its | ||
// contributors may be used to endorse or promote products derived from this | ||
// software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
// POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// Questions? Contact darma@sandia.gov | ||
// | ||
// ***************************************************************************** | ||
//@HEADER | ||
*/ | ||
|
||
#include "vt/vrt/collection/balance/model/composed_model.h" | ||
|
||
namespace vt { namespace vrt { namespace collection { namespace balance { | ||
|
||
void ComposedModel::setLoads(std::vector<LoadMapType> const* proc_load, | ||
std::vector<SubphaseLoadMapType> const* proc_subphase_load, | ||
std::vector<CommMapType> const* proc_comm) { | ||
base_.setLoads(proc_load, proc_subphase_load, proc_comm); | ||
} | ||
|
||
void ComposedModel::updateLoads(PhaseType last_completed_phase) { | ||
base_.updateLoads(last_completed_phase); | ||
} | ||
|
||
TimeType ComposedModel::getWork(ElementIDType object, PhaseOffset when) { | ||
return base_.getWork(object, when); | ||
} | ||
|
||
ObjectIterator ComposedModel::begin() { | ||
return base_.begin(); | ||
} | ||
|
||
ObjectIterator ComposedModel::end() { | ||
return base_.end(); | ||
} | ||
|
||
int ComposedModel::getNumObjects() { | ||
return base_.getNumObjects(); | ||
} | ||
|
||
}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
//@HEADER | ||
// ***************************************************************************** | ||
// | ||
// composed_model.h | ||
// DARMA Toolkit v. 1.0.0 | ||
// DARMA/vt => Virtual Transport | ||
// | ||
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC | ||
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. | ||
// Government retains certain rights in this software. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, | ||
// this list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// * Neither the name of the copyright holder nor the names of its | ||
// contributors may be used to endorse or promote products derived from this | ||
// software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
// POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
// Questions? Contact darma@sandia.gov | ||
// | ||
// ***************************************************************************** | ||
//@HEADER | ||
*/ | ||
|
||
#if !defined INCLUDED_VRT_COLLECTION_BALANCE_COMPOSED_MODEL_H | ||
#define INCLUDED_VRT_COLLECTION_BALANCE_COMPOSED_MODEL_H | ||
|
||
#include "vt/config.h" | ||
#include "vt/vrt/collection/balance/model/load_model.h" | ||
|
||
namespace vt { namespace vrt { namespace collection { namespace balance { | ||
|
||
class ComposedModel : public LoadModel | ||
{ | ||
public: | ||
// \param[in] base must not be null | ||
ComposedModel(LoadModel *base) : base_(*base) {} | ||
|
||
void setLoads(std::vector<LoadMapType> const* proc_load, | ||
std::vector<SubphaseLoadMapType> const* proc_subphase_load, | ||
std::vector<CommMapType> const* proc_comm) override; | ||
|
||
void updateLoads(PhaseType last_completed_phase) override; | ||
|
||
TimeType getWork(ElementIDType object, PhaseOffset when) override; | ||
|
||
ObjectIterator begin() override; | ||
ObjectIterator end() override; | ||
|
||
int getNumObjects() override; | ||
|
||
private: | ||
LoadModel &base_; | ||
}; // class ComposedModel | ||
|
||
}}}} // namespaces | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.