Skip to content

Commit

Permalink
Revert "addRanks vtkh filter"
Browse files Browse the repository at this point in the history
This reverts commit 0353a74.
  • Loading branch information
nicolemarsaglia committed Aug 2, 2024
1 parent 53ce9b1 commit a0458f4
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 294 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ register_builtin()
AscentRuntime::register_filter_type<VTKHBounds>();
AscentRuntime::register_filter_type<VTKHUnionBounds>();
// transforms, the current crop expect vtk-h input data
//AscentRuntime::register_filter_type<VTKHAddDomains>("transforms","add_domain_ids");
AscentRuntime::register_filter_type<VTKHAddRanks>("transforms","add_mpi_ranks");
AscentRuntime::register_filter_type<VTKHClip>("transforms","clip");
AscentRuntime::register_filter_type<VTKHClipWithField>("transforms","clip_with_field");
AscentRuntime::register_filter_type<VTKHCleanGrid>("transforms","clean_grid");
Expand Down
108 changes: 0 additions & 108 deletions src/libs/ascent/runtimes/flow_filters/ascent_runtime_vtkh_filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,114 +1187,6 @@ VTKHGhostStripper::execute()
}
}

//-----------------------------------------------------------------------------
VTKHAddRanks::VTKHAddRanks()
:Filter()
{
// empty
}

//-----------------------------------------------------------------------------
VTKHAddRanks::~VTKHAddRanks()
{
// empty
}

//-----------------------------------------------------------------------------
void
VTKHAddRanks::declare_interface(Node &i)
{
i["type_name"] = "vtkh_add_mpi_ranks";
i["port_names"].append() = "in";
i["output_port"] = "true";
}

//-----------------------------------------------------------------------------
bool
VTKHAddRanks::verify_params(const conduit::Node &params,
conduit::Node &info)
{
info.reset();

bool res = check_string("topology",params, info, false);
res = check_string("output",params, info, false);

std::vector<std::string> valid_paths;
valid_paths.push_back("output");
valid_paths.push_back("topology");
std::string surprises = surprise_check(valid_paths, params);

if(surprises != "")
{
res = false;
info["errors"].append() = surprises;
}

return res;
}

//-----------------------------------------------------------------------------
void
VTKHAddRanks::execute()
{

if(!input(0).check_type<DataObject>())
{
ASCENT_ERROR("VTKHAddRanks input must be a data object");
}

DataObject *data_object = input<DataObject>(0);
if(!data_object->is_valid())
{
set_output<DataObject>(data_object);
return;
}

int rank = 0;
#ifdef ASCENT_MPI_ENABLED
MPI_Comm mpi_comm = MPI_Comm_f2c(Workspace::default_mpi_comm());
MPI_Comm_rank(mpi_comm, &rank);
#endif

std::shared_ptr<VTKHCollection> collection = data_object->as_vtkh_collection();

std::string output_field = "mpi_rank";
if(params().has_child("output"))
{
output_field = params()["output"].as_string();
}

std::string topo_name = "";
if(params().has_child("topology"))
{
topo_name = params()["topology"].as_string();
}
else
{
bool throw_error = false;
topo_name = detail::resolve_topology(params(),
this->name(),
collection,
throw_error);
std::cerr << "topo_name: " << topo_name << std::endl;
if(topo_name == "")
{
// this creates a data object with an invalid source
set_output<DataObject>(new DataObject());
return;
}
}

vtkh::DataSet &data = collection->dataset_by_topology(topo_name);
VTKHCollection *new_coll = collection->copy_without_topology(topo_name);
data.AddConstantPointField(rank,output_field);
new_coll->add(data, topo_name);

// re wrap in data object
DataObject *res = new DataObject(new_coll);
set_output<DataObject>(res);
}

//-----------------------------------------------------------------------------
VTKHThreshold::VTKHThreshold()
:Filter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,34 +133,6 @@ class ASCENT_API VTKHGhostStripper: public ::flow::Filter
virtual void execute();
};

//-----------------------------------------------------------------------------
class ASCENT_API VTKHAddRanks : public ::flow::Filter
{
public:
VTKHAddRanks();
virtual ~VTKHAddRanks();

virtual void declare_interface(conduit::Node &i);
virtual bool verify_params(const conduit::Node &params,
conduit::Node &info);
virtual void execute();
};

//-----------------------------------------------------------------------------
class ASCENT_API VTKHAddDomains : public ::flow::Filter
{
public:
VTKHAddDomains();
virtual ~VTKHAddDomains();

virtual void declare_interface(conduit::Node &i);
virtual bool verify_params(const conduit::Node &params,
conduit::Node &info);
virtual void execute();
};



//-----------------------------------------------------------------------------
class ASCENT_API VTKHClip: public ::flow::Filter
{
Expand Down
Binary file not shown.
1 change: 0 additions & 1 deletion src/tests/ascent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ set(MPI_TESTS t_ascent_mpi_smoke
t_ascent_mpi_slice
t_ascent_mpi_uniform_grid
t_ascent_mpi_vtk_file_extract
t_ascent_mpi_add_ranks
t_ascent_mpi_unique_ids)

# t_ascent_hola_mpi uses 8 mpi tasks, so its added manually
Expand Down
155 changes: 0 additions & 155 deletions src/tests/ascent/t_ascent_mpi_add_ranks.cpp

This file was deleted.

0 comments on commit a0458f4

Please sign in to comment.