Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes with PCU #433

Open
wants to merge 147 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
feafdec
Add state to PCU mpi interface.
jacobmerson Mar 28, 2023
7c390ee
Compile on gcc+fix bug
jacobmerson Mar 28, 2023
a4bbbfb
remove virtual function table for pcu_mpi
jacobmerson Mar 29, 2023
baf9370
Put PCU state data into a structure
jacobmerson Mar 29, 2023
4c243cb
Use consistent initialization functions for MPI.
jacobmerson Mar 29, 2023
d891d2b
Add PCU2 interface that takes the PCU state struct
jacobmerson Mar 29, 2023
de2f57d
add PCU2.h to install files
jacobmerson Mar 29, 2023
6a46101
fix compiler warnings
jacobmerson Mar 29, 2023
ed28c05
constify mpi functions
jacobmerson Mar 30, 2023
2eada4e
first pass of PCU with making use of a high level object
jacobmerson Mar 30, 2023
eed5a0c
remove unused functions
jacobmerson Mar 30, 2023
f0b3a28
Fix gcc compilation
jacobmerson Mar 30, 2023
0e7362f
fix bug
jacobmerson Mar 31, 2023
0e0c80e
remove unnecessary whitespace
jacobmerson Mar 31, 2023
07ab364
bump version
jacobmerson Mar 31, 2023
80c829d
Add state to PCU mpi interface.
jacobmerson Mar 28, 2023
2f6238c
Compile on gcc+fix bug
jacobmerson Mar 28, 2023
a5be7ae
remove virtual function table for pcu_mpi
jacobmerson Mar 29, 2023
064ea13
Put PCU state data into a structure
jacobmerson Mar 29, 2023
e727d54
Use consistent initialization functions for MPI.
jacobmerson Mar 29, 2023
47bf6d5
Add PCU2 interface that takes the PCU state struct
jacobmerson Mar 29, 2023
ef021f6
add PCU2.h to install files
jacobmerson Mar 29, 2023
270d44e
fix compiler warnings
jacobmerson Mar 29, 2023
62bfb69
constify mpi functions
jacobmerson Mar 30, 2023
173c7ec
first pass of PCU with making use of a high level object
jacobmerson Mar 30, 2023
23c7cef
remove unused functions
jacobmerson Mar 30, 2023
438a73e
Fix gcc compilation
jacobmerson Mar 30, 2023
4fa6e37
fix bug
jacobmerson Mar 31, 2023
716133e
remove unnecessary whitespace
jacobmerson Mar 31, 2023
4d281e0
bump version
jacobmerson Mar 31, 2023
625b02b
Merge pull request #1 from flagdanger/pcu-object
jacobmerson Jan 11, 2024
412addc
added pcu_ as a variable of Mesh
flagdanger Jan 11, 2024
63bf279
Added getPCU(), and beginning to change pcu functions
flagdanger Jan 11, 2024
b364118
Can access global_pcu and some editing of function calls in /apf
flagdanger Jan 16, 2024
1010eb1
Changed functions in more files up to folder ma
flagdanger Jan 16, 2024
041b6f0
More PCU changes
flagdanger Jan 17, 2024
435172e
More fixing
flagdanger Jan 23, 2024
3f40db9
ph and pumi changes
flagdanger Jan 24, 2024
b1e41ff
more cleaning
flagdanger Jan 25, 2024
a2cb48f
test folder fixes
flagdanger Jan 25, 2024
da4383d
More test folder fixes
flagdanger Jan 25, 2024
3c7b447
fixed last of test folder and made PCU2 .h and .cc
flagdanger Jan 26, 2024
2ec87e3
Re-checked apf and pcu2 fix
flagdanger Jan 30, 2024
3101beb
re-checking up to ma
flagdanger Jan 30, 2024
ee1d7e4
ma folder redo
flagdanger Jan 30, 2024
f13132e
more fixes
flagdanger Feb 5, 2024
33a6621
Making new versions of functions to handle PCUHandle
flagdanger Feb 5, 2024
8c5633a
phCook changes, changed phInput openfile_read to take PCUHandle, and …
flagdanger Feb 7, 2024
eaeaa3d
Reverting phasta changes
flagdanger Feb 8, 2024
244a6d5
mds folder changed to use PCU2
flagdanger Feb 9, 2024
5206e77
Last mds fixes (apfMDS.cc still has some issues)
flagdanger Feb 12, 2024
8e2cdb0
Getting rid of include PCU.h in spots I missed
flagdanger Feb 12, 2024
221a982
All parma changes I can do (lots of files need some workaround)
flagdanger Feb 12, 2024
344e3c4
small pcu change
flagdanger Feb 12, 2024
5ee39e5
pcu_getglobal changes
flagdanger Feb 12, 2024
cb971df
apfCap fix
flagdanger Feb 12, 2024
2bb8171
crv fixes
flagdanger Feb 12, 2024
23bf889
dsp pcu fix
flagdanger Feb 12, 2024
60e0b6f
gmi cap and sim pcu fixes
flagdanger Feb 12, 2024
63af137
ma pcu fixes
flagdanger Feb 12, 2024
98e9d71
changing apfMDS.cc back to original, still needs work
flagdanger Feb 12, 2024
6f49fb2
pumi pcu fixes
flagdanger Feb 12, 2024
14d2e5e
spr pcu fix
flagdanger Feb 12, 2024
5f17c05
stk pcu fixes
flagdanger Feb 12, 2024
bc1ce6a
changing repartition.cc back to original, still needs work
flagdanger Feb 12, 2024
59d5a7f
zoltan pcu fixes
flagdanger Feb 14, 2024
98341a3
pumi interface fixes, replacing old PCU uses
flagdanger Mar 11, 2024
a0c53fc
files in test folder changed to use new pumi - pcu interface
flagdanger Mar 11, 2024
32ab95b
made default PCU arguments for Mesh functions and fixed old pcu issue…
flagdanger Mar 12, 2024
530a82e
repartition test file rebuilt to use new pcu
flagdanger Mar 12, 2024
fda3f51
apf folder using new pcu except apfNumbering.cc
flagdanger Mar 14, 2024
bdce405
ma folder changed to use new pcu, changed some uses of print() in crv…
flagdanger Mar 15, 2024
9075f4b
ma folder using new pcu, all tests passing
flagdanger Mar 18, 2024
efc2d77
changed phastaio_initStats to not check if PCU is intitialized. Also …
flagdanger Mar 20, 2024
d424963
Phasta folder changed to use new PCU, passes tests.
flagdanger Mar 25, 2024
9005de8
small touchups in test files, apfMDS.cc, and apf_sim
flagdanger Mar 25, 2024
6bb2806
Parma folder fixes, only thing not changed is parma_group.cc, all tes…
flagdanger Mar 25, 2024
6cbd11d
added switchPCU to apfMesh to use in parma_group.cc
flagdanger Mar 27, 2024
000418e
parma_group.cc fixed to use switchPCU, may need to change later
flagdanger Mar 28, 2024
bd265d8
parallelReduce function fix
flagdanger Mar 28, 2024
7f83066
crv corrected makeEmptyMdsMesh use
flagdanger Apr 1, 2024
8469c37
ma corrected makeEmptyMdsMesh use
flagdanger Apr 1, 2024
2b90da5
fixed BoxBuilder class and loadMdsFromANSYS to take an optional PCUObj
flagdanger Apr 1, 2024
961f09a
got rid of undef PCU_FORMAT_ATTRIBUTE, fixed compilation errors that …
flagdanger Apr 1, 2024
daed911
phasta - fixed createMdsMesh use
flagdanger Apr 1, 2024
946ba7c
got rid of an #include PCU.h
flagdanger Apr 1, 2024
8c28b15
#include PCU.h deletion
flagdanger Apr 1, 2024
7a99da1
spr folder fixes
flagdanger Apr 1, 2024
99ad2db
1d test file
flagdanger Apr 1, 2024
77cb68f
align test file
flagdanger Apr 1, 2024
1dc3a94
aniso_ma_test file
flagdanger Apr 1, 2024
becd83a
ansys test file
flagdanger Apr 1, 2024
e591d9a
assert_timing test file
flagdanger Apr 1, 2024
dc48ea7
balance test file
flagdanger Apr 1, 2024
4624408
bezierElevation test file
flagdanger Apr 1, 2024
0a7ccec
box test file
flagdanger Apr 1, 2024
54cc6be
collapse test file
flagdanger Apr 1, 2024
f6e5d7c
poisson test file
flagdanger Apr 1, 2024
5f0ef7e
mdsCGNS PCUHandle fix
flagdanger Apr 9, 2024
6452f43
maximal independent set fixes
flagdanger Apr 9, 2024
8cb06bb
Parma_GroupCode run() function default changed to take a PCUObj
flagdanger Apr 9, 2024
f36021a
Test files fixed
flagdanger Apr 9, 2024
0db8e21
loadMdsPart take optional PCU
flagdanger Apr 17, 2024
6f4c6df
loadMdsFromGmsh to take PCU
flagdanger Apr 17, 2024
9900b46
fixed runInGroups() to work with new PCU
flagdanger Apr 17, 2024
b0a6ff2
reverted the run function in GroupCode structs to not take a PCU
flagdanger Apr 17, 2024
52c9ab8
test files fixed to use PCUObj; all pass
flagdanger Apr 17, 2024
1eebc1e
Mesh interface fixes
flagdanger Apr 26, 2024
94dcc92
Test files changed to use new PCU
flagdanger Apr 26, 2024
7dbae41
Added comments for uses of switchPCU
flagdanger Apr 29, 2024
2b03519
added back reeResidualFunctionals.cc
flagdanger Apr 29, 2024
00bf25e
Delete config.sh
flagdanger Apr 29, 2024
2f23fb1
Merge pull request #2 from flagdanger/pcu-object
jacobmerson Apr 29, 2024
03eb93d
Merge branch 'develop' into pcu-object
jacobmerson Apr 29, 2024
ea3b36e
Warning fixes
flagdanger Apr 29, 2024
b2ae31a
Merge branch 'pcu-object' of https://github.com/flagdanger/core into …
flagdanger Apr 29, 2024
d95cdcd
Merge pull request #3 from flagdanger/pcu-object
jacobmerson Apr 30, 2024
769c432
compiler errors with phLinks.cc fixed
flagdanger May 2, 2024
f96b764
.github fix
flagdanger May 6, 2024
1e3d684
describe.cc getPeak() and getChunks() removed
flagdanger May 6, 2024
e33b48d
removed last uses of old pcu, removed pcu.cc and .h, got rid of defau…
flagdanger Jun 3, 2024
0dd10d1
small fixes
flagdanger Jul 1, 2024
6e9a875
PCU2 using PCU naming, changed PCUHandle to PCU_t
flagdanger Jul 5, 2024
deba052
pumi_sys functions using pumi::instance to access PCU, added setPCU a…
flagdanger Jul 9, 2024
687e160
added pumi_load_pcu to replace the use of setPCU, removed PCUObj as a…
flagdanger Jul 9, 2024
7d57abc
apfSim typo fix
flagdanger Jul 31, 2024
e90602f
pumi_rank() replacements
flagdanger Jul 31, 2024
55f887c
simmetrix create mesh typo fixed
flagdanger Aug 6, 2024
bfde63e
Merge remote-tracking branch 'SCOREC/develop' into pcu-object-breaking
flagdanger Aug 6, 2024
a904f02
phLinks ptr issue fix
flagdanger Aug 7, 2024
77812e5
phasta convert fixes
flagdanger Aug 7, 2024
a907b7e
test files small bugs
flagdanger Aug 8, 2024
8128e2a
Revert "test files small bugs"
flagdanger Aug 8, 2024
94549c7
removed config file
flagdanger Aug 8, 2024
73c5033
PCU.h small fix
flagdanger Aug 16, 2024
90f9ff3
Delete config.sh
flagdanger Aug 16, 2024
236bffb
long dereference chains fixed
flagdanger Aug 19, 2024
7025e62
PCUObj renamed to PCU, PCU remaned to PCU_C
flagdanger Aug 19, 2024
90785ed
Specified argument data type for templated functions PCU:: Add, Max, …
flagdanger Aug 19, 2024
6faa765
Capstone updated to use PCU Object
flagdanger Aug 19, 2024
b5a2190
small fixes
flagdanger Aug 21, 2024
85be809
Typo cleaning
flagdanger Aug 26, 2024
d5b7413
Test files changed to not use unique_ptr
flagdanger Aug 26, 2024
d666a1e
Removed uses of unique_ptr in other folders besides test
flagdanger Aug 27, 2024
807746c
Removed semi colon after Macro
flagdanger Aug 29, 2024
7e4cd5a
CGNS fixes
flagdanger Sep 23, 2024
6e47c85
cgns fixes
flagdanger Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apf/apfCGNS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ void AddBocosToMainBase(const CGNS &cgns, const CellElementReturn &cellResults,
return std::make_pair(cacheStarts, cacheEnds);
};

