// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::generateBNF2MPICommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string Swarm::generateBNF2MPICommand(string cmd) {

	if(options.verbosity >=4){
		cout << "Entering generateBNF2MPICommand()" << endl;
	}
	int maxSubPar = 0;
	maxSubPar = fcalcsubParID(options.swarmSize, options.models.size()-1, options.models.size());


	//sbatch << "mpirun -prepend-rank -np 1 " << runCmd << " load " << sConf_ << " : -np " << options.swarmSize << " " << runCmd << " particle 0 run " << sConf_ << endl;
	string newCmd = "mpirun -oversubscribe ";
	if (options.hostfile.size()) {
		newCmd += "-hostfile " + options.hostfile + " ";
	}
	newCmd += "-tag-output -np 1 " + cmd + " -a load -c " + sConf_[0] + " : -oversubscribe ";
	if (options.hostfile.size()) {
		newCmd += "-hostfile " + options.hostfile + " ";
	}
	newCmd += "-tag-output -np " + toString(maxSubPar) + " " + cmd + " -t particle -p 0 -a run -c " + sConf_[0];

	if (options.saveClusterOutput) {
		newCmd += " > " + options.outputDir + "/" + options.jobName + "_cluster_output/" + options.jobName + " 2>&1";
	}
	if(options.verbosity >=3){
	cout << "MPI command built from generateBNF2MPICommand: " << endl << newCmd << endl;
	}
	return newCmd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x4, 0x1614(%rsi)
jb 0x7df26
movq 0xe8086(%rip), %rdi     # 0x165f98
leaq 0x604c9(%rip), %rsi     # 0xde3e2
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movl 0x1620(%r14), %edi
movq 0x15c8(%r14), %rdx
subq 0x15c0(%r14), %rdx
shrq $0x3, %rdx
leal -0x1(%rdx), %esi
callq 0x9ec09
movl %eax, %ebp
leaq 0x604b4(%rip), %rsi     # 0xde404
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x33402
leaq 0x17c0(%r14), %r12
cmpq $0x0, 0x17c8(%r14)
je 0x7dfb1
leaq 0x603c9(%rip), %rsi     # 0xde33c
leaq 0x20(%rsp), %rdi
movq %r12, %rdx
callq 0x3338b
leaq 0x61686(%rip), %rdx     # 0xdf60d
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3336c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x294d0
movq %rsp, %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x6079f(%rip), %rsi     # 0xde757
leaq 0x40(%rsp), %rdi
movq %r15, %rdx
callq 0x3338b
leaq 0x603b6(%rip), %rdx     # 0xde382
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3336c
movq 0x1938(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x334ce
leaq 0x60423(%rip), %rdx     # 0xde41b
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3336c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x294d0
movq %rsp, %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x60(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
cmpq $0x0, 0x17c8(%r14)
je 0x7e085
leaq 0x602f5(%rip), %rsi     # 0xde33c
leaq 0x20(%rsp), %rdi
movq %r12, %rdx
callq 0x3338b
leaq 0x615b2(%rip), %rdx     # 0xdf60d
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3336c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x294d0
movq %rsp, %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x80(%rsp), %rdi
movl %ebp, %esi
callq 0x9e9c3
leaq 0x60309(%rip), %rsi     # 0xde3a4
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x4933b
leaq 0x61556(%rip), %rdx     # 0xdf60d
leaq 0x40(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3336c
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r15, %rdx
callq 0x334ce
leaq 0x6034c(%rip), %rdx     # 0xde42e
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x3336c
movq 0x1938(%r14), %rdx
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x334ce
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x294d0
movq %rsp, %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x60(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
leaq 0xa0(%rsp), %rdi
callq 0x295a0
leaq 0x80(%rsp), %rdi
callq 0x295a0
cmpb $0x1, 0x1770(%r14)
jne 0x7e238
leaq 0x1500(%r14), %rdx
leaq 0x5e85c(%rip), %rsi     # 0xdc9c8
leaq 0x80(%rsp), %rdi
callq 0x3338b
leaq 0x5f837(%rip), %rdx     # 0xdd9b7
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x3336c
leaq 0x14c0(%r14), %r15
leaq 0x40(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
movq %r15, %rdx
callq 0x334ce
leaq 0x60219(%rip), %rdx     # 0xde3d1
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3336c
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %r15, %rdx
callq 0x334ce
leaq 0x58918(%rip), %rdx     # 0xd6af8
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3336c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x294d0
movq %rsp, %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x60(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
leaq 0xa0(%rsp), %rdi
callq 0x295a0
leaq 0x80(%rsp), %rdi
callq 0x295a0
cmpl $0x3, 0x1614(%r14)
jb 0x7e270
movq 0xe7d4f(%rip), %rdi     # 0x165f98
leaq 0x601fb(%rip), %rsi     # 0xde44b
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
movq %rbx, %rax
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7e2bf
jmp 0x7e2cc
jmp 0x7e2db
jmp 0x7e2ea
jmp 0x7e2f9
jmp 0x7e313
jmp 0x7e356
jmp 0x7e2a0
jmp 0x7e2ad
jmp 0x7e356
movq %rax, %r14
movq %rsp, %rdi
callq 0x295a0
jmp 0x7e2b0
movq %rax, %r14
leaq 0x20(%rsp), %rdi
jmp 0x7e34d
jmp 0x7e356
movq %rax, %r14
movq %rsp, %rdi
callq 0x295a0
jmp 0x7e2cf
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x295a0
jmp 0x7e2de
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x295a0
jmp 0x7e2ed
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x295a0
jmp 0x7e2fc
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x295a0
leaq 0x80(%rsp), %rdi
jmp 0x7e34d
movq %rax, %r14
jmp 0x7e309
jmp 0x7e356
movq %rax, %r14
movq %rsp, %rdi
callq 0x295a0
jmp 0x7e32a
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x295a0
jmp 0x7e339
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x295a0
jmp 0x7e348
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x295a0
jmp 0x7e359
jmp 0x7e356
movq %rax, %r14
movq %rbx, %rdi
callq 0x295a0
movq %r14, %rdi
callq 0x292f0
nop