// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::getClusterInformation()
void Swarm::getClusterInformation() {

	// If user didn't specify cluster platform, let's figure it out ourself
	if (options.clusterSoftware.size() == 0) {
		// Test for slurm
		string output;
		string output2;
		string output3;

		runCommand("which srun", output);
		if (output.length() > 0) {
			options.clusterSoftware = "slurm";
		}
		// Test for PBS-type
		else{
			runCommand("which qsub", output);
			if(output.length() > 0) {
				// Test for Torque/PBS
				runCommand("which maui", output);
				runCommand("which moab", output2);
				if(output.length() > 0 || output2.length() > 0) {
					options.clusterSoftware = "torque";
				}
				// Test for SGE
				else {
					string output3;
					runCommand("which sge_execd", output);
					runCommand("which qconf", output2);
					runCommand("which qmon", output3);
					if (output.length() > 0 || output2.length() > 0 || output3.length() > 0) {
						outputError("Error: BioNetFit doesn't support GridEngine clusters. If you are not running on a GridEngine cluster, specify the cluster platform in the .conf file using the 'cluster_software' option.");
					}
				}
			}
			// Test for mpi
			else {
				output.clear();
				runCommand("which mpirun", output);

				if (output.length() > 0) {
					options.clusterSoftware = "mpi";

					if (options.hostfile.size() <= 0) {
						cout << "Warning: You are using mpi, but failed to specify a hostfile in your .conf file.." << endl;
					}
				}
			}
		}
	}
	else {
		if (options.clusterSoftware != "slurm" && options.clusterSoftware != "torque" && options.clusterSoftware != "mpi" && options.clusterSoftware != "BNF2mpi") {
			outputError("You specified an unrecognized cluster type in your .conf file. BioNetFit only supports 'torque' or 'slurm' cluster types.");
		}
	}

	// If we still don't know the cluster type, let's ask the user.
	if (options.clusterSoftware.size() == 0) {
		string input;
		string clusterType;

		while (1) {
			cout << "BioNetFit couldn't determine which type of cluster software you are using. Specify (T) for Torque, or (S) for Slurm" << endl;
			getline(cin, input);
			stringstream myInp(input);
			myInp >> clusterType;
			
			if (clusterType == "S" || clusterType == "s") {
				options.clusterSoftware = "slurm";
				break;
			}
			else if (clusterType == "T" || clusterType == "t") {
				options.clusterSoftware = "torque";
				break;
			}
			
			
			if (options.fitType == "de") {
			//	processParamsDE(paramsVec, subParID, fitCalc);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rdi, %rbx
leaq 0x1730(%rdi), %rbp
cmpq $0x0, 0x1738(%rdi)
je 0x958eb
leaq 0x5cb61(%rip), %rsi     # 0xf23bf
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x959f4
leaq 0x5cb50(%rip), %rsi     # 0xf23c5
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x959f4
leaq 0x5cb44(%rip), %rsi     # 0xf23d0
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x959f4
leaq 0x5cb29(%rip), %rsi     # 0xf23cc
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x959f4
leaq 0x1b0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6a1c6(%rip), %rsi     # 0xffa8c
leaq 0x6a238(%rip), %rdx     # 0xffb05
movq %rbx, %r15
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x32210
movq %r15, %rdi
movq %rbx, %rsi
callq 0x78b66
leaq 0x1d0(%rsp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x170(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x69fea(%rip), %rsi     # 0xff920
leaq 0x69fed(%rip), %rdx     # 0xff92a
leaq 0x160(%rsp), %rdi
callq 0x32210
leaq 0x160(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xc02c3
movq 0x160(%rsp), %rdi
cmpq %r13, %rdi
je 0x9597c
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
je 0x95bf1
movl $0x5, %r8d
leaq 0x5ca27(%rip), %rcx     # 0xf23bf
movq 0x1738(%rbx), %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x22fb0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x959c0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x959d7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x959f4
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1738(%rbx)
jne 0x95bdf
movq %rbp, 0x68(%rsp)
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq %rbx, 0x70(%rsp)
leaq 0x14e0(%rbx), %rax
movq %rax, 0x78(%rsp)
movq 0xe0551(%rip), %rbp     # 0x175f90
movq 0xe057a(%rip), %r15     # 0x175fc0
leaq 0x8(%rsp), %rbx
leaq 0x1c0(%rsp), %r13
leaq 0x28(%rsp), %r14
movl $0x73, %edx
movq %rbp, %rdi
leaq 0x6a09f(%rip), %rsi     # 0xffb06
callq 0x22ab0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %rbp, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x23300
movq %r13, %rdi
movq %rbx, %rsi
movl $0x18, %edx
callq 0x23020
movq %r13, %rdi
movq %r14, %rsi
callq 0x22c50
movq %r14, %rdi
leaq 0x627e6(%rip), %rsi     # 0xf82c1
callq 0x22250
movl $0x5, %r12d
testl %eax, %eax
je 0x95b5b
movq %r14, %rdi
leaq 0x981b9(%rip), %rsi     # 0x12dcad
callq 0x22250
testl %eax, %eax
je 0x95b5b
movq %r14, %rdi
leaq 0x5dbaf(%rip), %rsi     # 0xf36b6
callq 0x22250
movl $0x6, %r12d
testl %eax, %eax
je 0x95b64
movq %r14, %rdi
leaq 0x98363(%rip), %rsi     # 0x12de83
callq 0x22250
testl %eax, %eax
je 0x95b64
movq 0x78(%rsp), %rdi
leaq 0x983e6(%rip), %rsi     # 0x12df1b
callq 0x22250
movq %r13, %rdi
movq 0xe03f4(%rip), %rsi     # 0x175f38
callq 0x226f0
leaq 0x240(%rsp), %rdi
callq 0x222d0
jmp 0x95a58
leaq 0x5c85d(%rip), %rcx     # 0xf23bf
jmp 0x95b6b
leaq 0x5c85a(%rip), %rcx     # 0xf23c5
movq 0x70(%rsp), %rax
movq 0x1738(%rax), %rdx
movq 0x68(%rsp), %rdi
xorl %esi, %esi
movq %r12, %r8
callq 0x22fb0
movq 0xe03ab(%rip), %rsi     # 0x175f38
leaq 0x1c0(%rsp), %rdi
callq 0x226f0
leaq 0x240(%rsp), %rdi
callq 0x222d0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x95bc3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x95bdf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x150(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x69d27(%rip), %rsi     # 0xff92b
leaq 0x69d2a(%rip), %rdx     # 0xff935
leaq 0x140(%rsp), %rdi
callq 0x32210
leaq 0x140(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xc02c3
movq 0x140(%rsp), %rdi
cmpq %r13, %rdi
je 0x95c4a
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
je 0x95e86
leaq 0x130(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x69cca(%rip), %rsi     # 0xff936
leaq 0x69ccd(%rip), %rdx     # 0xff940
leaq 0x120(%rsp), %rdi
callq 0x32210
leaq 0x120(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xc02c3
movq 0x120(%rsp), %rdi
cmpq %r13, %rdi
je 0x95cb2
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x110(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x69c7c(%rip), %rsi     # 0xff941
leaq 0x69c7f(%rip), %rdx     # 0xff94b
leaq 0x100(%rsp), %rdi
callq 0x32210
leaq 0x100(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc02c3
movq 0x100(%rsp), %rdi
cmpq %r13, %rdi
je 0x95d08
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x10(%rsp), %rax
orq 0x1c8(%rsp), %rax
jne 0x95f5a
movq %rbp, %r13
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xf0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x69c07(%rip), %rsi     # 0xff94c
leaq 0x69c0f(%rip), %rdx     # 0xff95b
leaq 0xe0(%rsp), %rdi
callq 0x32210
leaq 0xe0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xc02c3
movq 0xe0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95d8b
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xd0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x69bbe(%rip), %rsi     # 0xff95c
leaq 0x69bc2(%rip), %rdx     # 0xff967
leaq 0xc0(%rsp), %rdi
callq 0x32210
leaq 0xc0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc02c3
movq 0xc0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95de1
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xb0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x69b74(%rip), %rsi     # 0xff968
leaq 0x69b77(%rip), %rdx     # 0xff972
leaq 0xa0(%rsp), %rdi
callq 0x32210
leaq 0xa0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xc02c3
movq 0xa0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95e37
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
jne 0x95f6c
cmpq $0x0, 0x10(%rsp)
jne 0x95f6c
cmpq $0x0, 0x50(%rsp)
jne 0x95f6c
movq %r13, %rbp
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x959a9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x959a9
movq $0x0, 0x1c8(%rsp)
movq 0x1c0(%rsp), %rax
movb $0x0, (%rax)
leaq 0x90(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x69b7d(%rip), %rsi     # 0xffa2d
leaq 0x69b82(%rip), %rdx     # 0xffa39
leaq 0x80(%rsp), %rdi
callq 0x32210
leaq 0x80(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xc02c3
movq 0x80(%rsp), %rdi
cmpq %r13, %rdi
je 0x95ef6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
je 0x959a9
movq 0x1738(%rbx), %rdx
leaq 0x5c4bd(%rip), %rcx     # 0xf23d0
movl $0x3, %r8d
movq %rbp, %rdi
xorl %esi, %esi
callq 0x22fb0
cmpq $0x0, 0x17c8(%rbx)
jne 0x959a9
movq 0xe0058(%rip), %rdi     # 0x175f90
leaq 0x69afb(%rip), %rsi     # 0xffa3a
movl $0x51, %edx
callq 0x22ab0
movq 0xe0040(%rip), %rdi     # 0x175f90
callq 0x22430
jmp 0x959a9
movl $0x6, %r8d
leaq 0x5c45e(%rip), %rcx     # 0xf23c5
jmp 0x95998
leaq 0x190(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x699f4(%rip), %rsi     # 0xff973
leaq 0x69aa6(%rip), %rdx     # 0xffa2c
leaq 0x180(%rsp), %rdi
callq 0x32210
leaq 0x180(%rsp), %rsi
movq %rbx, %rdi
callq 0x78b66
movq %rax, %rbx
movq 0x180(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9601c
movq 0x190(%rsp), %rsi
jmp 0x9600f
jmp 0x96019
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9601c
movq 0xb0(%rsp), %rsi
jmp 0x9600f
jmp 0x96019
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9601c
movq 0xd0(%rsp), %rsi
jmp 0x9600f
jmp 0x96019
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9601c
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x9601c
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x96101
movq 0x58(%rsp), %rsi
jmp 0x960f4
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r13, %rdi
je 0x96101
movq 0x90(%rsp), %rsi
jmp 0x960f4
jmp 0x960fe
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r13, %rdi
je 0x96101
movq 0x110(%rsp), %rsi
jmp 0x960f4
jmp 0x960fe
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r13, %rdi
je 0x96101
movq 0x130(%rsp), %rsi
jmp 0x960f4
jmp 0x960fe
movq %rax, %rbx
movq 0x140(%rsp), %rdi
cmpq %r13, %rdi
je 0x96101
movq 0x150(%rsp), %rsi
jmp 0x960f4
jmp 0x960fe
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x961a9
movq 0x1b0(%rsp), %rsi
jmp 0x961a1
jmp 0x960fe
jmp 0x96146
movq %rax, %rbx
movq 0x160(%rsp), %rdi
cmpq %r13, %rdi
je 0x96101
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x96101
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x96118
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x9612f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x961a9
movq 0x1d0(%rsp), %rsi
jmp 0x961a1
movq %rax, %rbx
movq 0xdfde8(%rip), %rsi     # 0x175f38
leaq 0x1c0(%rsp), %rdi
callq 0x226f0
leaq 0x240(%rsp), %rdi
callq 0x222d0
jmp 0x96171
jmp 0x9616e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x9618d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x961a9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop