Remove --min-angle option.
This commit is contained in:
parent
730c454320
commit
fe6ff15206
3 changed files with 33 additions and 64 deletions
|
@ -181,65 +181,37 @@ long int get_next_task( const string& host, int port, long int last_tile ) {
|
||||||
// successfully
|
// successfully
|
||||||
bool construct_tile( const SGBucket& b,
|
bool construct_tile( const SGBucket& b,
|
||||||
const string& result_file,
|
const string& result_file,
|
||||||
const string &cover,
|
const string &cover ) {
|
||||||
float angle ) {
|
|
||||||
bool still_trying = true;
|
|
||||||
|
|
||||||
while ( still_trying ) {
|
string command = "fgfs-construct ";
|
||||||
still_trying = false;
|
command = command + " --work-dir=" + work_base;
|
||||||
char angle_str[256];
|
command = command + " --output-dir=" + output_base;
|
||||||
sprintf(angle_str, "%.0f", angle);
|
command = command + " --tile-id=" + b.gen_index_str();
|
||||||
string command = "fgfs-construct ";
|
if ( cover.size() > 0 ) {
|
||||||
command = command + " --min-angle=" + angle_str;
|
command = command + " --cover=" + cover;
|
||||||
command = command + " --work-dir=" + work_base;
|
|
||||||
command = command + " --output-dir=" + output_base;
|
|
||||||
command = command + " --tile-id=" + b.gen_index_str();
|
|
||||||
if ( cover.size() > 0 ) {
|
|
||||||
command = command + " --cover=" + cover;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < (int)load_dirs.size(); i++) {
|
|
||||||
command = command + " " + load_dirs[i];
|
|
||||||
}
|
|
||||||
command = command + " > " + result_file + " 2>&1";
|
|
||||||
cout << command << endl;
|
|
||||||
|
|
||||||
system( command.c_str() );
|
|
||||||
|
|
||||||
FILE *fp = fopen( result_file.c_str(), "r" );
|
|
||||||
char line[256];
|
|
||||||
while ( fgets( line, 256, fp ) != NULL ) {
|
|
||||||
string line_str = line;
|
|
||||||
line_str = line_str.substr(0, line_str.length() - 1);
|
|
||||||
// cout << line_str << endl;
|
|
||||||
if ( line_str == "[Finished successfully]" ) {
|
|
||||||
fclose(fp);
|
|
||||||
return true;
|
|
||||||
} else if
|
|
||||||
( (line_str.substr(0, 31) == "Error: Ran out of precision at")
|
|
||||||
|| (line_str.substr(0, 22) == "Error: Out of memory.")
|
|
||||||
|| (line_str.substr(0, 23) == "Error: Too many nodes.") ) {
|
|
||||||
if ( angle > 9.0 ) {
|
|
||||||
angle = 5.0;
|
|
||||||
still_trying = true;
|
|
||||||
} else if ( angle > 4.0 ) {
|
|
||||||
angle = 1.0;
|
|
||||||
still_trying = true;
|
|
||||||
} else if ( angle > 0.0 ) {
|
|
||||||
angle = 0.0;
|
|
||||||
still_trying = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
if ( !still_trying && ( angle > 0.0 ) ) {
|
|
||||||
// build died for some reason ... lets try one last time
|
|
||||||
// with an interior angle restriction of 0
|
|
||||||
angle = 0.0;
|
|
||||||
still_trying = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < (int)load_dirs.size(); i++) {
|
||||||
|
command = command + " " + load_dirs[i];
|
||||||
|
}
|
||||||
|
command = command + " > " + result_file + " 2>&1";
|
||||||
|
cout << command << endl;
|
||||||
|
|
||||||
|
system( command.c_str() );
|
||||||
|
|
||||||
|
FILE *fp = fopen( result_file.c_str(), "r" );
|
||||||
|
char line[256];
|
||||||
|
while ( fgets( line, 256, fp ) != NULL ) {
|
||||||
|
string line_str = line;
|
||||||
|
line_str = line_str.substr(0, line_str.length() - 1);
|
||||||
|
// cout << line_str << endl;
|
||||||
|
if ( line_str == "[Finished successfully]" ) {
|
||||||
|
fclose(fp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +239,6 @@ int main(int argc, char *argv[]) {
|
||||||
string cover;
|
string cover;
|
||||||
string host = "127.0.0.1";
|
string host = "127.0.0.1";
|
||||||
int port=4001;
|
int port=4001;
|
||||||
float angle = 10.0;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Parse the command-line arguments.
|
// Parse the command-line arguments.
|
||||||
|
@ -288,8 +259,6 @@ int main(int argc, char *argv[]) {
|
||||||
rude = true;
|
rude = true;
|
||||||
} else if (arg.find("--cover=") == 0) {
|
} else if (arg.find("--cover=") == 0) {
|
||||||
cover = arg.substr(8);
|
cover = arg.substr(8);
|
||||||
} else if (arg.find("--min-angle=") == 0) {
|
|
||||||
angle = atof(arg.substr(12).c_str());
|
|
||||||
} else if (arg.find("--") == 0) {
|
} else if (arg.find("--") == 0) {
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -328,7 +297,7 @@ int main(int argc, char *argv[]) {
|
||||||
check_master_switch();
|
check_master_switch();
|
||||||
|
|
||||||
while ( (tile = get_next_task( host, port, last_tile )) >= 0 ) {
|
while ( (tile = get_next_task( host, port, last_tile )) >= 0 ) {
|
||||||
result = construct_tile( SGBucket(tile), result_file, cover, angle );
|
result = construct_tile( SGBucket(tile), result_file, cover );
|
||||||
if ( result ) {
|
if ( result ) {
|
||||||
last_tile = tile;
|
last_tile = tile;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -34,7 +34,7 @@ else
|
||||||
WORK_BASE="${BASE_DIR}/Work"
|
WORK_BASE="${BASE_DIR}/Work"
|
||||||
CLIENT_LIST_RUDE="${WORK_BASE}/clients.rude"
|
CLIENT_LIST_RUDE="${WORK_BASE}/clients.rude"
|
||||||
CLIENT_LIST_NICE="${WORK_BASE}/clients.nice"
|
CLIENT_LIST_NICE="${WORK_BASE}/clients.nice"
|
||||||
OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.1"
|
OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.2"
|
||||||
LOG_DIR="${WORK_BASE}/Status"
|
LOG_DIR="${WORK_BASE}/Status"
|
||||||
SERVER_LOG_FILE=${LOG_DIR}/server.log
|
SERVER_LOG_FILE=${LOG_DIR}/server.log
|
||||||
echo "Base directory is $BASE_DIR"
|
echo "Base directory is $BASE_DIR"
|
||||||
|
@ -100,7 +100,7 @@ for i in $CLIENTS_RUDE; do
|
||||||
# KILL_COMMAND="killall $CLIENT"
|
# KILL_COMMAND="killall $CLIENT"
|
||||||
# ssh -n $i "$KILL_COMMAND"
|
# ssh -n $i "$KILL_COMMAND"
|
||||||
|
|
||||||
RMT_COMMAND="source ~/.profile; nice $CLIENT --host=$SERVER_HOST --port=$SERVER_PORT --work-dir=$WORK_BASE --output-dir=$OUTPUT_DIR --rude --min-angle=0 --cover=$WORK_BASE/LC-Global/gusgs2_0ll.img AirportArea AirportObj GSHHS-Ponds GSHHS-Islands GSHHS-Lakes GSHHS-LandMass USA-Hydro USA-Urban SRTM-1 SRTM-3 DEM-3 DEM-30"
|
RMT_COMMAND="source ~/.profile; nice $CLIENT --host=$SERVER_HOST --port=$SERVER_PORT --work-dir=$WORK_BASE --output-dir=$OUTPUT_DIR --rude --cover=$WORK_BASE/LC-Global/gusgs2_0ll.img AirportArea AirportObj GSHHS-Ponds GSHHS-Islands GSHHS-Lakes GSHHS-LandMass USA-Hydro USA-Urban SRTM-1 SRTM-3 DEM-3 DEM-30"
|
||||||
echo "client command:"
|
echo "client command:"
|
||||||
echo ""
|
echo ""
|
||||||
echo "$RMT_COMMAND"
|
echo "$RMT_COMMAND"
|
||||||
|
|
|
@ -33,7 +33,7 @@ else
|
||||||
BASE_DIR=$1
|
BASE_DIR=$1
|
||||||
shift
|
shift
|
||||||
WORK_BASE="${BASE_DIR}/Work"
|
WORK_BASE="${BASE_DIR}/Work"
|
||||||
OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.1"
|
OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.2"
|
||||||
MASTER_ON="${WORK_BASE}/Status/MASTER_ON"
|
MASTER_ON="${WORK_BASE}/Status/MASTER_ON"
|
||||||
LOG_DIR="${WORK_BASE}/Status"
|
LOG_DIR="${WORK_BASE}/Status"
|
||||||
LOG_FILE="${LOG_DIR}/server.log"
|
LOG_FILE="${LOG_DIR}/server.log"
|
||||||
|
|
Loading…
Add table
Reference in a new issue