// File: /workspace/github_cpp_makefile_star2_O3/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 0x94fdb
leaq 0x5d451(%rip), %rsi     # 0xf239f
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x950e4
leaq 0x5d440(%rip), %rsi     # 0xf23a5
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x950e4
leaq 0x5d434(%rip), %rsi     # 0xf23b0
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x950e4
leaq 0x5d419(%rip), %rsi     # 0xf23ac
movq %rbp, %rdi
callq 0x22250
testl %eax, %eax
je 0x950e4
leaq 0x1b0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x6aabd(%rip), %rsi     # 0xffa73
leaq 0x6ab2f(%rip), %rdx     # 0xffaec
movq %rbx, %r15
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0x321d2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x784c2
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 0x6a8e1(%rip), %rsi     # 0xff907
leaq 0x6a8e4(%rip), %rdx     # 0xff911
leaq 0x160(%rsp), %rdi
callq 0x321d2
leaq 0x160(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xbf954
movq 0x160(%rsp), %rdi
cmpq %r13, %rdi
je 0x9506c
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
je 0x952e2
movl $0x5, %r8d
leaq 0x5d317(%rip), %rcx     # 0xf239f
movq 0x1738(%rbx), %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x22fb0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x950b0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x950c7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x950e4
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1738(%rbx)
jne 0x952d0
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 0xe0e79(%rip), %rbp     # 0x175fa8
movq 0xe0ea2(%rip), %r12     # 0x175fd8
leaq 0x8(%rsp), %rbx
leaq 0x1c0(%rsp), %r15
leaq 0x28(%rsp), %r14
movl $0x73, %edx
movq %rbp, %rdi
leaq 0x6a996(%rip), %rsi     # 0xffaed
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 (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x23300
movq %r15, %rdi
movq %rbx, %rsi
movl $0x18, %edx
callq 0x23020
movq %r15, %rdi
movq %r14, %rsi
callq 0x22c50
movq %r14, %rdi
leaq 0x630a5(%rip), %rsi     # 0xf8271
callq 0x22250
movl $0x5, %r13d
testl %eax, %eax
je 0x9524c
movq %r14, %rdi
leaq 0x98aa8(%rip), %rsi     # 0x12dc8d
callq 0x22250
testl %eax, %eax
je 0x9524c
movq %r14, %rdi
leaq 0x5e472(%rip), %rsi     # 0xf366a
callq 0x22250
movl $0x6, %r13d
testl %eax, %eax
je 0x95255
movq %r14, %rdi
leaq 0x98c52(%rip), %rsi     # 0x12de63
callq 0x22250
testl %eax, %eax
je 0x95255
movq 0x78(%rsp), %rdi
leaq 0x98cd5(%rip), %rsi     # 0x12defb
callq 0x22250
movq %r15, %rdi
movq 0xe0d1b(%rip), %rsi     # 0x175f50
callq 0x226f0
leaq 0x240(%rsp), %rdi
callq 0x222d0
jmp 0x95148
leaq 0x5d14c(%rip), %rcx     # 0xf239f
jmp 0x9525c
leaq 0x5d149(%rip), %rcx     # 0xf23a5
movq 0x70(%rsp), %rax
movq 0x1738(%rax), %rdx
movq 0x68(%rsp), %rdi
xorl %esi, %esi
movq %r13, %r8
callq 0x22fb0
movq 0xe0cd2(%rip), %rsi     # 0x175f50
leaq 0x1c0(%rsp), %rdi
callq 0x226f0
leaq 0x240(%rsp), %rdi
callq 0x222d0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x952b4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x952d0
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 0x6a61d(%rip), %rsi     # 0xff912
leaq 0x6a620(%rip), %rdx     # 0xff91c
leaq 0x140(%rsp), %rdi
callq 0x321d2
leaq 0x140(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xbf954
movq 0x140(%rsp), %rdi
cmpq %r13, %rdi
je 0x9533b
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
je 0x95577
leaq 0x130(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x6a5c0(%rip), %rsi     # 0xff91d
leaq 0x6a5c3(%rip), %rdx     # 0xff927
leaq 0x120(%rsp), %rdi
callq 0x321d2
leaq 0x120(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xbf954
movq 0x120(%rsp), %rdi
cmpq %r13, %rdi
je 0x953a3
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x110(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x6a572(%rip), %rsi     # 0xff928
leaq 0x6a575(%rip), %rdx     # 0xff932
leaq 0x100(%rsp), %rdi
callq 0x321d2
leaq 0x100(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xbf954
movq 0x100(%rsp), %rdi
cmpq %r13, %rdi
je 0x953f9
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x10(%rsp), %rax
orq 0x1c8(%rsp), %rax
jne 0x9563f
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 0x6a4fd(%rip), %rsi     # 0xff933
leaq 0x6a505(%rip), %rdx     # 0xff942
leaq 0xe0(%rsp), %rdi
callq 0x321d2
leaq 0xe0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xbf954
movq 0xe0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x9547c
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xd0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x6a4b4(%rip), %rsi     # 0xff943
leaq 0x6a4b8(%rip), %rdx     # 0xff94e
leaq 0xc0(%rsp), %rdi
callq 0x321d2
leaq 0xc0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xbf954
movq 0xc0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x954d2
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xb0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x6a46a(%rip), %rsi     # 0xff94f
leaq 0x6a46d(%rip), %rdx     # 0xff959
leaq 0xa0(%rsp), %rdi
callq 0x321d2
leaq 0xa0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xbf954
movq 0xa0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95528
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
jne 0x95651
cmpq $0x0, 0x10(%rsp)
jne 0x95651
cmpq $0x0, 0x50(%rsp)
jne 0x95651
movq %r13, %rbp
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x95099
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x95099
movq 0x1c0(%rsp), %rax
movb $0x0, (%rax)
leaq 0x90(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x6a47f(%rip), %rsi     # 0xffa14
leaq 0x6a484(%rip), %rdx     # 0xffa20
leaq 0x80(%rsp), %rdi
callq 0x321d2
leaq 0x80(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xbf954
movq 0x80(%rsp), %rdi
cmpq %r13, %rdi
je 0x955db
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x1c8(%rsp)
je 0x95099
movq 0x1738(%rbx), %rdx
leaq 0x5cdb8(%rip), %rcx     # 0xf23b0
movl $0x3, %r8d
movq %rbp, %rdi
xorl %esi, %esi
callq 0x22fb0
cmpq $0x0, 0x17c8(%rbx)
jne 0x95099
movq 0xe098b(%rip), %rdi     # 0x175fa8
leaq 0x6a3fd(%rip), %rsi     # 0xffa21
movl $0x51, %edx
callq 0x22ab0
movq 0xe0973(%rip), %rdi     # 0x175fa8
callq 0x22430
jmp 0x95099
movl $0x6, %r8d
leaq 0x5cd59(%rip), %rcx     # 0xf23a5
jmp 0x95088
leaq 0x190(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x6a2f6(%rip), %rsi     # 0xff95a
leaq 0x6a3a8(%rip), %rdx     # 0xffa13
leaq 0x180(%rsp), %rdi
callq 0x321d2
leaq 0x180(%rsp), %rsi
movq %rbx, %rdi
callq 0x784c2
movq %rax, %rbx
movq 0x180(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95701
movq 0x190(%rsp), %rsi
jmp 0x956f4
jmp 0x956fe
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95701
movq 0xb0(%rsp), %rsi
jmp 0x956f4
jmp 0x956fe
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95701
movq 0xd0(%rsp), %rsi
jmp 0x956f4
jmp 0x956fe
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x95701
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x95701
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x957e6
movq 0x58(%rsp), %rsi
jmp 0x957d9
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r13, %rdi
je 0x957e6
movq 0x90(%rsp), %rsi
jmp 0x957d9
jmp 0x957e3
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r13, %rdi
je 0x957e6
movq 0x110(%rsp), %rsi
jmp 0x957d9
jmp 0x957e3
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r13, %rdi
je 0x957e6
movq 0x130(%rsp), %rsi
jmp 0x957d9
jmp 0x957e3
movq %rax, %rbx
movq 0x140(%rsp), %rdi
cmpq %r13, %rdi
je 0x957e6
movq 0x150(%rsp), %rsi
jmp 0x957d9
jmp 0x957e3
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x9588e
movq 0x1b0(%rsp), %rsi
jmp 0x95886
jmp 0x957e3
jmp 0x9582b
movq %rax, %rbx
movq 0x160(%rsp), %rdi
cmpq %r13, %rdi
je 0x957e6
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x957e6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x957fd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x95814
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x9588e
movq 0x1d0(%rsp), %rsi
jmp 0x95886
movq %rax, %rbx
movq 0xe071b(%rip), %rsi     # 0x175f50
leaq 0x1c0(%rsp), %rdi
callq 0x226f0
leaq 0x240(%rsp), %rdi
callq 0x222d0
jmp 0x95856
jmp 0x95853
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x95872
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9588e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240