Finalizing MPI Code

This commit is contained in:
hammer 2022-02-04 23:00:04 -06:00
parent 124a3ef5f4
commit 915d679b9c
24 changed files with 3325 additions and 3744 deletions

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;
@ -138,8 +138,8 @@ exploit oil_service(a)=
exploit driveshaft_service(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=true;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=true;
postconditions:
update quality:a,driveshaft_odom=0;
update quality:a,driveshaft_vio=false;
@ -147,8 +147,8 @@ exploit driveshaft_service(a)=
exploit coolant_service(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=true;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=true;
postconditions:
update quality:a,coolant_odom=0;
update quality:a,coolant_vio=false;
@ -156,8 +156,8 @@ exploit coolant_service(a)=
exploit parkingbrake_service(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=true;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=true;
postconditions:
update quality:a,parkingbrake_months=0;
update quality:a,parkingbrake_months=false;
@ -165,8 +165,8 @@ exploit parkingbrake_service(a)=
exploit brakepipe_service(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=true;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=true;
postconditions:
update quality:a,brakepipe_months=0;
update quality:a,brakepipe_vio=false;
@ -174,8 +174,8 @@ exploit brakepipe_service(a)=
exploit brakehose_service(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=true;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=true;
postconditions:
update quality:a,brakehoses_months=0;
update quality:a,brakehoses_vio=false;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;
@ -138,8 +138,8 @@ exploit oil_service(a)=
exploit driveshaft_service(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=true;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=true;
postconditions:
update quality:a,driveshaft_odom=0;
update quality:a,driveshaft_vio=false;
@ -147,8 +147,8 @@ exploit driveshaft_service(a)=
exploit coolant_service(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=true;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=true;
postconditions:
update quality:a,coolant_odom=0;
update quality:a,coolant_vio=false;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;
@ -138,8 +138,8 @@ exploit oil_service(a)=
exploit driveshaft_service(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=true;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=true;
postconditions:
update quality:a,driveshaft_odom=0;
update quality:a,driveshaft_vio=false;
@ -147,8 +147,8 @@ exploit driveshaft_service(a)=
exploit coolant_service(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=true;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=true;
postconditions:
update quality:a,coolant_odom=0;
update quality:a,coolant_vio=false;
@ -156,8 +156,8 @@ exploit coolant_service(a)=
exploit parkingbrake_service(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=true;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=true;
postconditions:
update quality:a,parkingbrake_months=0;
update quality:a,parkingbrake_months=false;

View File

@ -48,8 +48,8 @@ exploit engine_oil(a)=
exploit driveshaft_boots(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=false;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=false;
postconditions:
update quality:a,driveshaft_vio=true;
update quality:a,compliance_vio=true;
@ -57,8 +57,8 @@ exploit driveshaft_boots(a)=
exploit engine_coolant(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=false;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=false;
postconditions:
update quality:a,coolant_vio=true;
update quality:a,compliance_vio=true;
@ -66,8 +66,8 @@ exploit engine_coolant(a)=
exploit parking_brake(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=false;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=false;
postconditions:
update quality:a,parkingbrake_vio=true;
update quality:a,compliance_vio=true;
@ -75,8 +75,8 @@ exploit parking_brake(a)=
exploit brake_pipes(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=false;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=false;
postconditions:
update quality:a,brakepipe_vio=true;
update quality:a,compliance_vio=true;
@ -84,8 +84,8 @@ exploit brake_pipes(a)=
exploit brake_hoses(a)=
preconditions:
quality:car1,brakehoses_months>=12;
quality:car1,brakehoses_vio=false;
quality:a,brakehoses_months>=12;
quality:a,brakehoses_vio=false;
postconditions:
update quality:a,brakehoses_vio=true;
update quality:a,compliance_vio=true;
@ -138,8 +138,8 @@ exploit oil_service(a)=
exploit driveshaft_service(a)=
preconditions:
quality:car1,driveshaft_odom>=12000;
quality:car1,driveshaft_vio=true;
quality:a,driveshaft_odom>=12000;
quality:a,driveshaft_vio=true;
postconditions:
update quality:a,driveshaft_odom=0;
update quality:a,driveshaft_vio=false;
@ -147,8 +147,8 @@ exploit driveshaft_service(a)=
exploit coolant_service(a)=
preconditions:
quality:car1,coolant_odom>=24000;
quality:car1,coolant_vio=true;
quality:a,coolant_odom>=24000;
quality:a,coolant_vio=true;
postconditions:
update quality:a,coolant_odom=0;
update quality:a,coolant_vio=false;
@ -156,8 +156,8 @@ exploit coolant_service(a)=
exploit parkingbrake_service(a)=
preconditions:
quality:car1,parkingbrake_months>=6;
quality:car1,parkingbrake_vio=true;
quality:a,parkingbrake_months>=6;
quality:a,parkingbrake_vio=true;
postconditions:
update quality:a,parkingbrake_months=0;
update quality:a,parkingbrake_months=false;
@ -165,8 +165,8 @@ exploit parkingbrake_service(a)=
exploit brakepipe_service(a)=
preconditions:
quality:car1,brakepipe_months>=12;
quality:car1,brakepipe_vio=true;
quality:a,brakepipe_months>=12;
quality:a,brakepipe_vio=true;
postconditions:
update quality:a,brakepipe_months=0;
update quality:a,brakepipe_vio=false;

Binary file not shown.

View File

@ -3,24 +3,29 @@
#SBATCH --job-name=ag_parallel_ser
#SBATCH --error=./slurm_reports/job.%J.err
#SBATCH --output=./slurm_reports/job.%J.out
#SBATCH --nodes=10
#SBATCH --nodes=6
#SBATCH --mem=0
#SBATCH --exclude=compute02,compute09
#SBATCH --exclude=compute02,compute03,compute09
#SBATCH --export=ALL
export LD_LIBRARY_PATH=/home/nschrick/pkg/postgresql/13.4/lib
MPICH_NEMESIS_NETMOD=ofi
MPIEXEC_TIMEOUT=129600
#Argument for running test batches
NUM_SERV=${1:-1}
TYPE=${2:-sync}
CARS=${3:-2}
DBNAME=${4:-tmp}
NODES=${5:-6}
NODES=${5:-2}
NOW=`date +"%H:%M"`
module load graphviz
module load gcc
module load openmpi
#module load mpich
module load cmake
module load postgresql
#./run.sh 1 sync 2 "$NOW" 2
./run.sh "$NUM_SERV" "$TYPE" "$CARS" "$DBNAME" "$NODES"

View File

@ -6,8 +6,10 @@ if [ "$(dnsdomainname)" = "hammer.esg.utulsa.edu" ]; then
module load gcc
module load boost
module load openmpi
#module load mpich
module load postgresql
fi
cmake -DCMAKE_BUILD_TYPE=Debug ../ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
make clean
cmake -DCMAKE_BUILD_TYPE=Debug ../ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DMPICH_IGNORE_CXX_SEEK=1
make ag_gen

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,23 @@
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -27,67 +28,53 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */
#ifndef YY_NM_HOME_NOAH_DOCUMENTS_SCHOOL_THESIS_WORK_AG_PARALLEL_BUILD_NM_PARSER_TAB_H_INCLUDED
# define YY_NM_HOME_NOAH_DOCUMENTS_SCHOOL_THESIS_WORK_AG_PARALLEL_BUILD_NM_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int nmdebug;
#endif
/* Token kinds. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
YYEMPTY = -2,
YYEOF = 0, /* "end of file" */
YYerror = 256, /* error */
YYUNDEF = 257, /* "invalid token" */
IDENTIFIER = 258, /* IDENTIFIER */
INT = 259, /* INT */
FLOAT = 260, /* FLOAT */
EQ = 261, /* EQ */
GT = 262, /* GT */
LT = 263, /* LT */
GEQ = 264, /* GEQ */
LEQ = 265, /* LEQ */
ONEDIR = 266, /* ONEDIR */
ONEDIRBACK = 267, /* ONEDIRBACK */
BIDIR = 268, /* BIDIR */
NOTONEDIR = 269, /* NOTONEDIR */
NOTBIDIR = 270, /* NOTBIDIR */
NETWORK = 271, /* NETWORK */
MODEL = 272, /* MODEL */
ASSETS = 273, /* ASSETS */
COLON = 274, /* COLON */
FACTS = 275, /* FACTS */
PERIOD = 276, /* PERIOD */
SEMI = 277, /* SEMI */
QUALITY = 278, /* QUALITY */
COMMA = 279, /* COMMA */
TOPOLOGY = 280, /* TOPOLOGY */
WHITESPACE = 281, /* WHITESPACE */
TAGS = 282 /* TAGS */
};
typedef enum yytokentype yytoken_kind_t;
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
IDENTIFIER = 258,
INT = 259,
FLOAT = 260,
EQ = 261,
GT = 262,
LT = 263,
GEQ = 264,
LEQ = 265,
ONEDIR = 266,
ONEDIRBACK = 267,
BIDIR = 268,
NOTONEDIR = 269,
NOTBIDIR = 270,
NETWORK = 271,
MODEL = 272,
ASSETS = 273,
COLON = 274,
FACTS = 275,
PERIOD = 276,
SEMI = 277,
QUALITY = 278,
COMMA = 279,
TOPOLOGY = 280,
WHITESPACE = 281,
TAGS = 282
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
typedef union YYSTYPE
{
#line 25 "/home/noah/Documents/School/Thesis Work/ag_parallel/src/parser/nm-parser/nm_parser.yy"
/* Line 1676 of yacc.c */
#line 25 "/home/nschrick/ag_parallel/src/parser/nm-parser/nm_parser.yy"
struct str_array* arr;
struct list* lst;
@ -96,19 +83,16 @@ union YYSTYPE
struct fact *fct;
char* string;
#line 100 "/home/noah/Documents/School/Thesis Work/ag_parallel/build/nm_parser.tab.h"
};
typedef union YYSTYPE YYSTYPE;
/* Line 1676 of yacc.c */
#line 90 "/home/nschrick/ag_parallel/build/nm_parser.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE nmlval;
int nmparse (struct networkmodel* nm);
#endif /* !YY_NM_HOME_NOAH_DOCUMENTS_SCHOOL_THESIS_WORK_AG_PARALLEL_BUILD_NM_PARSER_TAB_H_INCLUDED */

File diff suppressed because it is too large Load Diff

View File

@ -55,8 +55,14 @@ if [ "$TYPE" == "$strval1" ]; then
#./ag_gen -n ../Feb_2021/generic_timeline_maintenance.nm -x ../Feb_2021/Sync/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -g DOTFILE.dot -t 1 -q 1 -p -a 0.9
#Curr
#mpirun --mca btl tcp,self --mca btl_tcp_if_include "$ITFC" --mca opal_warn_on_missing_libcuda 0 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
#Test
mpirun --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --mca btl ^uct -np "$NODES" ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
#Test 36 hour timeout
# mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --mca btl ^uct -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/10_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --bind-to numa --map-by numa -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
# 4 Exploit
#mpiexec -np "$NODES" --bind-to numa --map-by numa ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/"$NUM_SERV"_Serv/sync_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
elif [ "$TYPE" == "$strval2" ]; then
@ -64,11 +70,11 @@ elif [ "$TYPE" == "$strval2" ]; then
#Test
#mpirun --mca btl tcp,self --mca btl_tcp_if_include "$ITFC" --mca opal_warn_on_missing_libcuda 0 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/4_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
mpirun --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 -np "$NODES" ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/4_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 -np "$NODES" --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/"$CARS"_car_timeline_maintenance.nm -x ../Oct_2021/Non_Sync/10_Exploits/"$NUM_SERV"_Serv/generic_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
else
echo "Running default."
mpirun --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 ./ag_gen -n ../Oct_2021/nm_files/1_car_timeline_maintenance.nm -x ../Oct_2021/Sync/4_Exploits/1_Serv/sync_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
mpiexec --mca btl_openib_allow_ib 1 --mca opal_warn_on_missing_libcuda 0 --timeout 129600 ./ag_gen -n ../Oct_2021/nm_files/1_car_timeline_maintenance.nm -x ../Oct_2021/Sync/10_Exploits/1_Serv/sync_timeline_maintenance.xp -t 1 -q 1 -p -a 0.6 -z "$DBNAME"
fi

View File

@ -14,6 +14,13 @@ pwd=`pwd`
#one=1
#4,8,16,32 thr
thrds=(4 8 16 32)
if [[ "$folder" == serial || "$folder" == serialnosync || "$folder" == mpi ]]; then
thrds=(1)
else
thrds=(4 8 16 32)
fi
QSIZE=1
SKIPSYNC=false
@ -125,7 +132,7 @@ fi
thrds=(4 8 16 32)
#thrds=(4 8 16 32)
for thrd in "${thrds[@]}"
do

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,23 @@
/* A Bison parser, made by GNU Bison 3.8.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
Inc.
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -27,77 +28,63 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
especially those whose name start with YY_ or yy_. They are
private implementation details that can be changed or removed. */
#ifndef YY_XP_HOME_NOAH_DOCUMENTS_SCHOOL_THESIS_WORK_AG_PARALLEL_BUILD_XP_PARSER_TAB_H_INCLUDED
# define YY_XP_HOME_NOAH_DOCUMENTS_SCHOOL_THESIS_WORK_AG_PARALLEL_BUILD_XP_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int xpdebug;
#endif
/* Token kinds. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
YYEMPTY = -2,
YYEOF = 0, /* "end of file" */
YYerror = 256, /* error */
YYUNDEF = 257, /* "invalid token" */
IDENTIFIER = 258, /* IDENTIFIER */
INT = 259, /* INT */
FLOAT = 260, /* FLOAT */
GROUP = 261, /* GROUP */
EQ = 262, /* EQ */
NEQ = 263, /* NEQ */
GT = 264, /* GT */
LT = 265, /* LT */
GEQ = 266, /* GEQ */
LEQ = 267, /* LEQ */
PLUSEQ = 268, /* PLUSEQ */
SUBEQ = 269, /* SUBEQ */
ONEDIR = 270, /* ONEDIR */
ONEDIRBACK = 271, /* ONEDIRBACK */
BIDIR = 272, /* BIDIR */
NOTONEDIR = 273, /* NOTONEDIR */
NOTBIDIR = 274, /* NOTBIDIR */
ADD = 275, /* ADD */
INSERT = 276, /* INSERT */
UPDATE = 277, /* UPDATE */
DELETE = 278, /* DELETE */
REMOVE = 279, /* REMOVE */
EXPLOIT = 280, /* EXPLOIT */
PRECONDITIONS = 281, /* PRECONDITIONS */
POSTCONDITIONS = 282, /* POSTCONDITIONS */
COLON = 283, /* COLON */
FACTS = 284, /* FACTS */
PERIOD = 285, /* PERIOD */
SEMI = 286, /* SEMI */
QUALITY = 287, /* QUALITY */
COMMA = 288, /* COMMA */
TOPOLOGY = 289, /* TOPOLOGY */
WHITESPACE = 290, /* WHITESPACE */
LPAREN = 291, /* LPAREN */
RPAREN = 292 /* RPAREN */
};
typedef enum yytokentype yytoken_kind_t;
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
IDENTIFIER = 258,
INT = 259,
FLOAT = 260,
GROUP = 261,
EQ = 262,
NEQ = 263,
GT = 264,
LT = 265,
GEQ = 266,
LEQ = 267,
PLUSEQ = 268,
SUBEQ = 269,
ONEDIR = 270,
ONEDIRBACK = 271,
BIDIR = 272,
NOTONEDIR = 273,
NOTBIDIR = 274,
ADD = 275,
INSERT = 276,
UPDATE = 277,
DELETE = 278,
REMOVE = 279,
EXPLOIT = 280,
PRECONDITIONS = 281,
POSTCONDITIONS = 282,
COLON = 283,
FACTS = 284,
PERIOD = 285,
SEMI = 286,
QUALITY = 287,
COMMA = 288,
TOPOLOGY = 289,
WHITESPACE = 290,
LPAREN = 291,
RPAREN = 292
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
typedef union YYSTYPE
{
#line 21 "/home/noah/Documents/School/Thesis Work/ag_parallel/src/parser/xp-parser/xp_parser.yy"
/* Line 1676 of yacc.c */
#line 21 "/home/nschrick/ag_parallel/src/parser/xp-parser/xp_parser.yy"
struct str_array *arr;
struct list *list;
@ -107,19 +94,16 @@ union YYSTYPE
struct fact *fct;
char *string;
#line 111 "/home/noah/Documents/School/Thesis Work/ag_parallel/build/xp_parser.tab.h"
};
typedef union YYSTYPE YYSTYPE;
/* Line 1676 of yacc.c */
#line 101 "/home/nschrick/ag_parallel/build/xp_parser.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE xplval;
int xpparse (struct list *xplist);
#endif /* !YY_XP_HOME_NOAH_DOCUMENTS_SCHOOL_THESIS_WORK_AG_PARALLEL_BUILD_XP_PARSER_TAB_H_INCLUDED */

File diff suppressed because it is too large Load Diff

View File

@ -156,7 +156,7 @@ createPostConditions(std::tuple<Exploit, AssetGroup> &group, Keyvalue &facts) {
* 5. Push the new network state onto the frontier to be expanded later.
*/
AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd, int initQSize,\
double mem_threshold, boost::mpi::communicator &world) {
double mem_threshold, mpi::communicator &world) {
//Init all Nodes with these variables
std::vector<Exploit> exploit_list = instance.exploits;
@ -387,21 +387,25 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
std::cout << "World Size: " << world.size() << " Allocated to Task 1: " << alloc << " Allocated to Task 2: " << two_alloc << "Ceil val: " << ceil_val << std::endl;
//Create Communicators
boost::mpi::communicator tcomm = world.split(world.rank() > 0 && world.rank() <= alloc);
boost::mpi::communicator ttwo_comm;
//Note, these each return 2 handles!
mpi::communicator tcomm = world.split(world.rank() > 0 && world.rank() <= alloc);
mpi::communicator ttwo_comm;
if(world.size() == 2){
ttwo_comm = world.split(world.rank() == send_check(world, alloc) && world.rank() <= (2*two_alloc));
}
else
ttwo_comm = world.split(world.rank() >= send_check(world, alloc) && world.rank() <= (2*two_alloc));
ttwo_comm = world.split(world.rank() >= send_check(world, alloc) && world.rank() <= (alloc+two_alloc));
std::cout << "TCOMM SIZE: " << tcomm.size() << std::endl;
std::cout << "TTWO_COMM SIZE: " << ttwo_comm.size() << std::endl;
while (!localFrontier.empty() || !unex_empty() || world.rank() > 0){//while starts
//Node 0 needs to tell other nodes to continue
if(world.rank() == 0){
int dummy = 1;
for (int w = 1; w < world.size(); w++)
world.isend(w, 14, dummy);
for (int w = 1; w < world.size(); w++){
mpi::request dum_req = world.isend(w, 14, dummy);
dum_req.wait();
}
}
else {
@ -417,7 +421,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
break;
//Receive the message so it's not just sitting in the queue.
int dummy;
world.irecv(0, 14, dummy);
world.recv(0, 14, dummy);
}
//We need to refill the localFrontier with states from the database if it's empty
@ -438,8 +442,9 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
auto current_state = localFrontier.back();
localFrontier.pop_back();
for(int l=0; l < alloc; l++){
world.isend(send_check(world, l), 20, current_state);
}
mpi::request cs_req = world.isend(send_check(world, l), 20, current_state);
cs_req.wait();
}
}
//Execute Task 1
@ -460,7 +465,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
//Edge case: 2 nodes: This prevents node 1 from accessing the execution of task 2
if((world.size() == 2 && world.rank() == 0) || world.size() > 2)
{
if(world.rank() >= send_check(world, alloc) && world.rank() <= (2*two_alloc))
if(world.rank() >= send_check(world, alloc) && world.rank() <= (alloc+two_alloc))
{
//Execute Task 2
struct timeval t21,t22;
@ -474,8 +479,8 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
NetworkState new_state;
Quality fact;
ttwo_comm.irecv(mpi::any_source, 3, fact);
ttwo_comm.irecv(mpi::any_source, 4, new_state);
ttwo_comm.recv(mpi::any_source, 3, fact);
ttwo_comm.recv(mpi::any_source, 4, new_state);
instance.facts.hash_table[new_state.compound_assign(fact)]=instance.facts.size();
instance.facts.length++;
@ -492,14 +497,16 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
{
//2 Node Edge case
if(world.size() == 2){
world.isend(1, 2, 1);
mpi::request tdone_req = world.isend(1, 2, 1);
tdone_req.wait();
std::cout << "Node " << world.rank() << " sent finished message." << std::endl;
break;
}
else if(w < world.rank() || w > 2*two_alloc)
else if(w < world.rank() || w > alloc+two_alloc)
{
world.isend(w, 2, 1);
mpi::request tdone_req = world.isend(w, 2, 1);
tdone_req.wait();
}
}
@ -520,7 +527,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
//while(!world.iprobe(1+alloc, 2) && world.iprobe(mpi::any_source, 3) && world.iprobe(mpi::any_source, 4) && world.iprobe(mpi::any_source, 5))
std::cout << "Node " << world.rank() << " is waiting for Task 2 completion." << std::endl;
int finished_signal = 0;
if(world.iprobe(send_check(world, alloc), 2) || world.iprobe(0, 2)){
if(world.iprobe(mpi::any_source, 2)){
world.recv(mpi::any_source, 2, finished_signal);
}
@ -528,7 +535,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
while(!finished_signal || world.iprobe(mpi::any_source, 3) || world.iprobe(mpi::any_source, 4) || world.iprobe(mpi::any_source, 5))
{
//Check for the finished signal
if(world.iprobe(send_check(world, alloc), 2) || world.iprobe(0, 2)){
if(world.iprobe(mpi::any_source, 2)){
//Prevent double-pulling
if(!finished_signal){
std::cout << "Else nodes received task 2 completion message." << std::endl;
@ -563,7 +570,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
struct timeval t31,t32;
gettimeofday(&t31,NULL);
task_three(instance, critical_state, localFrontier, mem_threshold, world,\
two_alloc, current_state, exploit, assetGroup, hash_map);
alloc, two_alloc, current_state, exploit, assetGroup, hash_map);
std::cout << "Task 3 finished." << std::endl;
gettimeofday(&t32,NULL);
total_task3+=(t32.tv_sec-t31.tv_sec)*1000.0+(t32.tv_usec-t31.tv_usec)/1000.0;
@ -575,7 +582,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
}
//Task Four
if (world.rank() == send_check(world, 2*two_alloc)){
if (world.rank() == send_check(world, alloc+two_alloc)){
if(world.iprobe(0, 7) || world.iprobe(0, 8)){
std::cout << "Node " << world.rank() << " is starting Task 4." << std::endl;
std::vector<Factbase> factbases_dump;
@ -605,10 +612,11 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
if (f_alpha >= (mem_threshold/2)) {
//std::cout << "Frontier Alpha prior to database storing: " << f_alpha << std::endl;
int q_eles = localFrontier.size();
for (int q = 0; q < q_eles; q++) {
for (int q = 0; q < (q_eles/2); q++) {
auto rem_state = localFrontier.front();
localFrontier.pop_front();
world.send(send_check(world, 2*two_alloc+1), 50, rem_state);
mpi::request rem_req = world.isend(send_check(world, alloc+two_alloc+1), 50, rem_state);
rem_req.wait();
}
if (!localFrontier.empty())
f_alpha = (static_cast<double>(localFrontier.size()) * (localFrontier.back().get_size()))/tot_sys_mem;
@ -618,7 +626,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
}
}
if(world.rank() == send_check(world, 2*two_alloc+2)){
if(world.rank() == send_check(world, alloc+two_alloc+1)){
while(world.iprobe(0, 50)){
NetworkState save_state;
world.recv(0, 50, save_state);
@ -630,8 +638,10 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
} //while ends
if(world.rank() == 0){
for (int w = 1; w < world.size(); w++)
world.isend(w, 15, 1);
for (int w = 1; w < world.size(); w++){
mpi::request proc_req = world.isend(w, 15, 1);
proc_req.wait();
}
}
if (mpi_exit == 1){
@ -685,7 +695,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
}
AGGenInstance &AGGen::single_generate(bool batch_process, int batch_num, int numThrd,\
int initQSize, double mem_threshold, boost::mpi::communicator &world){
int initQSize, double mem_threshold, mpi::communicator &world){
std::vector<Exploit> exploit_list = instance.exploits;

View File

@ -67,8 +67,8 @@ void task_zero(AGGenInstance &instance, std::deque<NetworkState> &localFrontier,
void task_one(AGGenInstance &instance, NetworkState &current_state,\
std::vector<Exploit> &exploit_list, std::unordered_map<size_t, PermSet<size_t>> &od_map,\
int alloc, int two_alloc, int reduc_factor, int num_tasks, boost::mpi::communicator &world,\
boost::mpi::communicator &tcomm){
int alloc, int two_alloc, int reduc_factor, int num_tasks, mpi::communicator &world,\
mpi::communicator &tcomm){
std::cout << "Process rank " << world.rank() << " with " << alloc << " node(s) allocated has started Task 1." << std::endl;
std::vector<std::tuple<Exploit, AssetGroup>> appl_exploits;
@ -133,27 +133,68 @@ void task_one(AGGenInstance &instance, NetworkState &current_state,\
//Less nodes allocated to task 2 than task 1.
//Distribute the appl_exploit list from the extra node in task 1 to all other nodes in this task
if (two_alloc < alloc){
std::vector<std::tuple<Exploit, AssetGroup>> partial_appl_exploits;
mpi::scatter(tcomm, &appl_exploits, partial_appl_exploits, alloc);
if (alloc > two_alloc){
int has_data;
//std::tuple<int, int> data_mod = std::make_tuple(0, 0);
if (world.rank() == alloc){
if (appl_exploits.size() > 0){
//std::get<0>(data_mod) = ceil((double)appl_exploits.size()/((double)tcomm.size()-1));
//std::get<1>(data_mod) = appl_exploits.size()%(tcomm.size()-1);
//data_mod = std::make_tuple(ceil((double)appl_exploits.size()/((double)tcomm.size()-1)), appl_exploits.size()%(tcomm.size()-1));
has_data = 1;
}
else{
has_data = 0;
}
}
if(world.rank() < alloc){
for(auto itr=partial_appl_exploits.begin(); itr!=partial_appl_exploits.end(); itr++){
auto index_r=std::distance(partial_appl_exploits.begin(),itr);
appl_exploits.push_back(partial_appl_exploits.at(index_r));
}
}
//Convert world.rank() of alloc to tcomm rank by -1
broadcast(tcomm, has_data, alloc-1);
if(has_data==1){
std::vector<std::vector<std::tuple<Exploit, AssetGroup>>> sub_partials;
std::vector<std::tuple<Exploit, AssetGroup>> partial_appl_exploits;
if (world.rank() == alloc){
size_t num_data = appl_exploits.size()/(tcomm.size()-1);
size_t remain = appl_exploits.size()%(tcomm.size()-1);
int begin = 0;
int end = 0;
for (int i = 0; i < std::min((int)(tcomm.size()-1), (int)appl_exploits.size()); ++i){
end += (remain > 0) ? (num_data + !!(remain--)) : num_data;
sub_partials.push_back(std::vector<std::tuple<Exploit, AssetGroup>>(appl_exploits.begin()+begin, appl_exploits.begin()+end));
begin = end;
mpi::request scatter_req = tcomm.isend(i, 21, sub_partials.at(i));
std::cout << "PROCESS " << world.rank() << " SENDING APPL EXPLOIT LIST OF SIZE " << sub_partials.at(i).size() << "TO TCOMM RANK " << i << " ORIGINAL LIST WAS SIZE " << appl_exploits.size() << std::endl;
scatter_req.wait();
}
}
tcomm.barrier();
if(world.rank() < alloc){
if(tcomm.iprobe(alloc-1, 21)){
tcomm.recv(alloc-1, 21, partial_appl_exploits);
std::cout << "PROCESS " << world.rank() << " RECEIVED APPL EXPLOIT LIST OF SIZE " << partial_appl_exploits.size() << " IN TASK 1" << std::endl;
appl_exploits.insert(std::end(appl_exploits), std::begin(partial_appl_exploits), std::end(partial_appl_exploits));
//for(auto itr=partial_appl_exploits.begin(); itr!=partial_appl_exploits.end(); itr++){
// auto index_r=std::distance(partial_appl_exploits.begin(),itr);
// appl_exploits.push_back(partial_appl_exploits.at(index_r));
//}
}
}
}
}
//Send Applicable Exploit List
int skip_greatest = 0;
if (two_alloc < alloc)
if (alloc > two_alloc)
skip_greatest = 1;
if(world.rank() <= alloc - skip_greatest){
if(world.rank() <= (alloc - skip_greatest)){
std::cout << "Process " << world.rank() << " sending applicable exploit list of size " << appl_exploits.size() <<\
" to Process " << send_check(world, world.rank() + alloc -1) << std::endl;
world.isend(send_check(world, world.rank() + alloc -1), 30, appl_exploits);
world.isend(send_check(world, world.rank() + alloc -1), 40, current_state);
mpi::request appl_req = world.isend(send_check(world, world.rank() + alloc -1), 30, appl_exploits);
mpi::request cs_req = world.isend(send_check(world, world.rank() + alloc -1), 40, current_state);
appl_req.wait();
cs_req.wait();
}
}
@ -170,8 +211,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
world.recv(mpi::any_source, 30, appl_exploits);
world.recv(mpi::any_source, 40, current_state);
std::cout << "Process " << world.rank() << " received Task 1 data." << std::endl;
std::cout << "Appl exploit size " << appl_exploits.size() << std::endl;
std::cout << "Process " << world.rank() << " received Task 1 data with Appl exploit size " << appl_exploits.size() << std::endl;
//Check for new fact and new state that caused an update in the hash table and facts
while(world.iprobe(mpi::any_source, 3) || world.iprobe(mpi::any_source, 4)){
@ -206,45 +246,66 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
std::string egroup;
//Build up the map of synchronous fire exploits and send to 0th node of task 2
for(auto itr=appl_exploits.begin(); itr!=appl_exploits.end(); itr++){
for(auto itr=appl_exploits.begin(); itr!=appl_exploits.end();){
//auto e = appl_exploits.at(itr);
auto e = *itr;
egroup = std::get<0>(e).get_group();
int tflag = 0;
if (egroup != "null"){
sync_vectors[egroup].push_back(e);
}
if(ttwo_comm.rank() != 0){
std::cout << "NODE " << world.rank() << " HAD A SYNC EXPLOIT " << std::endl;
itr = appl_exploits.erase(itr);
tflag = 1;
}
}
if(tflag == 0)
itr++;
}
if(ttwo_comm.rank() != 0){
for (auto map_group : ex_groups){
ttwo_comm.isend(0, 6, sync_vectors[egroup]);
}
if(sync_vectors[map_group].size() > 0){
mpi::request sync_req = ttwo_comm.isend(0, 9, std::make_tuple(map_group, sync_vectors[map_group]));
std::cout << "NODE " << world.rank() << " SENDING SYNC APPL SIZE OF " << sync_vectors[map_group].size() << std::endl;
sync_req.wait();
sync_vectors[map_group].clear();
}
}
/*
for(auto itr = appl_exploits.begin(); itr != appl_exploits.end();){
egroup = std::get<0>(*itr).get_group();
if (egroup == "null"){
if (egroup != "null"){
itr = appl_exploits.erase(itr);
}
else{
itr++;
}
}
}*/
}
ttwo_comm.barrier();
if(ttwo_comm.rank() == 0 && ttwo_comm.size() > 1){
//Attempt to distribute workload evenly has unintended effects since we don't know which Task 1 data goes where: it could all go to this node.
//for(auto itr = appl_exploits.begin(); itr != appl_exploits.end();){
// itr = appl_exploits.erase(itr);
//}
for (int r = 0; r < ex_groups.size() * (ttwo_comm.size()-1); r++){
ttwo_comm.irecv(mpi::any_source, 6, partial_appl_exploits);
for(auto itr=partial_appl_exploits.begin(); itr!=partial_appl_exploits.end(); itr++){
auto index_r=std::distance(partial_appl_exploits.begin(),itr);
appl_exploits.push_back(partial_appl_exploits.at(index_r));
}
}
//for (int r = 0; r < ex_groups.size() * (ttwo_comm.size()-1); r++){
while(ttwo_comm.iprobe(mpi::any_source, 9)){
std::tuple<std::string, std::vector<std::tuple<Exploit, AssetGroup>>> sync_recv;
ttwo_comm.recv(mpi::any_source, 9, sync_recv);
partial_appl_exploits = std::get<1>(sync_recv);
appl_exploits.insert(std::end(appl_exploits), std::begin(partial_appl_exploits), std::end(partial_appl_exploits));
std::cout << "TTWO COMM RANK 0 HAS RECEIVED AN APPL EXPLOIT LIST SIZE OF " << partial_appl_exploits.size() << " RESULTING IN A TOTAL SIZE OF " << appl_exploits.size() << std::endl;
sync_vectors[std::get<0>(sync_recv)].insert(std::end(sync_vectors[std::get<0>(sync_recv)]), std::begin(partial_appl_exploits), std::end(partial_appl_exploits));
//for(auto itr=partial_appl_exploits.begin(); itr!=partial_appl_exploits.end(); itr++){
// auto index_r=std::distance(partial_appl_exploits.begin(),itr);
// appl_exploits.push_back(partial_appl_exploits.at(index_r));
// }
}
}
//loop through the vector
for(auto itr=appl_exploits.begin(); itr!=appl_exploits.end(); itr++){
@ -282,7 +343,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
break;
}
}
std::cout << "Sync exploit size " << sync_exploits.size() << std::endl;
std::cout << "Sync exploit size " << sync_exploits.size() << " at Node " << world.rank() << " out of a total of " << appl_exploits.size() << std::endl;
for(auto sync_itr=sync_exploits.begin(); sync_itr!=sync_exploits.end(); sync_itr++){
e = *sync_itr;
exploit = std::get<0>(e);
@ -322,8 +383,10 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
{
if(w != world.rank())
{
world.isend(w, 3, new_state);
world.isend(w, 4, fact);
mpi::request ns_req = world.isend(w, 3, new_state);
mpi::request fact_req = world.isend(w, 4, fact);
ns_req.wait();
fact_req.wait();
}
}
}
@ -362,14 +425,18 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
//<6 Node Edge Case Prevention: Node 0 unable to execute task 3
if(world.rank() != 0){
std::cout << "Node " << world.rank() << " sending new state data to Node 0" << std::endl;
world.isend(0, 5, new_state);
world.isend(0, 6, current_state);
world.isend(0, 10, exploit);
world.isend(0, 11, assetGroup);
}
mpi::request ns_req = world.isend(0, 5, new_state);
mpi::request cs_req = world.isend(0, 6, current_state);
mpi::request ex_req = world.isend(0, 10, exploit);
mpi::request ag_req = world.isend(0, 11, assetGroup);
ns_req.wait();
cs_req.wait();
ex_req.wait();
ag_req.wait();
}
else {
task_three(instance, new_state, localFrontier, mem_threshold, world,\
two_alloc, current_state, exploit, assetGroup, hash_map);
alloc, two_alloc, current_state, exploit, assetGroup, hash_map);
}
}
else{
@ -380,7 +447,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
}
void task_three(AGGenInstance &instance, NetworkState &new_state, std::deque<NetworkState> &localFrontier,\
double mem_threshold, boost::mpi::communicator &world, int two_alloc, NetworkState &current_state,\
double mem_threshold, boost::mpi::communicator &world, int alloc, int two_alloc, NetworkState &current_state,\
Exploit &exploit, AssetGroup &assetGroup, std::unordered_map<size_t, int> &hash_map){
std::cout << "Started Task 3." << std::endl;
@ -410,7 +477,9 @@ void task_three(AGGenInstance &instance, NetworkState &new_state, std::deque<Net
if (f_alpha >= (mem_threshold/2)) {
//std::cout << "Frontier Alpha prior to database storing: " << f_alpha << std::endl;
save_unexplored_to_db(new_state);
mpi::request ns_req = world.isend(send_check(world, alloc+two_alloc+1), 50, new_state);
ns_req.wait();
//save_unexplored_to_db(new_state);
if (!localFrontier.empty())
f_alpha = (static_cast<double>(localFrontier.size()) * (localFrontier.back().get_size()))/tot_sys_mem;
else
@ -420,7 +489,9 @@ void task_three(AGGenInstance &instance, NetworkState &new_state, std::deque<Net
//Store new state in database to ensure proper ordering of the FIFO queue
else if (!unex_empty()){
save_unexplored_to_db(new_state);
mpi::request ns_req = world.isend(send_check(world, alloc+two_alloc+1), 50, new_state);
ns_req.wait();
//save_unexplored_to_db(new_state);
}
//Otherwise, we can just store in memory
@ -430,10 +501,11 @@ void task_three(AGGenInstance &instance, NetworkState &new_state, std::deque<Net
if (i_alpha >= mem_threshold/2){
//std::cout << "Instance Alpha prior to database storing: " << i_alpha << std::endl;
world.isend(send_check(world, 2*two_alloc), 7, instance.factbases);
world.isend(send_check(world, 2*two_alloc), 8, instance.edges);
mpi::request fb_req = world.isend(send_check(world, alloc+two_alloc), 7, instance.factbases);
mpi::request ed_req = world.isend(send_check(world, alloc+two_alloc), 8, instance.edges);
//save_ag_to_db(instance, true);
fb_req.wait();
ed_req.wait();
//Clear vectors and free memory
std::vector<Factbase>().swap(instance.factbases);
std::vector<FactbaseItems>().swap(instance.factbase_items);

View File

@ -16,7 +16,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
std::vector<std::string> ex_groups, std::unordered_map<size_t, int> &hash_map);
void task_three(AGGenInstance &instance, NetworkState &new_state, std::deque<NetworkState> &localFrontier,\
double mem_threshold, boost::mpi::communicator &world, int two_alloc, NetworkState &current_state,\
double mem_threshold, boost::mpi::communicator &world, int alloc, int two_alloc, NetworkState &current_state,\
Exploit &exploit, AssetGroup &assetGroup, std::unordered_map<size_t, int> &hash_map);
void task_four(NetworkState &new_state);