const auto globalElementList = [](const std::vector<cgsize_t> &bcList, std::vector<cgsize_t> &allElements) {
const auto globalElementList = [&m](const std::vector<cgsize_t> &bcList, std::vector<cgsize_t> &allElements) {
std::vector<int> sizes(m->getPCU()->Peers(), 0); // important initialiser
const int l = bcList.size();
MPI_Allgather(&l, 1, MPI_INT, sizes.data(), 1,
Expand Down Expand Up @@ -1049,11 +1049,11 @@ void WriteCGNS(const char *prefix, apf::Mesh *m, const apf::CGNSBCMap &cgnsBCMap
auto communicator = m->getPCU()->GetMPIComm();
cgp_mpi_comm(communicator);
//
cgp_pio_mode(CGNS_ENUMV(CGP_INDEPENDENT));
cgp_pio_mode(CGP_INDEPENDENT);

CGNS cgns;
cgns.fname = std::string(prefix);
if (cgp_open(prefix, CGNS_ENUMV(CG_MODE_WRITE), &cgns.index))
if (cgp_open(prefix, CG_MODE_WRITE, &cgns.index))
cgp_error_exit();

{
Expand Down
10 changes: 5 additions & 5 deletions apf/apfConstruct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ static NewElements constructElements(
return newElements;
}

static Gid getMax(const GlobalToVert& globalToVert, Mesh2* m)
static Gid getMax(const GlobalToVert& globalToVert, pcu::PCU *PCUObj)
{
Gid max = -1;
APF_CONST_ITERATE(GlobalToVert, globalToVert, it)
max = std::max(max, it->first);
return m->getPCU()->Max<long>(max); // this is type-dependent
return PCUObj->Max<long>(max); // this is type-dependent
}


Expand All @@ -66,7 +66,7 @@ static void constructResidence(Mesh2* m, GlobalToVert& globalToVert)
}
ifirst++;
}
Gid max = getMax(globalToVert, m); // seems like we read this and know it already on every rank so why compute with global comm?
Gid max = getMax(globalToVert, m->getPCU()); // seems like we read this and know it already on every rank so why compute with global comm?
ifirst=0;
APF_ITERATE(GlobalToVert, globalToVert, it) {
Gid gid = it->first;
Expand Down Expand Up @@ -212,7 +212,7 @@ NewElements construct(Mesh2* m, const Gid* conn, int nelem, int etype,
void setCoords(Mesh2* m, const double* coords, int nverts,
GlobalToVert& globalToVert)
{
Gid max = getMax(globalToVert, m);
Gid max = getMax(globalToVert, m->getPCU());
Gid total = max + 1;
int peers = m->getPCU()->Peers();
int quotient = total / peers;
Expand Down Expand Up @@ -303,7 +303,7 @@ void setCoords(Mesh2* m, const double* coords, int nverts,
void setMatches(Mesh2* m, const Gid* matches, int nverts,
GlobalToVert& globalToVert)
{
Gid max = getMax(globalToVert, m);
Gid max = getMax(globalToVert, m->getPCU());
Gid total = max + 1;
int peers = m->getPCU()->Peers();
int quotient = total / peers;
Expand Down
2 changes: 1 addition & 1 deletion apf/apfMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class Mesh
GlobalNumbering* findGlobalNumbering(const char* name);

GlobalNumbering* getGlobalNumbering(int i);
/** \brief get the global pcu */
/** \brief get the mesh pcu */
pcu::PCU* getPCU() const {return pcu_;}
void switchPCU(pcu::PCU *newPCU);
/** \brief true if any associated fields use array storage */
Expand Down
7 changes: 3 additions & 4 deletions capstone_clis/capStone2VTK.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <iomanip>
#include <vector>
#include <math.h>
#include <memory>


#include "CapstoneModule.h"
Expand All @@ -43,10 +42,10 @@ int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);

if (argc != 3) {
if(0==PCUObj.get()->Self())
if(0==PCUObj.Self())
std::cerr << "usage: " << argv[0]
<< " <cre file .cre> <output folder name>\n";
return EXIT_FAILURE;
Expand Down Expand Up @@ -133,7 +132,7 @@ int main(int argc, char** argv)
gmi_register_cap();

// convert the mesh to apf/mds mesh
apf::Mesh2* mesh = apf::createMesh(m,g,PCUObj.get());
apf::Mesh2* mesh = apf::createMesh(m,g,&PCUObj);

apf::writeVtkFiles(folderName, mesh);

Expand Down
7 changes: 3 additions & 4 deletions capstone_clis/capStoneAnalyzeArea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <iomanip>
#include <vector>
#include <math.h>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -50,12 +49,12 @@ int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);
lion_set_verbosity(1);
double initialTime = pcu::Time();

if (argc != 3) {
if(0==PCUObj.get()->Self())
if(0==PCUObj.Self())
std::cerr << "usage: " << argv[0]
<< " <cre file .cre> <factor>\n";
return EXIT_FAILURE;
Expand Down Expand Up @@ -145,7 +144,7 @@ int main(int argc, char** argv)

// create the mesh object (this one is CapStone underneath)
printf("\n---- Creating Mesh Wrapper Object. \n");
apf::Mesh2* mesh = apf::createMesh(m,g,PCUObj.get());
apf::Mesh2* mesh = apf::createMesh(m,g,&PCUObj);
printf("---- Creating Mesh Wrapper Object: Done. \n");

// add size distribution based on area
Expand Down
7 changes: 3 additions & 4 deletions capstone_clis/capStoneAnalyzeEdgeLengths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <iomanip>
#include <vector>
#include <math.h>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -51,12 +50,12 @@ int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);
lion_set_verbosity(1);
double initialTime = pcu::Time();

if (argc != 3) {
if(0==PCUObj.get()->Self())
if(0==PCUObj.Self())
std::cerr << "usage: " << argv[0]
<< " <cre file .cre> <factor>\n";
return EXIT_FAILURE;
Expand Down Expand Up @@ -146,7 +145,7 @@ int main(int argc, char** argv)

// create the mesh object (this one is CapStone underneath)
printf("\n---- Creating Mesh Wrapper Object. \n");
apf::Mesh2* mesh = apf::createMesh(m,g,PCUObj.get());
apf::Mesh2* mesh = apf::createMesh(m,g,&PCUObj);
printf("---- Creating Mesh Wrapper Object: Done. \n");

// add size distribution based on area
Expand Down
7 changes: 3 additions & 4 deletions capstone_clis/capStoneAnisoAdapt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -51,10 +50,10 @@ int main(int argc, char** argv)
/* INIT CALLS */
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);

if (argc < 3) {
if (PCUObj.get()->Self() == 0) {
if (PCUObj.Self() == 0) {
printf("USAGE: %s <create_file.cre> <size-field>\n", argv[0]);
printf("Size-fields:\n");
printf("%d, for uniform anisotropic size-field\n", 1);
Expand Down Expand Up @@ -112,7 +111,7 @@ int main(int argc, char** argv)
MG_API_CALL(m, compute_adjacency());

/* CONVERT THE MESH TO APF::MESH2 */
apf::Mesh2* apfCapMesh = apf::createMesh(m, g, PCUObj.get());
apf::Mesh2* apfCapMesh = apf::createMesh(m, g, &PCUObj);

/* ADD A TEST FIELD TO THE MESH TO DEMONSTRATE SOLUTION TRANSFER */
apf::Field* tf = apf::createFieldOn(apfCapMesh, "test_field", apf::VECTOR);
Expand Down
5 changes: 2 additions & 3 deletions capstone_clis/capStoneAnisoAdaptWing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -98,7 +97,7 @@ int main(int argc, char** argv)
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the other examples the unique_ptr was removed, I assume that can be done here too?


if (argc < 2) {
if (PCUObj.get()->Self() == 0) {
if (PCUObj.Self() == 0) {
printf("USAGE: %s <create_file.cre>\n", argv[0]);
}
MPI_Finalize();
Expand Down Expand Up @@ -151,7 +150,7 @@ int main(int argc, char** argv)
MG_API_CALL(m, compute_adjacency());

/* CONVERT THE MESH TO APF::MESH2 */
apf::Mesh2* apfCapMesh = apf::createMesh(m, g, PCUObj.get());
apf::Mesh2* apfCapMesh = apf::createMesh(m, g, &PCUObj);

/* ADD A TEST FIELD TO THE MESH TO DEMONSTRATE SOLUTION TRANSFER */
apf::Field* tf = apf::createFieldOn(apfCapMesh, "test_field", apf::VECTOR);
Expand Down
7 changes: 3 additions & 4 deletions capstone_clis/capStoneAttachSolution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <iomanip>
#include <vector>
#include <math.h>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -600,12 +599,12 @@ int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);
lion_set_verbosity(1);
double initialTime = pcu::Time();

if (argc != 9) {
if(0==PCUObj.get()->Self()) {
if(0==PCUObj.Self()) {
std::cerr << "usage: " << argv[0]
<< " <cre file .cre> <data file .txt> <target field(s)> <strand size> <desired max size> <error reduction factor> <max refinement level> <boundary layer thickness>\n";
std::cerr << "*target field(s) is a bit string to select which field(s) are used for error estimation\n";
Expand Down Expand Up @@ -713,7 +712,7 @@ int main(int argc, char** argv)

// create the mesh object (this one is CapStone underneath)
printf("\n---- Creating Mesh Wrapper Object. \n");
apf::Mesh2* mesh = apf::createMesh(m,g,PCUObj.get());
apf::Mesh2* mesh = apf::createMesh(m,g,&PCUObj);
printf("---- Creating Mesh Wrapper Object: Done. \n");

// make the volume mesh (this one is MDS underneath)
Expand Down
5 changes: 2 additions & 3 deletions capstone_clis/capStoneAttachSolution2.cc
cwsmith marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <iostream>
#include <iomanip>
#include <vector>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -500,7 +499,7 @@ int main(int argc, char** argv)
double initialTime = pcu::Time();

if (argc != 7) {
if(0==PCUObj.get()->Self())
if(0==PCUObj.Self())
std::cerr << "usage: " << argv[0]
<< " <cre file .cre> <data file .txt> <data offset> <strand size> <desired max size> <error reduction factor>\n";
return EXIT_FAILURE;
Expand Down Expand Up @@ -599,7 +598,7 @@ int main(int argc, char** argv)

// create the mesh object (this one is CapStone underneath)
printf("\n---- Creating Mesh Wrapper Object. \n");
apf::Mesh2* mesh = apf::createMesh(m,g,PCUObj.get());
apf::Mesh2* mesh = apf::createMesh(m,g,&PCUObj);
printf("---- Creating Mesh Wrapper Object: Done. \n");

// remove unused verts
Expand Down
7 changes: 3 additions & 4 deletions capstone_clis/capStoneAttachSolutionStrandOnly.cc
cwsmith marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <iomanip>
#include <vector>
#include <math.h>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -522,12 +521,12 @@ int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);
lion_set_verbosity(1);
double initialTime = pcu::Time();

if (argc != 7) {
if(0==PCUObj.get()->Self()) {
if(0==PCUObj.Self()) {
std::cerr << "usage: " << argv[0]
<< " <data file .txt> <target field(s)> <strand size> <desired max size> <error reduction factor> <max refinement level>\n";
std::cerr << "*target field(s) is a bit string to select which field(s) are used for error estimation\n";
Expand Down Expand Up @@ -558,7 +557,7 @@ int main(int argc, char** argv)

// create the mesh object (this one is CapStone underneath)
printf("\n---- Creating Mesh Wrapper Object. \n");
apf::Mesh2* mesh = apf::createMesh(m,g,PCUObj.get());
apf::Mesh2* mesh = apf::createMesh(m,g,&PCUObj);
printf("---- Creating Mesh Wrapper Object: Done. \n");

// make the volume mesh (this one is MDS underneath)
Expand Down
7 changes: 3 additions & 4 deletions capstone_clis/capStoneAttachSolutionUni.cc
cwsmith marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <iomanip>
#include <vector>
#include <math.h>
#include <memory>


#include "CapstoneModule.h"
Expand Down Expand Up @@ -499,12 +498,12 @@ int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);
lion_set_verbosity(1);
double initialTime = pcu::Time();

if (argc != 7) {
if(0==PCUObj.get()->Self())
if(0==PCUObj.Self())
std::cerr << "usage: " << argv[0]
<< " <cre file .cre> <data file .txt> <data offset> <strand size> <desired max size> <error reduction factor>\n";
return EXIT_FAILURE;
Expand Down Expand Up @@ -596,7 +595,7 @@ int main(int argc, char** argv)

printf("---- CapStone Mesh Loaded. \n");

apf::Mesh2* mesh = apf::createMesh(m,g,PCUObj.get());
apf::Mesh2* mesh = apf::createMesh(m,g,&PCUObj);

//adapt the mesh
ma::Input* in;
Expand Down
5 changes: 2 additions & 3 deletions capstone_clis/capStoneCheckParametrization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <iostream>
#include <iomanip>
#include <vector>
#include <memory>


#include "CapstoneModule.h"
Expand All @@ -30,10 +29,10 @@ int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
{
auto PCUObj = std::unique_ptr<pcu::PCU>(new pcu::PCU(MPI_COMM_WORLD));
pcu::PCU PCUObj = pcu::PCU(MPI_COMM_WORLD);

if (argc != 2) {
if(0==PCUObj.get()->Self())
if(0==PCUObj.Self())
std::cerr << "usage: " << argv[0]
<< " <cre file .cre>\n";
return EXIT_FAILURE;
Expand Down
3 changes: 1 addition & 2 deletions capstone_clis/capStoneCurve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <cstring>
#include <iostream>
#include <lionPrint.h>
#include <memory>

// === includes for safe_mkdir ===
#include <reel.h>
Expand Down Expand Up @@ -162,7 +161,7 @@ int main(int argc, char** argv)
MG_API_CALL(m, compute_adjacency());

/* writeVtk(cs, "before.vtk"); */
apf::Mesh2* apfCapMesh = apf::createMesh(m, g, PCUObj.get());
apf::Mesh2* apfCapMesh = apf::createMesh(m, g, &PCUObj);

apf::Field* tf = apf::createFieldOn(apfCapMesh, "test_field", apf::VECTOR);
apf::MeshEntity* ent;
Expand Down
Loading