MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / partitionModel

Function partitionModel

SRC/tcl/commands.cpp:1834–1907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1832#ifdef _PARALLEL_PROCESSING
1833
1834int
1835partitionModel(int eleTag)
1836{
1837 if (OPS_PARTITIONED == true)
1838 return 0;
1839
1840 int result = 0;
1841
1842 if (OPS_theChannels != 0)
1843 delete [] OPS_theChannels;
1844
1845 OPS_theChannels = new Channel *[OPS_NUM_SUBDOMAINS];
1846
1847 // create some subdomains
1848 for (int i=1; i<=OPS_NUM_SUBDOMAINS; i++) {
1849 if (i != OPS_MAIN_DOMAIN_PARTITION_ID) {
1850 ShadowSubdomain *theSubdomain = new ShadowSubdomain(i, *OPS_MACHINE, *OPS_OBJECT_BROKER);
1851 theDomain.addSubdomain(theSubdomain);
1852 OPS_theChannels[i-1] = theSubdomain->getChannelPtr();
1853 }
1854 }
1855
1856 // create a partitioner & partition the domain
1857 if (OPS_DOMAIN_PARTITIONER == 0) {
1858 // OPS_BALANCER = new ShedHeaviest();
1859 OPS_GRAPH_PARTITIONER = new Metis;
1860 //OPS_DOMAIN_PARTITIONER = new DomainPartitioner(*OPS_GRAPH_PARTITIONER, *OPS_BALANCER);
1861 OPS_DOMAIN_PARTITIONER = new DomainPartitioner(*OPS_GRAPH_PARTITIONER);
1862 theDomain.setPartitioner(OPS_DOMAIN_PARTITIONER);
1863 }
1864
1865 // opserr << "commands.cpp - partition numPartitions: " << OPS_NUM_SUBDOMAINS << endln;
1866
1867 result = theDomain.partition(OPS_NUM_SUBDOMAINS, OPS_USING_MAIN_DOMAIN, OPS_MAIN_DOMAIN_PARTITION_ID, eleTag);
1868
1869 if (result < 0)
1870 return result;
1871
1872 OPS_PARTITIONED = true;
1873
1874 DomainDecompositionAnalysis *theSubAnalysis;
1875 SubdomainIter &theSubdomains = theDomain.getSubdomains();
1876 Subdomain *theSub =0;
1877
1878 // create the appropriate domain decomposition analysis
1879 while ((theSub = theSubdomains()) != 0) {
1880 if (theStaticAnalysis != 0) {
1881 theSubAnalysis = new StaticDomainDecompositionAnalysis(*theSub,
1882 *theHandler,
1883 *theNumberer,
1884 *theAnalysisModel,
1885 *theAlgorithm,
1886 *theSOE,
1887 *theStaticIntegrator,
1888 theTest,
1889 false);
1890
1891 } else {

Callers 3

opsPartitionFunction · 0.70
analyzeModelFunction · 0.70
eigenAnalysisFunction · 0.70

Calls 5

addSubdomainMethod · 0.80
setPartitionerMethod · 0.80
getChannelPtrMethod · 0.45
partitionMethod · 0.45

Tested by

no test coverage detected